diff --git a/Cargo.lock b/Cargo.lock index 0a62dc5fa..a3065e0b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1520,6 +1520,7 @@ dependencies = [ "soroban-ledger-snapshot", "soroban-sdk-macros", "soroban-spec", + "soroban-spec-markers", "stellar-strkey 0.0.16", "stellar-xdr", "visibility", @@ -1538,6 +1539,7 @@ dependencies = [ "sha2", "soroban-env-common", "soroban-spec", + "soroban-spec-markers", "soroban-spec-rust", "stellar-xdr", "syn", @@ -1549,12 +1551,19 @@ version = "26.0.0-rc.1" dependencies = [ "base64", "pretty_assertions", - "sha2", + "soroban-spec-markers", "stellar-xdr", "thiserror", "wasmparser", ] +[[package]] +name = "soroban-spec-markers" +version = "26.0.0-rc.1" +dependencies = [ + "sha2", +] + [[package]] name = "soroban-spec-rust" version = "26.0.0-rc.1" diff --git a/Cargo.toml b/Cargo.toml index 91a91e64b..54ec47ed2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ members = [ "soroban-sdk-macros", "soroban-meta", "soroban-spec", + "soroban-spec-markers", "soroban-spec-rust", "soroban-ledger-snapshot", "soroban-token-sdk", @@ -23,6 +24,7 @@ soroban-sdk = { version = "26.0.0-rc.1", path = "soroban-sdk" } soroban-sdk-macros = { version = "26.0.0-rc.1", path = "soroban-sdk-macros" } soroban-meta = { version = "26.0.0-rc.1", path = "soroban-meta" } soroban-spec = { version = "26.0.0-rc.1", path = "soroban-spec" } +soroban-spec-markers = { version = "26.0.0-rc.1", path = "soroban-spec-markers", default-features = false } soroban-spec-rust = { version = "26.0.0-rc.1", path = "soroban-spec-rust" } soroban-ledger-snapshot = { version = "26.0.0-rc.1", path = "soroban-ledger-snapshot" } soroban-token-sdk = { version = "26.0.0-rc.1", path = "soroban-token-sdk" } diff --git a/Makefile b/Makefile index 55a881025..20f959805 100644 --- a/Makefile +++ b/Makefile @@ -19,11 +19,12 @@ test: fmt build-test-wasms test-only # hazmat granular features are excluded because all hazmat features are tested # together with the umbrella hazmat feature. test-only: - cargo hack --feature-powerset --ignore-unknown-features --features testutils \ - --exclude-features docs \ - --exclude-features hazmat-crypto \ - --exclude-features hazmat-address \ - test + SOROBAN_SDK_BUILD_SYSTEM_SUPPORTS_SPEC_SHAKING_V2=1 \ + cargo hack --feature-powerset --ignore-unknown-features --features testutils \ + --exclude-features docs \ + --exclude-features hazmat-crypto \ + --exclude-features hazmat-address \ + test build: build-libs build-test-wasms diff --git a/soroban-sdk-macros/Cargo.toml b/soroban-sdk-macros/Cargo.toml index a9f1d5a00..04ff473c4 100644 --- a/soroban-sdk-macros/Cargo.toml +++ b/soroban-sdk-macros/Cargo.toml @@ -16,6 +16,7 @@ doctest = false [dependencies] soroban-spec = { workspace = true } +soroban-spec-markers = { workspace = true, features = ["alloc", "hash"] } soroban-spec-rust = { workspace = true } soroban-env-common = { workspace = true } stellar-xdr = { workspace = true, features = ["curr", "std"] } diff --git a/soroban-sdk-macros/src/derive_contractimpl_trait_default_fns_not_overridden.rs b/soroban-sdk-macros/src/derive_contractimpl_trait_default_fns_not_overridden.rs index db66cc18a..5c3bb6c3c 100644 --- a/soroban-sdk-macros/src/derive_contractimpl_trait_default_fns_not_overridden.rs +++ b/soroban-sdk-macros/src/derive_contractimpl_trait_default_fns_not_overridden.rs @@ -70,7 +70,12 @@ fn derive(args: &Args) -> Result { Some(trait_ident), &args.client_name, )); - output.extend(derive_fns_spec(&args.spec_name, &fns, spec_export)); + output.extend(derive_fns_spec( + &args.crate_path, + &args.spec_name, + &fns, + spec_export, + )); output.extend(derive_client_impl( &args.crate_path, &args.client_name, diff --git a/soroban-sdk-macros/src/derive_enum.rs b/soroban-sdk-macros/src/derive_enum.rs index 4e590e0a4..54c0c5224 100644 --- a/soroban-sdk-macros/src/derive_enum.rs +++ b/soroban-sdk-macros/src/derive_enum.rs @@ -1,6 +1,6 @@ use itertools::MultiUnzip; use proc_macro2::{Literal, TokenStream as TokenStream2}; -use quote::{format_ident, quote, ToTokens}; +use quote::{format_ident, quote}; use syn::{ ext::IdentExt as _, spanned::Spanned, Attribute, DataEnum, Error, Fields, Ident, Path, Visibility, @@ -36,12 +36,12 @@ pub fn derive_type_enum( let ( spec_cases, case_name_str_lits, - variant_field_types, try_froms, try_intos, try_from_xdrs, into_xdrs, - ): (Vec<_>, Vec<_>, Vec>, Vec<_>, Vec<_>, Vec<_>, Vec<_>) = variants + case_type_id_refs, + ): (Vec<_>, Vec<_>, Vec<_>, Vec<_>, Vec<_>, Vec<_>, Vec<_>) = variants .iter() .enumerate() .map(|(case_num, variant)| { @@ -80,9 +80,6 @@ pub fn derive_type_enum( _ => {} } - // Collect field types for SpecShakingMarker - let field_types: Vec<_> = variant.fields.iter().map(|f| &f.ty).collect(); - let is_unit_variant = variant.fields == Fields::Unit; if !is_unit_variant { let VariantTokens { @@ -91,6 +88,7 @@ pub fn derive_type_enum( try_into, try_from_xdr, into_xdr, + type_id_refs, } = map_tuple_variant( path, enum_ident, @@ -105,11 +103,11 @@ pub fn derive_type_enum( ( spec_case, case_name_str_lit, - field_types, try_from, try_into, try_from_xdr, into_xdr, + type_id_refs, ) } else { let VariantTokens { @@ -118,6 +116,7 @@ pub fn derive_type_enum( try_into, try_from_xdr, into_xdr, + type_id_refs, } = map_empty_variant( path, enum_ident, @@ -130,11 +129,11 @@ pub fn derive_type_enum( ( spec_case, case_name_str_lit, - field_types, try_from, try_into, try_from_xdr, into_xdr, + type_id_refs, ) } }) @@ -146,21 +145,31 @@ pub fn derive_type_enum( return quote! { #(#compile_errors)* }; } - // Compute spec XDR once if spec is enabled. - let spec_xdr = if spec { - let spec_entry = ScSpecEntry::UdtUnionV0(ScSpecUdtUnionV0 { - doc: docs_from_attrs(attrs), - lib: lib.as_deref().unwrap_or_default().try_into().unwrap(), - name: enum_ident.unraw().to_string().try_into().unwrap(), - cases: spec_cases.try_into().unwrap(), - }); - Some(spec_entry.to_xdr(DEFAULT_XDR_RW_LIMITS).unwrap()) + // Compute spec XDR once. Spec shaking v2 emits SpecTypeId even for + // `export = false` types so graph records can be built without exporting + // those types to `contractspecv0`. + let spec_entry = ScSpecEntry::UdtUnionV0(ScSpecUdtUnionV0 { + doc: docs_from_attrs(attrs), + lib: lib.as_deref().unwrap_or_default().try_into().unwrap(), + name: enum_ident.unraw().to_string().try_into().unwrap(), + cases: spec_cases.try_into().unwrap(), + }); + let spec_xdr = spec_entry.to_xdr(DEFAULT_XDR_RW_LIMITS).unwrap(); + let spec_shaking_gen = if cfg!(feature = "experimental_spec_shaking_v2") { + shaking::generate_udt_shaking( + path, + enum_ident, + &spec_xdr, + case_type_id_refs.into_iter().flatten().collect(), + spec, + false, + ) } else { None }; // Generated code spec. - let spec_gen = if let Some(ref spec_xdr) = spec_xdr { + let spec_gen = if spec { let spec_xdr_lit = proc_macro2::Literal::byte_string(spec_xdr.as_slice()); let spec_xdr_len = spec_xdr.len(); let spec_ident = format_ident!( @@ -176,41 +185,17 @@ pub fn derive_type_enum( *#spec_xdr_lit } } - }) - } else { - None - }; - // SpecShakingMarker impl - only generated when spec is true and the - // experimental_spec_shaking_v2 feature is enabled. - let spec_shaking_impl = if cfg!(feature = "experimental_spec_shaking_v2") { - spec_xdr.as_ref().map(|spec_xdr| { - // Flatten all variant field types for shaking calls, deduplicating - // to avoid redundant calls for types that appear in multiple variants. - let all_field_types = - itertools::Itertools::unique_by(variant_field_types.iter().flatten(), |t| { - t.to_token_stream().to_string() - }); - shaking::generate_marker_impl( - path, - quote!(#enum_ident), - spec_xdr, - all_field_types.cloned(), - None, - None, - None, - ) + #spec_shaking_gen }) } else { - None + spec_shaking_gen }; // Output. let mut output = quote! { #spec_gen - #spec_shaking_impl - impl #path::TryFromVal<#path::Env, #path::Val> for #enum_ident { type Error = #path::ConversionError; #[inline(always)] @@ -329,6 +314,7 @@ struct VariantTokens { try_into: TokenStream2, try_from_xdr: TokenStream2, into_xdr: TokenStream2, + type_id_refs: Vec, } fn map_empty_variant( @@ -380,6 +366,7 @@ fn map_empty_variant( try_into, try_from_xdr, into_xdr, + type_id_refs: Vec::new(), } } @@ -433,7 +420,14 @@ fn map_tuple_variant( type_: field_types, }) }; - + let type_id_refs = if cfg!(feature = "experimental_spec_shaking_v2") { + fields + .iter() + .flat_map(|field| shaking::type_id_refs(path, &field.ty)) + .collect::>() + } else { + Vec::new() + }; let num_fields = fields.iter().len(); let try_from = { let field_convs = fields @@ -519,5 +513,6 @@ fn map_tuple_variant( try_into, try_from_xdr, into_xdr, + type_id_refs, } } diff --git a/soroban-sdk-macros/src/derive_enum_int.rs b/soroban-sdk-macros/src/derive_enum_int.rs index 1b74ab229..dd91d2059 100644 --- a/soroban-sdk-macros/src/derive_enum_int.rs +++ b/soroban-sdk-macros/src/derive_enum_int.rs @@ -68,21 +68,24 @@ pub fn derive_type_enum_int( return quote! { #(#compile_errors)* }; } - // Compute spec XDR once if spec is enabled. - let spec_xdr = if spec { - let spec_entry = ScSpecEntry::UdtEnumV0(ScSpecUdtEnumV0 { - doc: docs_from_attrs(attrs), - lib: lib.as_deref().unwrap_or_default().try_into().unwrap(), - name: enum_ident.unraw().to_string().try_into().unwrap(), - cases: spec_cases.try_into().unwrap(), - }); - Some(spec_entry.to_xdr(DEFAULT_XDR_RW_LIMITS).unwrap()) + // Compute spec XDR once. Spec shaking v2 emits SpecTypeId even for + // `export = false` types so graph records can be built without exporting + // those types to `contractspecv0`. + let spec_entry = ScSpecEntry::UdtEnumV0(ScSpecUdtEnumV0 { + doc: docs_from_attrs(attrs), + lib: lib.as_deref().unwrap_or_default().try_into().unwrap(), + name: enum_ident.unraw().to_string().try_into().unwrap(), + cases: spec_cases.try_into().unwrap(), + }); + let spec_xdr = spec_entry.to_xdr(DEFAULT_XDR_RW_LIMITS).unwrap(); + let spec_shaking_gen = if cfg!(feature = "experimental_spec_shaking_v2") { + shaking::generate_udt_shaking(path, enum_ident, &spec_xdr, Vec::new(), spec, false) } else { None }; // Generated code spec. - let spec_gen = if let Some(ref spec_xdr) = spec_xdr { + let spec_gen = if spec { let spec_xdr_lit = proc_macro2::Literal::byte_string(spec_xdr.as_slice()); let spec_xdr_len = spec_xdr.len(); let spec_ident = format_ident!( @@ -98,35 +101,17 @@ pub fn derive_type_enum_int( *#spec_xdr_lit } } - }) - } else { - None - }; - // SpecShakingMarker impl - only generated when spec is true and the - // experimental_spec_shaking_v2 feature is enabled. - let spec_shaking_impl = if cfg!(feature = "experimental_spec_shaking_v2") { - spec_xdr.as_ref().map(|spec_xdr| { - shaking::generate_marker_impl( - path, - quote!(#enum_ident), - spec_xdr, - std::iter::empty(), - None, - None, - None, - ) + #spec_shaking_gen }) } else { - None + spec_shaking_gen }; // Output. let mut output = quote! { #spec_gen - #spec_shaking_impl - impl #path::TryFromVal<#path::Env, #path::Val> for #enum_ident { type Error = #path::ConversionError; #[inline(always)] diff --git a/soroban-sdk-macros/src/derive_error_enum_int.rs b/soroban-sdk-macros/src/derive_error_enum_int.rs index ac19a0533..741555cc5 100644 --- a/soroban-sdk-macros/src/derive_error_enum_int.rs +++ b/soroban-sdk-macros/src/derive_error_enum_int.rs @@ -65,21 +65,24 @@ pub fn derive_type_error_enum_int( return quote! { #(#compile_errors)* }; } - // Compute spec XDR once if spec is enabled. - let spec_xdr = if spec { - let spec_entry = ScSpecEntry::UdtErrorEnumV0(ScSpecUdtErrorEnumV0 { - doc: docs_from_attrs(attrs), - lib: lib.as_deref().unwrap_or_default().try_into().unwrap(), - name: enum_ident.unraw().to_string().try_into().unwrap(), - cases: spec_cases.try_into().unwrap(), - }); - Some(spec_entry.to_xdr(DEFAULT_XDR_RW_LIMITS).unwrap()) + // Compute spec XDR once. Spec shaking v2 emits SpecTypeId even for + // `export = false` types so graph records can be built without exporting + // those types to `contractspecv0`. + let spec_entry = ScSpecEntry::UdtErrorEnumV0(ScSpecUdtErrorEnumV0 { + doc: docs_from_attrs(attrs), + lib: lib.as_deref().unwrap_or_default().try_into().unwrap(), + name: enum_ident.unraw().to_string().try_into().unwrap(), + cases: spec_cases.try_into().unwrap(), + }); + let spec_xdr = spec_entry.to_xdr(DEFAULT_XDR_RW_LIMITS).unwrap(); + let spec_shaking_gen = if cfg!(feature = "experimental_spec_shaking_v2") { + shaking::generate_udt_shaking(path, enum_ident, &spec_xdr, Vec::new(), spec, true) } else { None }; // Generated code spec. - let spec_gen = if let Some(ref spec_xdr) = spec_xdr { + let spec_gen = if spec { let spec_xdr_lit = proc_macro2::Literal::byte_string(spec_xdr.as_slice()); let spec_xdr_len = spec_xdr.len(); let spec_ident = format_ident!( @@ -95,35 +98,17 @@ pub fn derive_type_error_enum_int( *#spec_xdr_lit } } - }) - } else { - None - }; - // SpecShakingMarker impl - only generated when spec is true and the - // experimental_spec_shaking_v2 feature is enabled. - let spec_shaking_impl = if cfg!(feature = "experimental_spec_shaking_v2") { - spec_xdr.as_ref().map(|spec_xdr| { - shaking::generate_marker_impl( - path, - quote!(#enum_ident), - spec_xdr, - std::iter::empty(), - None, - None, - None, - ) + #spec_shaking_gen }) } else { - None + spec_shaking_gen }; // Output. quote! { #spec_gen - #spec_shaking_impl - impl TryFrom<#path::Error> for #enum_ident { type Error = #path::Error; #[inline(always)] diff --git a/soroban-sdk-macros/src/derive_event.rs b/soroban-sdk-macros/src/derive_event.rs index a8a978406..490a39c04 100644 --- a/soroban-sdk-macros/src/derive_event.rs +++ b/soroban-sdk-macros/src/derive_event.rs @@ -46,12 +46,12 @@ impl FromMeta for DataFormat { } } -impl Into for DataFormat { - fn into(self) -> ScSpecEventDataFormat { - match self { - Self::SingleValue => ScSpecEventDataFormat::SingleValue, - Self::Vec => ScSpecEventDataFormat::Vec, - Self::Map => ScSpecEventDataFormat::Map, +impl From for ScSpecEventDataFormat { + fn from(data_format: DataFormat) -> Self { + match data_format { + DataFormat::SingleValue => ScSpecEventDataFormat::SingleValue, + DataFormat::Vec => ScSpecEventDataFormat::Vec, + DataFormat::Map => ScSpecEventDataFormat::Map, } } } @@ -123,9 +123,6 @@ fn derive_impls(args: &ContractEventArgs, input: &DeriveInput) -> Result = fields.iter().map(|f| &f.ty).collect(); - // Map each field of the struct to a spec for a param, keeping the original Ident // alongside so it can still be used for `self.#ident` field access in the generated // code (raw identifiers like `r#type` need to stay raw for Rust, while the spec name @@ -155,6 +152,7 @@ fn derive_impls(args: &ContractEventArgs, input: &DeriveInput) -> Result Result>(); @@ -190,7 +189,7 @@ fn derive_impls(args: &ContractEventArgs, input: &DeriveInput) -> Result>() .try_into() .unwrap(), @@ -202,8 +201,27 @@ fn derive_impls(args: &ContractEventArgs, input: &DeriveInput) -> Result::spec_shaking_marker(); }) + let spec_shaking_marker = if export && cfg!(feature = "experimental_spec_shaking_v2") { + Some(shaking::generate_marker_block(&spec_xdr)) + } else { + None + }; + let spec_shaking_graph = if export && cfg!(feature = "experimental_spec_shaking_v2") { + let graph_ident = format_ident!( + "__SPEC_GRAPH_EVENT_{}", + input.ident.unraw().to_string().to_uppercase() + ); + Some(shaking::generate_graph_record( + path, + &graph_ident, + input.ident.span(), + soroban_spec_markers::SpecGraphEntryKind::Event, + &spec_xdr, + params_with_idents + .iter() + .flat_map(|(_, _, refs)| refs.clone()) + .collect(), + )) } else { None }; @@ -218,22 +236,8 @@ fn derive_impls(args: &ContractEventArgs, input: &DeriveInput) -> Result. @@ -246,8 +250,8 @@ fn derive_impls(args: &ContractEventArgs, input: &DeriveInput) -> Result>(); let topics_to_vec_val = quote! { use #path::IntoVal; @@ -260,12 +264,12 @@ fn derive_impls(args: &ContractEventArgs, input: &DeriveInput) -> Result>(); let data_params_count = data_params.len(); let data_idents = data_params .iter() - .map(|(ident, _)| ident.clone()) + .map(|(ident, _, _)| ident.clone()) .collect::>(); let data_to_val = match args.data_format { DataFormat::SingleValue if data_params_count == 0 => quote! { @@ -297,14 +301,14 @@ fn derive_impls(args: &ContractEventArgs, input: &DeriveInput) -> Result>(); let data_strs_sorted = data_params_sorted .iter() - .map(|(_, p)| p.name.to_string()) + .map(|(_, p, _)| p.name.to_string()) .collect::>(); quote! { use #path::{EnvBase,IntoVal,unwrap::UnwrapInfallible}; @@ -321,8 +325,6 @@ fn derive_impls(args: &ContractEventArgs, input: &DeriveInput) -> Result #path::Vec<#path::Val> { #topics_to_vec_val @@ -334,7 +336,7 @@ fn derive_impls(args: &ContractEventArgs, input: &DeriveInput) -> Result::publish(self, env); } } diff --git a/soroban-sdk-macros/src/derive_spec_fn.rs b/soroban-sdk-macros/src/derive_spec_fn.rs index 095f3249f..ebba2f73a 100644 --- a/soroban-sdk-macros/src/derive_spec_fn.rs +++ b/soroban-sdk-macros/src/derive_spec_fn.rs @@ -5,28 +5,30 @@ use stellar_xdr::{ ScSpecEntry, ScSpecFunctionInputV0, ScSpecFunctionV0, ScSpecTypeDef, ScSymbol, StringM, WriteXdr, SCSYMBOL_LIMIT, }; -use syn::TypeReference; use syn::{ ext::IdentExt as _, punctuated::Punctuated, spanned::Spanned, token::Comma, Attribute, Error, FnArg, Ident, Pat, ReturnType, Type, TypePath, }; +use syn::{Path, TypeReference}; use crate::attribute::pass_through_attr_to_gen_code; use crate::syn_ext::{self, ty_to_safe_ident_str}; -use crate::{doc::docs_from_attrs, map_type::map_type, DEFAULT_XDR_RW_LIMITS}; +use crate::{doc::docs_from_attrs, map_type::map_type, shaking, DEFAULT_XDR_RW_LIMITS}; pub fn derive_fns_spec<'a>( + path: &Path, ty: &Type, fns: impl IntoIterator, export: bool, ) -> Result { fns.into_iter() - .map(|f| derive_fn_spec(ty, &f.ident, &f.attrs, &f.inputs, &f.output, export)) + .map(|f| derive_fn_spec(path, ty, &f.ident, &f.attrs, &f.inputs, &f.output, export)) .collect() } #[allow(clippy::too_many_arguments)] pub fn derive_fn_spec( + path: &Path, ty: &Type, ident: &Ident, attrs: &[Attribute], @@ -129,6 +131,18 @@ pub fn derive_fn_spec( }) .collect(); + let spec_arg_type_id_refs = inputs + .iter() + .skip(if env_input.is_some() { 1 } else { 0 }) + .flat_map(|a| { + if let FnArg::Typed(pat_type) = a { + shaking::type_id_refs(path, &pat_type.ty) + } else { + Vec::new() + } + }) + .collect::>(); + // Prepare the output. let spec_result = match output { ReturnType::Type(_, ty) => vec![match map_type(ty, true, true) { @@ -140,6 +154,10 @@ pub fn derive_fn_spec( }], ReturnType::Default => vec![], }; + let spec_output_type_id_refs = match output { + ReturnType::Type(_, ty) => shaking::type_id_refs(path, ty), + ReturnType::Default => Vec::new(), + }; // Generated code spec. let name = &ident.unraw().to_string(); @@ -162,8 +180,34 @@ pub fn derive_fn_spec( let spec_xdr = spec_entry.to_xdr(DEFAULT_XDR_RW_LIMITS).unwrap(); let spec_xdr_lit = proc_macro2::Literal::byte_string(spec_xdr.as_slice()); let spec_xdr_len = spec_xdr.len(); + let ty_str = ty_to_safe_ident_str(ty); let spec_ident = format_ident!("__SPEC_XDR_FN_{}", ident.unraw().to_string().to_uppercase()); let spec_fn_ident = format_ident!("spec_xdr_{}", ident); + // Spec shaking v2 invariant: every exported FunctionV0 spec emitted with v2 enabled must + // have a matching function graph record keyed by this exact spec XDR. The graph-aware + // post-build filter keeps functions as roots, but uses this record to discover parameter and + // return UDTs. Emitting one without the other leaves referenced UDTs unresolved and is + // rejected by the post-build filter. + let spec_shaking_graph = if export && cfg!(feature = "experimental_spec_shaking_v2") { + let graph_ident = format_ident!( + "__SPEC_GRAPH_FN_{}_{}", + ty_str.to_uppercase(), + ident.unraw().to_string().to_uppercase() + ); + Some(shaking::generate_graph_record( + path, + &graph_ident, + ident.span(), + soroban_spec_markers::SpecGraphEntryKind::Function, + &spec_xdr, + spec_arg_type_id_refs + .into_iter() + .chain(spec_output_type_id_refs) + .collect(), + )) + } else { + None + }; // If errors have occurred, render them instead. if !errors.is_empty() { @@ -177,7 +221,6 @@ pub fn derive_fn_spec( .filter(|attr| pass_through_attr_to_gen_code(attr)) .collect::>(); - let ty_str = ty_to_safe_ident_str(ty); let hidden_mod_ident = format_ident!("__{}__{}__spec", ty_str, ident); let exported = if export { Some(quote! { @@ -208,5 +251,7 @@ pub fn derive_fn_spec( *#spec_xdr_lit } } + + #spec_shaking_graph }) } diff --git a/soroban-sdk-macros/src/derive_struct.rs b/soroban-sdk-macros/src/derive_struct.rs index 0c968c6a9..3794835ee 100644 --- a/soroban-sdk-macros/src/derive_struct.rs +++ b/soroban-sdk-macros/src/derive_struct.rs @@ -27,7 +27,7 @@ pub fn derive_type_struct( let mut errors = Vec::::new(); let fields = &data.fields; let field_count_usize: usize = fields.len(); - let (spec_fields, field_idents, field_names, field_idx_lits, field_types, try_from_xdrs, try_into_xdrs): (Vec<_>, Vec<_>, Vec<_>, Vec<_>, Vec<_>, Vec<_>, Vec<_>) = fields + let (spec_fields, field_idents, field_names, field_idx_lits, try_from_xdrs, try_into_xdrs, field_type_id_refs): (Vec<_>, Vec<_>, Vec<_>, Vec<_>, Vec<_>, Vec<_>, Vec<_>) = fields .iter() .sorted_by_key(|field| field.ident.as_ref().unwrap().unraw().to_string()) .enumerate() @@ -35,7 +35,6 @@ pub fn derive_type_struct( let field_ident = field.ident.as_ref().unwrap(); let field_name = field_ident.unraw().to_string(); let field_idx_lit = Literal::usize_unsuffixed(field_num); - let field_type = &field.ty; let spec_field = ScSpecUdtStructFieldV0 { doc: docs_from_attrs(&field.attrs), name: field_name.clone().try_into().unwrap_or_else(|_| { @@ -65,7 +64,12 @@ pub fn derive_type_struct( val: (&val.#field_ident).try_into().map_err(|_| #path::xdr::Error::Invalid)?, } }; - (spec_field, field_ident, field_name, field_idx_lit, field_type, try_from_xdr, try_into_xdr) + let field_type_id_refs = if cfg!(feature = "experimental_spec_shaking_v2") { + shaking::type_id_refs(path, &field.ty) + } else { + Vec::new() + }; + (spec_field, field_ident, field_name, field_idx_lit, try_from_xdr, try_into_xdr, field_type_id_refs) }) .multiunzip(); @@ -75,21 +79,31 @@ pub fn derive_type_struct( return quote! { #(#compile_errors)* }; } - // Compute spec XDR once if spec is enabled. - let spec_xdr = if spec { - let spec_entry = ScSpecEntry::UdtStructV0(ScSpecUdtStructV0 { - doc: docs_from_attrs(attrs), - lib: lib.as_deref().unwrap_or_default().try_into().unwrap(), - name: ident.unraw().to_string().try_into().unwrap(), - fields: spec_fields.try_into().unwrap(), - }); - Some(spec_entry.to_xdr(DEFAULT_XDR_RW_LIMITS).unwrap()) + // Compute spec XDR once. Spec shaking v2 emits SpecTypeId even for + // `export = false` types so graph records can be built without exporting + // those types to `contractspecv0`. + let spec_entry = ScSpecEntry::UdtStructV0(ScSpecUdtStructV0 { + doc: docs_from_attrs(attrs), + lib: lib.as_deref().unwrap_or_default().try_into().unwrap(), + name: ident.unraw().to_string().try_into().unwrap(), + fields: spec_fields.try_into().unwrap(), + }); + let spec_xdr = spec_entry.to_xdr(DEFAULT_XDR_RW_LIMITS).unwrap(); + let spec_shaking_gen = if cfg!(feature = "experimental_spec_shaking_v2") { + shaking::generate_udt_shaking( + path, + ident, + &spec_xdr, + field_type_id_refs.into_iter().flatten().collect(), + spec, + false, + ) } else { None }; // Generated code spec. - let spec_gen = if let Some(ref spec_xdr) = spec_xdr { + let spec_gen = if spec { let spec_xdr_lit = proc_macro2::Literal::byte_string(spec_xdr.as_slice()); let spec_xdr_len = spec_xdr.len(); let spec_ident = format_ident!( @@ -105,35 +119,17 @@ pub fn derive_type_struct( *#spec_xdr_lit } } - }) - } else { - None - }; - // SpecShakingMarker impl - only generated when spec is true and the - // experimental_spec_shaking_v2 feature is enabled. - let spec_shaking_impl = if cfg!(feature = "experimental_spec_shaking_v2") { - spec_xdr.as_ref().map(|spec_xdr| { - shaking::generate_marker_impl( - path, - quote!(#ident), - spec_xdr, - field_types.iter().cloned(), - None, - None, - None, - ) + #spec_shaking_gen }) } else { - None + spec_shaking_gen }; // Output. let mut output = quote! { #spec_gen - #spec_shaking_impl - impl #path::TryFromVal<#path::Env, #path::Val> for #ident { type Error = #path::ConversionError; fn try_from_val(env: &#path::Env, val: &#path::Val) -> Result { diff --git a/soroban-sdk-macros/src/derive_struct_tuple.rs b/soroban-sdk-macros/src/derive_struct_tuple.rs index b16511800..14cb0567f 100644 --- a/soroban-sdk-macros/src/derive_struct_tuple.rs +++ b/soroban-sdk-macros/src/derive_struct_tuple.rs @@ -25,7 +25,7 @@ pub fn derive_type_struct_tuple( let fields = &data.fields; let field_count_usize: usize = fields.len(); - let (field_specs, field_idx_lits, field_types, try_from_xdrs, try_into_xdrs): (Vec<_>, Vec<_>, Vec<_>, Vec<_>, Vec<_>) = fields + let (field_specs, field_idx_lits, try_from_xdrs, try_into_xdrs, field_type_id_refs): (Vec<_>, Vec<_>, Vec<_>, Vec<_>, Vec<_>) = fields .iter() .enumerate() .map(|(field_idx, field)| { @@ -33,7 +33,6 @@ pub fn derive_type_struct_tuple( // as the token to reference the field. let field_idx_lit = Literal::usize_unsuffixed(field_idx); let field_name = format!("{}", field_idx); - let field_type = &field.ty; let field_spec = ScSpecUdtStructFieldV0 { doc: docs_from_attrs(&field.attrs), name: field_name.try_into().unwrap_or_else(|_| StringM::default()), @@ -54,7 +53,12 @@ pub fn derive_type_struct_tuple( let try_into_xdr = quote! { (&val.#field_idx_lit).try_into().map_err(|_| #path::xdr::Error::Invalid)? }; - (field_spec, field_idx_lit, field_type, try_from_xdr, try_into_xdr) + let field_type_id_refs = if cfg!(feature = "experimental_spec_shaking_v2") { + shaking::type_id_refs(path, &field.ty) + } else { + Vec::new() + }; + (field_spec, field_idx_lit, try_from_xdr, try_into_xdr, field_type_id_refs) }) .multiunzip(); @@ -64,21 +68,31 @@ pub fn derive_type_struct_tuple( return quote! { #(#compile_errors)* }; } - // Compute spec XDR once if spec is enabled. - let spec_xdr = if spec { - let spec_entry = ScSpecEntry::UdtStructV0(ScSpecUdtStructV0 { - doc: docs_from_attrs(attrs), - lib: lib.as_deref().unwrap_or_default().try_into().unwrap(), - name: ident.unraw().to_string().try_into().unwrap(), - fields: field_specs.try_into().unwrap(), - }); - Some(spec_entry.to_xdr(DEFAULT_XDR_RW_LIMITS).unwrap()) + // Compute spec XDR once. Spec shaking v2 emits SpecTypeId even for + // `export = false` types so graph records can be built without exporting + // those types to `contractspecv0`. + let spec_entry = ScSpecEntry::UdtStructV0(ScSpecUdtStructV0 { + doc: docs_from_attrs(attrs), + lib: lib.as_deref().unwrap_or_default().try_into().unwrap(), + name: ident.unraw().to_string().try_into().unwrap(), + fields: field_specs.try_into().unwrap(), + }); + let spec_xdr = spec_entry.to_xdr(DEFAULT_XDR_RW_LIMITS).unwrap(); + let spec_shaking_gen = if cfg!(feature = "experimental_spec_shaking_v2") { + shaking::generate_udt_shaking( + path, + ident, + &spec_xdr, + field_type_id_refs.into_iter().flatten().collect(), + spec, + false, + ) } else { None }; // Generated code spec. - let spec_gen = if let Some(ref spec_xdr) = spec_xdr { + let spec_gen = if spec { let spec_xdr_lit = proc_macro2::Literal::byte_string(spec_xdr.as_slice()); let spec_xdr_len = spec_xdr.len(); let spec_ident = format_ident!( @@ -94,35 +108,17 @@ pub fn derive_type_struct_tuple( *#spec_xdr_lit } } - }) - } else { - None - }; - // SpecShakingMarker impl - only generated when spec is true and the - // experimental_spec_shaking_v2 feature is enabled. - let spec_shaking_impl = if cfg!(feature = "experimental_spec_shaking_v2") { - spec_xdr.as_ref().map(|spec_xdr| { - shaking::generate_marker_impl( - path, - quote!(#ident), - spec_xdr, - field_types.iter().cloned(), - None, - None, - None, - ) + #spec_shaking_gen }) } else { - None + spec_shaking_gen }; // Output. let mut output = quote! { #spec_gen - #spec_shaking_impl - impl #path::TryFromVal<#path::Env, #path::Val> for #ident { type Error = #path::ConversionError; #[inline(always)] diff --git a/soroban-sdk-macros/src/derive_trait.rs b/soroban-sdk-macros/src/derive_trait.rs index 8eef6e5c8..6bb819fb4 100644 --- a/soroban-sdk-macros/src/derive_trait.rs +++ b/soroban-sdk-macros/src/derive_trait.rs @@ -52,7 +52,7 @@ fn derive_or_err(metadata: TokenStream2, input: TokenStream2) -> Result Path { #[derive(Debug, FromMeta)] struct ContractSpecArgs { + #[darling(default = "default_crate_path")] + crate_path: Path, name: Type, export: Option, } @@ -103,7 +105,7 @@ pub fn contractspecfn(metadata: TokenStream, input: TokenStream) -> TokenStream let methods: Vec<_> = item.fns(); let export = args.export.unwrap_or(true); - let derived = derive_fns_spec(&args.name, &methods, export); + let derived = derive_fns_spec(&args.crate_path, &args.name, &methods, export); match derived { Ok(derived_ok) => quote! { @@ -263,7 +265,7 @@ pub fn contractimpl(metadata: TokenStream, input: TokenStream) -> TokenStream { let mut output = quote! { #[#crate_path::contractargs(name = #args_ident, impl_only = true)] #[#crate_path::contractclient(crate_path = #crate_path_str, name = #client_ident, impl_only = true)] - #[#crate_path::contractspecfn(name = #ty_str)] + #[#crate_path::contractspecfn(crate_path = #crate_path_str, name = #ty_str)] #imp #derived_ok }; diff --git a/soroban-sdk-macros/src/shaking.rs b/soroban-sdk-macros/src/shaking.rs index e09885350..97af5cd33 100644 --- a/soroban-sdk-macros/src/shaking.rs +++ b/soroban-sdk-macros/src/shaking.rs @@ -1,79 +1,477 @@ -//! Generates the `SpecShakingMarker` impl for contract types. +//! Generates the emit-side artifacts used by spec shaking v2. //! -//! The marker is a byte array in the data section with a distinctive pattern: -//! - 6 bytes: "SpEcV1" prefix -//! - 8 bytes: first 64 bits of SHA256 hash of the spec entry XDR +//! SDK macros use these helpers to emit root markers for events and thrown +//! errors, exact `SpecTypeId` implementations for UDTs, and removable graph +//! records in the private `contractspecv0.rssdk.graphv0` sidecar section. //! -//! Markers are embedded in `spec_shaking_marker()` functions with a volatile read. -//! When the type is used, the function is called and the marker is included. -//! When the type is unused, the function is DCE'd along with its marker. -//! -//! Post-processing tools (e.g. stellar-cli) can: -//! 1. Scan the WASM data section for "SpEcV1" patterns -//! 2. Extract the hash from each marker -//! 3. Match against specs in contractspecv0 section (by hashing each spec) -//! 4. Strip unused specs from contractspecv0 +//! See `soroban-spec-markers` for the marker and graph wire formats, and +//! `soroban-spec` for the post-build reachability filter and Wasm rewriting. -use proc_macro2::TokenStream as TokenStream2; +use proc_macro2::{Span, TokenStream as TokenStream2}; +use quote::format_ident; use quote::quote; -use syn::{Path, Type}; +use stellar_xdr::curr::ScSpecTypeDef; +use syn::{ext::IdentExt as _, GenericArgument, Ident, Path, PathArguments, Type, TypeReference}; -/// Generates the `SpecShakingMarker` impl for a type. -/// -/// # Arguments -/// -/// * `path` - The crate path (e.g., `soroban_sdk`) -/// * `ident` - The type identifier -/// * `spec_xdr` - The XDR bytes of the spec entry -/// * `field_types` - Optional iterator of field types to include markers for nested types -/// * `gen_impl` - Optional generics impl tokens (e.g., ``) -/// * `gen_types` - Optional generics type tokens (e.g., ``) -/// * `gen_where` - Optional generics where clause +use crate::map_type::map_type; + +/// Generates a marker block for a spec entry root. /// /// # Returns /// -/// A `TokenStream2` containing the `impl SpecShakingMarker for Type { ... }` block. -pub fn generate_marker_impl<'a, I>( - path: &Path, - ident: TokenStream2, - spec_xdr: &[u8], - field_types: I, - gen_impl: Option, - gen_types: Option, - gen_where: Option, -) -> TokenStream2 -where - I: Iterator, -{ - let marker = soroban_spec::shaking::generate_marker_for_xdr(spec_xdr); +/// A `TokenStream2` containing a marker static and volatile read. +pub fn generate_marker_block(spec_xdr: &[u8]) -> TokenStream2 { + let marker = soroban_spec_markers::generate_marker_for_xdr(spec_xdr); let marker_lit = proc_macro2::Literal::byte_string(&marker); let marker_len = marker.len(); - let field_type_markers: Vec<_> = field_types.collect(); - let gen_impl = gen_impl.unwrap_or_default(); - let gen_types = gen_types.unwrap_or_default(); - let gen_where = gen_where.unwrap_or_default(); + quote! { + #[cfg(target_family = "wasm")] + { + static MARKER: [u8; #marker_len] = *#marker_lit; + let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; + } + } +} + +/// Generates a call-site hook for an error spec root. +/// +/// The hook emits the same `SpEcV1` marker block used by events. It roots only +/// the error entry; referenced types are retained through the spec graph. +pub fn generate_error_marker_impl(path: &Path, ident: &Ident, spec_xdr: &[u8]) -> TokenStream2 { + let marker_block = generate_marker_block(spec_xdr); quote! { - impl #gen_impl #path::SpecShakingMarker for #ident #gen_types #gen_where { + impl #path::spec_shaking::SpecShakingMarker for #ident { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() { - #(<#field_type_markers as #path::SpecShakingMarker>::spec_shaking_marker();)* - #[cfg(target_family = "wasm")] - { - // Marker in data section. Post-build tools can scan for "SpEcV1" - // patterns and match against specs in contractspecv0. - static MARKER: [u8; #marker_len] = *#marker_lit; - // Volatile read prevents DCE of this function and keeps MARKER - // in the data section. We only read a single `u8` from the start - // of the array because merely taking a volatile reference to the - // symbol is sufficient; reading all bytes via - // `read_volatile::<[u8; #marker_len]>()` would be redundant and - // could increase code size without any functional benefit. - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; + #marker_block + } + } + } +} + +/// Generates an implementation of the hidden exact spec identity trait for a UDT. +pub fn generate_type_id_impl(path: &Path, ident: &Ident, spec_xdr: &[u8]) -> TokenStream2 { + let spec_id = soroban_spec_markers::generate_spec_id_for_xdr(spec_xdr); + let spec_id_lit = proc_macro2::Literal::byte_string(&spec_id); + + quote! { + impl #path::spec_shaking::SpecTypeId for #ident { + const SPEC_TYPE_ID: [u8; 32] = *#spec_id_lit; + } + } +} + +/// Generates spec-shaking metadata for a UDT. +pub fn generate_udt_shaking( + path: &Path, + ident: &Ident, + spec_xdr: &[u8], + refs: Vec, + spec_exported: bool, + generate_marker: bool, +) -> Option { + let type_id_impl = generate_type_id_impl(path, ident, spec_xdr); + if !spec_exported { + return Some(type_id_impl); + } + + let marker_impl = if generate_marker { + Some(generate_error_marker_impl(path, ident, spec_xdr)) + } else { + None + }; + + let graph_ident = format_ident!( + "__SPEC_GRAPH_TYPE_{}", + ident.unraw().to_string().to_uppercase() + ); + let graph_record = generate_graph_record( + path, + &graph_ident, + ident.span(), + soroban_spec_markers::SpecGraphEntryKind::Udt, + spec_xdr, + refs, + ); + + Some(quote! { + #type_id_impl + #marker_impl + #graph_record + }) +} + +/// Generates one removable graph record in `contractspecv0.rssdk.graphv0` at compile time. +/// +/// Emits a `pub static [u8; LEN]` initialized by `encode_graph_record`, wired into +/// `contractspecv0.rssdk.graphv0` via `link_section`. +pub fn generate_graph_record( + path: &Path, + ident: &Ident, + error_span: Span, + kind: soroban_spec_markers::SpecGraphEntryKind, + spec_xdr: &[u8], + refs: Vec, +) -> TokenStream2 { + let spec_id = soroban_spec_markers::generate_spec_id_for_xdr(spec_xdr); + let spec_id_lit = proc_macro2::Literal::byte_string(&spec_id); + let section_lit = proc_macro2::Literal::string(soroban_spec_markers::GRAPH_SECTION); + let kind_lit = proc_macro2::Literal::u16_unsuffixed(kind.to_u16()); + let ref_count = refs.len(); + if ref_count > u16::MAX as usize { + return syn::Error::new( + error_span, + "spec graph record cannot encode more than u16::MAX refs", + ) + .to_compile_error(); + } + let record_len = soroban_spec_markers::graph_record_len(ref_count); + + quote! { + #[cfg_attr(target_family = "wasm", link_section = #section_lit)] + #[allow(non_upper_case_globals)] + pub static #ident: [u8; #record_len] = + #path::spec_shaking::encode_graph_record::<#record_len, #ref_count>( + #kind_lit, + *#spec_id_lit, + [#(#refs),*], + ); + } +} + +/// Generates exact UDT spec identity expressions referenced by a Rust type. +pub fn type_id_refs(path: &Path, ty: &Type) -> Vec { + // Keep this traversal in sync with `soroban-spec/src/shaking.rs::add_type_def_udt_names`. + // The post-build validator mirrors these macro-emitted graph refs for each spec container. + match ty { + Type::Reference(TypeReference { elem, .. }) => type_id_refs(path, elem), + Type::Tuple(tuple) => tuple + .elems + .iter() + .flat_map(|ty| type_id_refs(path, ty)) + .collect(), + Type::Path(type_path) => { + // Excludes malformed or empty paths. Without a terminal path segment, + // there is no type constructor to classify or generic arguments to walk. + let Some(segment) = type_path.path.segments.last() else { + return Vec::new(); + }; + let ident = segment.ident.unraw().to_string(); + match ident.as_str() { + "Option" | "Vec" => generic_type_args(segment) + .into_iter() + .take(1) + .flat_map(|ty| type_id_refs(path, ty)) + .collect(), + "Map" | "Result" => generic_type_args(segment) + .into_iter() + .take(2) + .flat_map(|ty| type_id_refs(path, ty)) + .collect(), + _ if should_emit_type_id_ref(ty) => { + vec![quote! { <#ty as #path::spec_shaking::SpecTypeId>::SPEC_TYPE_ID }] } + _ => Vec::new(), } } + // Excludes non-path type syntax such as arrays, slices, bare function + // pointers, `impl Trait`, and inferred types. Contract specs either do + // not accept these forms here or reject them through `map_type` when the + // surrounding spec entry is built. + _ => Vec::new(), + } +} + +fn should_emit_type_id_ref(ty: &Type) -> bool { + // `map_type` is the canonical Rust-type-to-spec-type mapper. Only UDT-shaped + // spec types need an exact graph ref; all SDK/builtin mappings return a + // concrete non-UDT spec type. UDT refs require a SpecTypeId impl even when + // the referenced type is intentionally hidden from `contractspecv0`. + matches!(map_type(ty, true, true), Ok(ScSpecTypeDef::Udt(_))) +} + +fn generic_type_args(segment: &syn::PathSegment) -> Vec<&Type> { + // Excludes non-generic path segments. Plain UDTs and concrete builtin types + // have no child type arguments for the graph walker to recurse into. + let PathArguments::AngleBracketed(args) = &segment.arguments else { + return Vec::new(); + }; + args.args + .iter() + .filter_map(|arg| { + if let GenericArgument::Type(ty) = arg { + Some(ty) + } else { + None + } + }) + .collect() +} + +#[cfg(test)] +mod test { + use super::*; + use soroban_spec::shaking::{filter, SpecGraph, SpecGraphEntryKind}; + use std::collections::HashSet; + use syn::{parse_quote, Type}; + + use stellar_xdr::curr::{ + ScSpecEntry, ScSpecFunctionInputV0, ScSpecFunctionV0, ScSpecTypeMap, ScSpecTypeOption, + ScSpecTypeResult, ScSpecTypeTuple, ScSpecTypeUdt, ScSpecTypeVec, ScSpecUdtStructV0, + StringM, VecM, + }; + + fn refs_for(ty: Type) -> Vec { + let path: Path = parse_quote!(soroban_sdk); + type_id_refs(&path, &ty) + .into_iter() + .map(|tokens| tokens.to_string()) + .collect() + } + + #[test] + fn generate_graph_record_rejects_too_many_refs_with_compile_error() { + let path: Path = parse_quote!(soroban_sdk); + let ident = format_ident!("__SPEC_GRAPH_TOO_MANY_REFS"); + let refs = vec![TokenStream2::new(); u16::MAX as usize + 1]; + + let tokens = generate_graph_record( + &path, + &ident, + ident.span(), + soroban_spec_markers::SpecGraphEntryKind::Udt, + b"spec", + refs, + ) + .to_string(); + + assert!(tokens.contains("compile_error")); + assert!(tokens.contains("spec graph record cannot encode more than u16::MAX refs")); + } + + #[test] + fn type_id_refs_skip_types_mapped_by_map_type_to_builtins() { + for ty in [ + parse_quote!(Val), + parse_quote!(u64), + parse_quote!(i64), + parse_quote!(u32), + parse_quote!(i32), + parse_quote!(u128), + parse_quote!(i128), + parse_quote!(U256), + parse_quote!(I256), + parse_quote!(bool), + parse_quote!(Symbol), + parse_quote!(String), + parse_quote!(Error), + parse_quote!(Bytes), + parse_quote!(Address), + parse_quote!(MuxedAddress), + parse_quote!(Timepoint), + parse_quote!(Duration), + parse_quote!(BytesN<32>), + parse_quote!(Hash<32>), + parse_quote!(Fp), + parse_quote!(Fp2), + parse_quote!(G1Affine), + parse_quote!(G2Affine), + parse_quote!(Fr), + parse_quote!(Bls12381Fp), + parse_quote!(Bls12381Fp2), + parse_quote!(Bls12381G1Affine), + parse_quote!(Bls12381G2Affine), + parse_quote!(Bls12381Fr), + parse_quote!(Bn254Fp), + parse_quote!(Bn254G1Affine), + parse_quote!(Bn254G2Affine), + parse_quote!(Bn254Fr), + parse_quote!(BnScalar), + parse_quote!(Vec), + ] { + assert!(refs_for(ty).is_empty()); + } + } + + #[test] + fn type_id_refs_emit_context_like_udts() { + let refs = refs_for(parse_quote!(Vec)); + + assert_eq!(refs.len(), 1); + assert!(refs[0].contains("Context")); + assert!(refs[0].contains("SpecTypeId")); + } + + #[test] + fn type_id_refs_emit_udts_recursively() { + let refs = refs_for(parse_quote!(Map>)); + + assert_eq!(refs.len(), 1); + assert!(refs[0].contains("MyType")); + assert!(refs[0].contains("SpecTypeId")); + } + + #[test] + fn type_id_refs_match_strict_spec_graph_validation() { + let path: Path = parse_quote!(soroban_sdk); + let cases = vec![ + ("udt", parse_quote!(Foo), udt("Foo"), vec!["Foo"]), + ("reference", parse_quote!(&Foo), udt("Foo"), vec!["Foo"]), + ( + "option", + parse_quote!(Option), + option(udt("Foo")), + vec!["Foo"], + ), + ( + "result", + parse_quote!(Result), + result(udt("Foo"), udt("Bar")), + vec!["Foo", "Bar"], + ), + ( + "vec", + parse_quote!(Vec), + vec_type(udt("Foo")), + vec!["Foo"], + ), + ( + "map", + parse_quote!(Map), + map(udt("Foo"), udt("Bar")), + vec!["Foo", "Bar"], + ), + ( + "tuple", + parse_quote!((Foo, Bar)), + tuple(vec![udt("Foo"), udt("Bar")]), + vec!["Foo", "Bar"], + ), + ( + "nested", + parse_quote!(Result, Map>), + result(vec_type(udt("Foo")), map(ScSpecTypeDef::U32, udt("Bar"))), + vec!["Foo", "Bar"], + ), + ]; + + for (case, rust_ty, spec_ty, expected_names) in cases { + let macro_ref_names = type_id_refs(&path, &rust_ty) + .into_iter() + .map(type_id_ref_name) + .collect::>(); + assert_eq!(macro_ref_names, expected_names, "{case}"); + + let function = make_function("foo", spec_ty); + let foo = make_struct("Foo"); + let bar = make_struct("Bar"); + let graph_refs = macro_ref_names + .iter() + .map(|name| match name.as_str() { + "Foo" => &foo, + "Bar" => &bar, + _ => panic!("unexpected macro ref {name}"), + }) + .collect::>(); + let graph = SpecGraph::from_records([ + (&function, SpecGraphEntryKind::Function, graph_refs), + (&foo, SpecGraphEntryKind::Udt, vec![]), + (&bar, SpecGraphEntryKind::Udt, vec![]), + ]); + + let filtered = filter( + vec![function.clone(), foo.clone(), bar.clone()], + &HashSet::new(), + &graph, + ) + .unwrap() + .collect::>(); + let mut expected_entries = vec![function.clone()]; + for name in expected_names { + match name { + "Foo" if !expected_entries.contains(&foo) => expected_entries.push(foo.clone()), + "Bar" if !expected_entries.contains(&bar) => expected_entries.push(bar.clone()), + _ => {} + } + } + assert_eq!(filtered, expected_entries, "{case}"); + } + } + + fn type_id_ref_name(tokens: TokenStream2) -> String { + let tokens = tokens.to_string(); + tokens + .split(" as ") + .next() + .expect("type id ref should contain a type") + .trim() + .trim_start_matches('<') + .trim() + .replace(' ', "") + } + + fn udt(name: &str) -> ScSpecTypeDef { + ScSpecTypeDef::Udt(ScSpecTypeUdt { + name: name.try_into().unwrap(), + }) + } + + fn option(value_type: ScSpecTypeDef) -> ScSpecTypeDef { + ScSpecTypeDef::Option(Box::new(ScSpecTypeOption { + value_type: Box::new(value_type), + })) + } + + fn result(ok_type: ScSpecTypeDef, error_type: ScSpecTypeDef) -> ScSpecTypeDef { + ScSpecTypeDef::Result(Box::new(ScSpecTypeResult { + ok_type: Box::new(ok_type), + error_type: Box::new(error_type), + })) + } + + fn vec_type(element_type: ScSpecTypeDef) -> ScSpecTypeDef { + ScSpecTypeDef::Vec(Box::new(ScSpecTypeVec { + element_type: Box::new(element_type), + })) + } + + fn map(key_type: ScSpecTypeDef, value_type: ScSpecTypeDef) -> ScSpecTypeDef { + ScSpecTypeDef::Map(Box::new(ScSpecTypeMap { + key_type: Box::new(key_type), + value_type: Box::new(value_type), + })) + } + + fn tuple(value_types: Vec) -> ScSpecTypeDef { + ScSpecTypeDef::Tuple(Box::new(ScSpecTypeTuple { + value_types: value_types.try_into().unwrap(), + })) + } + + fn make_function(name: &str, input_type: ScSpecTypeDef) -> ScSpecEntry { + ScSpecEntry::FunctionV0(ScSpecFunctionV0 { + doc: StringM::default(), + name: name.try_into().unwrap(), + inputs: vec![ScSpecFunctionInputV0 { + doc: StringM::default(), + name: "arg0".try_into().unwrap(), + type_: input_type, + }] + .try_into() + .unwrap(), + outputs: VecM::default(), + }) + } + + fn make_struct(name: &str) -> ScSpecEntry { + ScSpecEntry::UdtStructV0(ScSpecUdtStructV0 { + doc: StringM::default(), + lib: StringM::default(), + name: name.try_into().unwrap(), + fields: VecM::default(), + }) } } diff --git a/soroban-sdk/Cargo.toml b/soroban-sdk/Cargo.toml index dec42035c..b809fcc7a 100644 --- a/soroban-sdk/Cargo.toml +++ b/soroban-sdk/Cargo.toml @@ -21,6 +21,7 @@ crate-git-revision = "0.0.6" [dependencies] soroban-sdk-macros = { workspace = true } +soroban-spec-markers = { workspace = true } stellar-strkey = { workspace = true } bytes-lit = "0.0.5" visibility = "0.1.1" diff --git a/soroban-sdk/src/_features.rs b/soroban-sdk/src/_features.rs index f009d518c..ea544272e 100644 --- a/soroban-sdk/src/_features.rs +++ b/soroban-sdk/src/_features.rs @@ -43,7 +43,7 @@ //! ### Spec Shaking v2 (this feature) //! //! - Everything exported (types, events, functions, imports) -//! - Unused entries shaken out using dead code / spec elimination +//! - Unused entries shaken out using extra-root markers and exact spec graph pruning //! //! A contract's spec (the `contractspecv0` custom section in the Wasm binary) //! contains entries for every function, type, and event defined by the contract. @@ -53,28 +53,35 @@ //! //! ### How It Works //! -//! When this feature is enabled, the SDK embeds 14-byte **markers** in the Wasm -//! data section for each exported type and event. A marker consists of a -//! `SpEcV1` magic prefix followed by 8 bytes of a SHA-256 hash of the spec -//! entry's XDR. -//! -//! Markers are placed inside functions that are only called when the type is -//! actually used: -//! - **Function parameters**: marker is triggered when deserializing the input. -//! - **Function return values**: marker is triggered when serializing the output. -//! - **Error returns**: marker is triggered via `Result` serialization. -//! - **Event publishes**: marker is triggered inside the `publish()` call. -//! - **Nested types**: a type's marker function calls the marker functions of -//! its field types, so nested types are transitively marked. -//! - **Container types**: `Vec`, `Map`, `Option`, and `Result` -//! propagate markers to their inner types. -//! -//! The Rust compiler's dead code elimination (DCE) removes markers for types -//! that are never used, while keeping markers for types that are. +//! Function entries in `contractspecv0` are always roots. The macros also emit +//! a removable sidecar graph in the private `contractspecv0.rssdk.graphv0` +//! custom section. Each graph record is keyed by the SHA-256 hash of a full spec +//! entry's XDR and lists the exact child spec-entry IDs referenced by that +//! entry. Generated UDTs implement the hidden `SpecTypeId` helper so function, +//! event, and UDT graph records can refer to exact type specs instead of only +//! their `ScSpecTypeDef::Udt` names. +//! `export = false` types still get this hidden exact ID when v2 is enabled, +//! but they do not emit public spec entries or UDT graph records of their own. +//! A reachable graph reference to such a type is invalid for post-build +//! shaking because there is no matching spec entry in `contractspecv0` to keep. +//! SDK-owned types used at canonical contract boundaries are configured to emit +//! normally under v2; see [`contracttype`] below. +//! +//! Events and errors thrown through `panic_with_error!` or +//! `assert_with_error!` need one extra reachability signal because those use +//! sites are not visible from function specs alone. For each exported event or +//! contract error, the SDK embeds a 14-byte marker in reachable code that uses +//! it. A marker consists of a `SpEcV1` magic prefix followed by 8 bytes of a +//! SHA-256 hash of the spec entry's XDR. //! //! Post-build tools (e.g. `stellar-cli`) scan the Wasm data section for -//! `SpEcV1` markers, match them against spec entries, and strip any entries -//! without a corresponding marker. +//! markers, read the sidecar graph, keep all functions and marked extra roots, +//! traverse UDT references by exact spec ID, rewrite `contractspecv0`, and +//! remove `contractspecv0.rssdk.graphv0`. When a reachable function, event, or +//! UDT entry references UDTs, its graph record must be present and complete. +//! Missing graph records, missing references, references to unknown spec IDs, +//! and references to non-UDT spec entries are rejected instead of falling back +//! to name-based matching. //! //! ### Changed Behaviour //! @@ -84,16 +91,32 @@ //! //! Without this feature, spec entries are only generated for `pub` types (or //! when `export = true` is explicitly set). With this feature, spec entries -//! and markers are generated for all types regardless of visibility, unless -//! `export = false` is explicitly set. This ensures all types can participate -//! in spec shaking. +//! are generated for all types regardless of visibility, unless `export = false` +//! is explicitly set. This ensures all types can participate in spec graph +//! pruning. Types with `export = false` do not emit public spec entries, but +//! they still get the hidden `SpecTypeId` helper so graph records can identify +//! them exactly. A reachable graph edge to one of these hidden-only types is +//! rejected during strict post-build validation because the referenced spec +//! entry is absent. +//! +//! SDK-owned types that appear at canonical contract boundaries, such as +//! `auth::Context` in `__check_auth` no longer use `export = false` under v2. +//! As a result, they behave like ordinary public UDTs in v2, and without v2 they +//! remain hidden. This keeps specs complete and without ambiguities between +//! SDK-owned types and user-defined types with the same name. //! //! #### [`contracterror`] //! //! Same as [`contracttype`]: without this feature, spec entries are only -//! generated for `pub` types. With this feature, spec entries and markers are -//! generated for all error enums regardless of visibility, unless -//! `export = false` is explicitly set. +//! generated for `pub` types. With this feature, spec entries are generated for +//! all error enums regardless of visibility, unless +//! `export = false` is explicitly set. Error enums with `export = false` still +//! get the hidden `SpecTypeId` helper for exact graph references, but cannot be +//! the target of a reachable graph edge in a valid shaken v2 spec. +//! They also do not implement the hidden `SpecShakingMarker` hook required by +//! `panic_with_error!` and `assert_with_error!` when this feature is enabled; +//! remove `export = false` for typed error enums that may be thrown through those +//! macros, or throw a raw `Error` value instead. //! //! #### [`contractevent`] //! @@ -110,21 +133,25 @@ //! the type definitions. //! //! With this feature, [`contractimport!`] generates imported types with -//! `export = true`. Imported types produce spec entries and markers in the -//! importing contract, just like locally defined types. This changes the +//! `export = true`. Imported types produce spec entries in the importing +//! contract, just like locally defined types. This changes the //! contract's spec to be self-contained — it includes the type definitions for //! all types used at the contract boundary, regardless of where those types //! were originally defined. Specifically: //! //! - Imported types that are used in the contract's function signatures or -//! events will have their markers survive DCE and their spec entries will be -//! kept after shaking. +//! published events will be reachable from the spec graph and their spec +//! entries will be kept after shaking. //! - Imported types that are **not** used at any contract boundary will have -//! their markers eliminated by DCE and their spec entries will be stripped. +//! their spec entries stripped. //! //! This ensures that a contract importing a large interface only includes spec //! entries for the types it actually uses, while still producing a //! self-contained spec. +//! Raw Wasm built without post-build shaking can still contain pre-shake +//! candidates, including SDK-owned boundary types or duplicate UDT names that +//! would otherwise be stripped. Prefer importing Wasms produced by +//! `stellar contract build` or another pipeline that runs `shake_contract_spec`. //! //! ### Build Requirements //! diff --git a/soroban-sdk/src/address.rs b/soroban-sdk/src/address.rs index 9522a0bb4..592951b6b 100644 --- a/soroban-sdk/src/address.rs +++ b/soroban-sdk/src/address.rs @@ -214,7 +214,14 @@ impl TryFrom
for AccountId { } } -#[contracttype(crate_path = "crate", export = false)] +#[cfg_attr( + feature = "experimental_spec_shaking_v2", + contracttype(crate_path = "crate") +)] +#[cfg_attr( + not(feature = "experimental_spec_shaking_v2"), + contracttype(crate_path = "crate", export = false) +)] #[derive(Clone, Debug, PartialEq, Eq)] pub enum Executable { Wasm(BytesN<32>), diff --git a/soroban-sdk/src/auth.rs b/soroban-sdk/src/auth.rs index 035d51430..752232fa8 100644 --- a/soroban-sdk/src/auth.rs +++ b/soroban-sdk/src/auth.rs @@ -11,7 +11,14 @@ use crate::{ /// receive a list of `Context` values corresponding to all the calls that /// need to be authorized. #[derive(Clone)] -#[contracttype(crate_path = "crate", export = false)] +#[cfg_attr( + feature = "experimental_spec_shaking_v2", + contracttype(crate_path = "crate") +)] +#[cfg_attr( + not(feature = "experimental_spec_shaking_v2"), + contracttype(crate_path = "crate", export = false) +)] pub enum Context { /// Contract invocation. Contract(ContractContext), @@ -26,7 +33,14 @@ pub enum Context { /// This struct corresponds to a `require_auth_for_args` call for an address /// from `contract` function with `fn_name` name and `args` arguments. #[derive(Clone)] -#[contracttype(crate_path = "crate", export = false)] +#[cfg_attr( + feature = "experimental_spec_shaking_v2", + contracttype(crate_path = "crate") +)] +#[cfg_attr( + not(feature = "experimental_spec_shaking_v2"), + contracttype(crate_path = "crate", export = false) +)] pub struct ContractContext { pub contract: Address, pub fn_name: Symbol, @@ -36,7 +50,14 @@ pub struct ContractContext { /// Authorization context for `create_contract` host function that creates a /// new contract on behalf of authorizer address. #[derive(Clone)] -#[contracttype(crate_path = "crate", export = false)] +#[cfg_attr( + feature = "experimental_spec_shaking_v2", + contracttype(crate_path = "crate") +)] +#[cfg_attr( + not(feature = "experimental_spec_shaking_v2"), + contracttype(crate_path = "crate", export = false) +)] pub struct CreateContractHostFnContext { pub executable: ContractExecutable, pub salt: BytesN<32>, @@ -47,7 +68,14 @@ pub struct CreateContractHostFnContext { /// This is the same as `CreateContractHostFnContext`, but also has /// contract constructor arguments. #[derive(Clone)] -#[contracttype(crate_path = "crate", export = false)] +#[cfg_attr( + feature = "experimental_spec_shaking_v2", + contracttype(crate_path = "crate") +)] +#[cfg_attr( + not(feature = "experimental_spec_shaking_v2"), + contracttype(crate_path = "crate", export = false) +)] pub struct CreateContractWithConstructorHostFnContext { pub executable: ContractExecutable, pub salt: BytesN<32>, @@ -57,7 +85,14 @@ pub struct CreateContractWithConstructorHostFnContext { /// Contract executable used for creating a new contract and used in /// `CreateContractHostFnContext`. #[derive(Clone)] -#[contracttype(crate_path = "crate", export = false)] +#[cfg_attr( + feature = "experimental_spec_shaking_v2", + contracttype(crate_path = "crate") +)] +#[cfg_attr( + not(feature = "experimental_spec_shaking_v2"), + contracttype(crate_path = "crate", export = false) +)] pub enum ContractExecutable { Wasm(BytesN<32>), } @@ -70,7 +105,14 @@ pub enum ContractExecutable { /// This tree corresponds `require_auth[_for_args]` calls on behalf of the /// current contract. #[derive(Clone)] -#[contracttype(crate_path = "crate", export = false)] +#[cfg_attr( + feature = "experimental_spec_shaking_v2", + contracttype(crate_path = "crate") +)] +#[cfg_attr( + not(feature = "experimental_spec_shaking_v2"), + contracttype(crate_path = "crate", export = false) +)] pub enum InvokerContractAuthEntry { /// Invoke a contract. Contract(SubContractInvocation), @@ -82,7 +124,14 @@ pub enum InvokerContractAuthEntry { /// Value of contract node in InvokerContractAuthEntry tree. #[derive(Clone)] -#[contracttype(crate_path = "crate", export = false)] +#[cfg_attr( + feature = "experimental_spec_shaking_v2", + contracttype(crate_path = "crate") +)] +#[cfg_attr( + not(feature = "experimental_spec_shaking_v2"), + contracttype(crate_path = "crate", export = false) +)] pub struct SubContractInvocation { pub context: ContractContext, pub sub_invocations: Vec, diff --git a/soroban-sdk/src/env.rs b/soroban-sdk/src/env.rs index 216a42ed4..aa9551808 100644 --- a/soroban-sdk/src/env.rs +++ b/soroban-sdk/src/env.rs @@ -294,7 +294,7 @@ impl Env { #[inline(always)] pub fn panic_with_error(&self, error: I) -> ! where - I: Into + crate::SpecShakingMarker, + I: Into + crate::spec_shaking::SpecShakingMarker, { I::spec_shaking_marker(); self.panic_with_error_inner(error.into()) diff --git a/soroban-sdk/src/into_val_for_contract_fn.rs b/soroban-sdk/src/into_val_for_contract_fn.rs index a875902f9..5fb5ddd6c 100644 --- a/soroban-sdk/src/into_val_for_contract_fn.rs +++ b/soroban-sdk/src/into_val_for_contract_fn.rs @@ -5,10 +5,8 @@ //! The trait has a blanket implementation for all types that already implement //! IntoVal. //! -//! When the `experimental_spec_shaking_v2` feature is enabled, this trait also -//! calls `SpecShakingMarker::spec_shaking_marker()` to ensure that type specs -//! are included in the WASM when types are used at external boundaries -//! (function return values). +//! Spec shaking roots function return types from the `contractspecv0` function +//! entries, so this conversion path does not need to emit marker code. use crate::{Env, IntoVal, Val}; @@ -20,20 +18,6 @@ pub trait IntoValForContractFn { fn into_val_for_contract_fn(self, env: &Env) -> Val; } -#[cfg(feature = "experimental_spec_shaking_v2")] -#[doc(hidden)] -#[allow(deprecated)] -impl IntoValForContractFn for T -where - T: IntoVal + crate::SpecShakingMarker, -{ - fn into_val_for_contract_fn(self, env: &Env) -> Val { - T::spec_shaking_marker(); - self.into_val(env) - } -} - -#[cfg(not(feature = "experimental_spec_shaking_v2"))] #[doc(hidden)] #[allow(deprecated)] impl IntoValForContractFn for T diff --git a/soroban-sdk/src/lib.rs b/soroban-sdk/src/lib.rs index c4fa3530b..5f0002b0a 100644 --- a/soroban-sdk/src/lib.rs +++ b/soroban-sdk/src/lib.rs @@ -60,6 +60,10 @@ pub mod _features; pub mod _migrating; +#[cfg(feature = "experimental_spec_shaking_v2")] +#[doc(hidden)] +pub mod spec_shaking; + #[cfg(all(target_family = "wasm", feature = "testutils"))] compile_error!("'testutils' feature is not supported on 'wasm' target"); @@ -205,9 +209,8 @@ pub use soroban_sdk_macros::symbol_short; /// /// When the [`experimental_spec_shaking_v2`][_features#experimental_spec_shaking_v2] /// feature is enabled, spec entries are generated for all types regardless of -/// visibility, and markers are embedded that allow post-build tools to strip -/// entries for types that are not used at a contract boundary. See -/// [`_features`] for details. +/// visibility, and post-build tools strip entries for types that are not +/// reachable from contract boundary specs. See [`_features`] for details. /// /// ### Examples /// @@ -318,7 +321,7 @@ pub use soroban_sdk_macros::contracterror; /// /// When the [`experimental_spec_shaking_v2`][_features#experimental_spec_shaking_v2] /// feature is enabled, imported types are generated with `export = true` so -/// they produce spec entries and markers in the importing contract. Post-build +/// they produce spec entries in the importing contract. Post-build /// tools strip entries for imported types that are not used at the importing /// contract's boundary. Without this feature, imported types use /// `export = false` and do not produce spec entries. See [`_features`] for @@ -619,9 +622,8 @@ pub use soroban_sdk_macros::contractmeta; /// /// When the [`experimental_spec_shaking_v2`][_features#experimental_spec_shaking_v2] /// feature is enabled, spec entries are generated for all types regardless of -/// visibility, and markers are embedded that allow post-build tools to strip -/// entries for types that are not used at a contract boundary. See -/// [`_features`] for details. +/// visibility, and post-build tools strip entries for types that are not +/// reachable from contract boundary specs. See [`_features`] for details. /// /// ### Examples /// @@ -773,8 +775,8 @@ pub use soroban_sdk_macros::contracttype; /// ### `experimental_spec_shaking_v2` /// /// When the [`experimental_spec_shaking_v2`][_features#experimental_spec_shaking_v2] -/// feature is enabled, markers are embedded that allow post-build tools to strip -/// spec entries for events that are never published at a contract boundary. See +/// feature is enabled, event-root markers allow post-build tools to strip spec +/// entries for events that are never published at a contract boundary. See /// [`_features`] for details. /// /// ### Examples @@ -1195,12 +1197,6 @@ mod into_val_for_contract_fn; #[allow(deprecated)] pub use into_val_for_contract_fn::IntoValForContractFn; -#[cfg(feature = "experimental_spec_shaking_v2")] -mod spec_shaking; -#[cfg(feature = "experimental_spec_shaking_v2")] -#[doc(hidden)] -pub use spec_shaking::SpecShakingMarker; - #[doc(hidden)] #[deprecated(note = "use storage")] pub mod data { diff --git a/soroban-sdk/src/spec_shaking.rs b/soroban-sdk/src/spec_shaking.rs index e8a21db34..dd345a9fa 100644 --- a/soroban-sdk/src/spec_shaking.rs +++ b/soroban-sdk/src/spec_shaking.rs @@ -1,409 +1,63 @@ -//! SpecShakingMarker is an internal trait used to ensure that contract type specs -//! are included in the WASM binary when types are used at contract boundaries. +//! Hidden support types for experimental spec shaking. //! -//! The trait is called at three external boundary points: -//! 1. Contract function input parameters -//! 2. Contract function return values -//! 3. Event publishing +//! Spec shaking v2 lets post-build tools remove unused entries from a contract's +//! public `contractspecv0` custom section. Rust code cannot directly tell the +//! linker which spec bytes are semantically reachable, so the SDK emits two +//! pieces of build metadata: //! -//! Types that are only used internally (storage, cross-contract calls) do not -//! need their specs included, so the trait is NOT called from general TryFromVal -//! conversions. +//! - `SpEcV1` markers for extra roots that cannot be inferred from function +//! specs, currently published events and errors thrown through +//! `panic_with_error!` or `assert_with_error!`. +//! - Removable graph records in the `contractspecv0.rssdk.graphv0` sidecar that describe exact +//! spec-entry reachability by `SHA256(spec_entry_xdr)` ID. //! -//! The trait has a default no-op implementation. Types generated by contracttype, -//! contractevent, and contracterror macros implement this trait to include their -//! spec XDR in the WASM's contractspecv0 section. +//! Function specs are roots because every exported `FunctionV0` entry defines +//! callable contract API. The macros emit a matching function graph record keyed +//! by that exact function spec entry. The graph-aware post-build filter keeps +//! the function entry itself as a root, but it discovers the function's +//! parameter and return UDTs only through that graph record. If a reachable +//! function references UDTs and the graph cannot resolve those UDTs to exported +//! spec entries, the filter rejects the contract. +//! +//! Events, errors, and UDTs with public spec entries also emit graph records +//! when v2 is enabled. Types marked `export = false` still implement +//! [`SpecTypeId`] so generated graph records can be built, but they do not +//! export spec entries or graph records of their own. A reachable boundary edge +//! to one of these types is rejected because there is no exported spec entry to +//! retain. The sidecar is private build metadata and is removed after +//! `contractspecv0` is rewritten. -/// Trait for types that may include their spec in the WASM binary. -/// -/// This trait is used internally by the SDK to ensure contract type specs -/// are included when types are used at external boundaries (function params, -/// return values, events). +#[doc(hidden)] +/// Re-exported as function is referenced by generated code +pub use soroban_spec_markers::encode_graph_record; + +/// Call-site hook for error specs thrown through `panic_with_error!`. /// -/// Types with `#[contracttype]`, `#[contractevent]`, or `#[contracterror]` -/// will have implementations that include their spec. All other types have -/// a no-op implementation. +/// This roots only the error's own spec entry. Types referenced by that entry +/// are retained by walking the removable spec graph. #[doc(hidden)] pub trait SpecShakingMarker { - /// Include this type's spec in the WASM binary. - /// - /// For primitive types and built-in SDK types, this is a no-op. - /// For user-defined contract types, this ensures the spec XDR is - /// included in the contractspecv0 section. - #[inline(always)] - fn spec_shaking_marker() {} -} - -// Primitive type implementations (no-op) -impl SpecShakingMarker for () {} -impl SpecShakingMarker for bool {} -impl SpecShakingMarker for u32 {} -impl SpecShakingMarker for i32 {} -impl SpecShakingMarker for u64 {} -impl SpecShakingMarker for i64 {} -impl SpecShakingMarker for u128 {} -impl SpecShakingMarker for i128 {} - -// Reference implementations -impl SpecShakingMarker for &T { - #[inline(always)] - fn spec_shaking_marker() { - T::spec_shaking_marker(); - } + fn spec_shaking_marker(); } -impl SpecShakingMarker for &mut T { +impl SpecShakingMarker for crate::Error { #[inline(always)] - fn spec_shaking_marker() { - T::spec_shaking_marker(); - } -} - -// Option implementation - includes inner type's spec -impl SpecShakingMarker for Option { - #[inline(always)] - fn spec_shaking_marker() { - T::spec_shaking_marker(); - } -} - -// Result implementation - includes both types' specs -impl SpecShakingMarker for Result { - #[inline(always)] - fn spec_shaking_marker() { - T::spec_shaking_marker(); - E::spec_shaking_marker(); - } -} - -// Tuple implementations -impl SpecShakingMarker for (T0,) { - #[inline(always)] - fn spec_shaking_marker() { - T0::spec_shaking_marker(); - } -} - -impl SpecShakingMarker for (T0, T1) { - #[inline(always)] - fn spec_shaking_marker() { - T0::spec_shaking_marker(); - T1::spec_shaking_marker(); - } -} - -impl SpecShakingMarker - for (T0, T1, T2) -{ - #[inline(always)] - fn spec_shaking_marker() { - T0::spec_shaking_marker(); - T1::spec_shaking_marker(); - T2::spec_shaking_marker(); - } -} - -impl< - T0: SpecShakingMarker, - T1: SpecShakingMarker, - T2: SpecShakingMarker, - T3: SpecShakingMarker, - > SpecShakingMarker for (T0, T1, T2, T3) -{ - #[inline(always)] - fn spec_shaking_marker() { - T0::spec_shaking_marker(); - T1::spec_shaking_marker(); - T2::spec_shaking_marker(); - T3::spec_shaking_marker(); - } -} - -impl< - T0: SpecShakingMarker, - T1: SpecShakingMarker, - T2: SpecShakingMarker, - T3: SpecShakingMarker, - T4: SpecShakingMarker, - > SpecShakingMarker for (T0, T1, T2, T3, T4) -{ - #[inline(always)] - fn spec_shaking_marker() { - T0::spec_shaking_marker(); - T1::spec_shaking_marker(); - T2::spec_shaking_marker(); - T3::spec_shaking_marker(); - T4::spec_shaking_marker(); - } -} - -impl< - T0: SpecShakingMarker, - T1: SpecShakingMarker, - T2: SpecShakingMarker, - T3: SpecShakingMarker, - T4: SpecShakingMarker, - T5: SpecShakingMarker, - > SpecShakingMarker for (T0, T1, T2, T3, T4, T5) -{ - #[inline(always)] - fn spec_shaking_marker() { - T0::spec_shaking_marker(); - T1::spec_shaking_marker(); - T2::spec_shaking_marker(); - T3::spec_shaking_marker(); - T4::spec_shaking_marker(); - T5::spec_shaking_marker(); - } -} - -impl< - T0: SpecShakingMarker, - T1: SpecShakingMarker, - T2: SpecShakingMarker, - T3: SpecShakingMarker, - T4: SpecShakingMarker, - T5: SpecShakingMarker, - T6: SpecShakingMarker, - > SpecShakingMarker for (T0, T1, T2, T3, T4, T5, T6) -{ - #[inline(always)] - fn spec_shaking_marker() { - T0::spec_shaking_marker(); - T1::spec_shaking_marker(); - T2::spec_shaking_marker(); - T3::spec_shaking_marker(); - T4::spec_shaking_marker(); - T5::spec_shaking_marker(); - T6::spec_shaking_marker(); - } -} - -impl< - T0: SpecShakingMarker, - T1: SpecShakingMarker, - T2: SpecShakingMarker, - T3: SpecShakingMarker, - T4: SpecShakingMarker, - T5: SpecShakingMarker, - T6: SpecShakingMarker, - T7: SpecShakingMarker, - > SpecShakingMarker for (T0, T1, T2, T3, T4, T5, T6, T7) -{ - #[inline(always)] - fn spec_shaking_marker() { - T0::spec_shaking_marker(); - T1::spec_shaking_marker(); - T2::spec_shaking_marker(); - T3::spec_shaking_marker(); - T4::spec_shaking_marker(); - T5::spec_shaking_marker(); - T6::spec_shaking_marker(); - T7::spec_shaking_marker(); - } -} - -impl< - T0: SpecShakingMarker, - T1: SpecShakingMarker, - T2: SpecShakingMarker, - T3: SpecShakingMarker, - T4: SpecShakingMarker, - T5: SpecShakingMarker, - T6: SpecShakingMarker, - T7: SpecShakingMarker, - T8: SpecShakingMarker, - > SpecShakingMarker for (T0, T1, T2, T3, T4, T5, T6, T7, T8) -{ - #[inline(always)] - fn spec_shaking_marker() { - T0::spec_shaking_marker(); - T1::spec_shaking_marker(); - T2::spec_shaking_marker(); - T3::spec_shaking_marker(); - T4::spec_shaking_marker(); - T5::spec_shaking_marker(); - T6::spec_shaking_marker(); - T7::spec_shaking_marker(); - T8::spec_shaking_marker(); - } -} - -impl< - T0: SpecShakingMarker, - T1: SpecShakingMarker, - T2: SpecShakingMarker, - T3: SpecShakingMarker, - T4: SpecShakingMarker, - T5: SpecShakingMarker, - T6: SpecShakingMarker, - T7: SpecShakingMarker, - T8: SpecShakingMarker, - T9: SpecShakingMarker, - > SpecShakingMarker for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) -{ - #[inline(always)] - fn spec_shaking_marker() { - T0::spec_shaking_marker(); - T1::spec_shaking_marker(); - T2::spec_shaking_marker(); - T3::spec_shaking_marker(); - T4::spec_shaking_marker(); - T5::spec_shaking_marker(); - T6::spec_shaking_marker(); - T7::spec_shaking_marker(); - T8::spec_shaking_marker(); - T9::spec_shaking_marker(); - } -} - -impl< - T0: SpecShakingMarker, - T1: SpecShakingMarker, - T2: SpecShakingMarker, - T3: SpecShakingMarker, - T4: SpecShakingMarker, - T5: SpecShakingMarker, - T6: SpecShakingMarker, - T7: SpecShakingMarker, - T8: SpecShakingMarker, - T9: SpecShakingMarker, - T10: SpecShakingMarker, - > SpecShakingMarker for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -{ - #[inline(always)] - fn spec_shaking_marker() { - T0::spec_shaking_marker(); - T1::spec_shaking_marker(); - T2::spec_shaking_marker(); - T3::spec_shaking_marker(); - T4::spec_shaking_marker(); - T5::spec_shaking_marker(); - T6::spec_shaking_marker(); - T7::spec_shaking_marker(); - T8::spec_shaking_marker(); - T9::spec_shaking_marker(); - T10::spec_shaking_marker(); - } -} - -impl< - T0: SpecShakingMarker, - T1: SpecShakingMarker, - T2: SpecShakingMarker, - T3: SpecShakingMarker, - T4: SpecShakingMarker, - T5: SpecShakingMarker, - T6: SpecShakingMarker, - T7: SpecShakingMarker, - T8: SpecShakingMarker, - T9: SpecShakingMarker, - T10: SpecShakingMarker, - T11: SpecShakingMarker, - > SpecShakingMarker for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) -{ - #[inline(always)] - fn spec_shaking_marker() { - T0::spec_shaking_marker(); - T1::spec_shaking_marker(); - T2::spec_shaking_marker(); - T3::spec_shaking_marker(); - T4::spec_shaking_marker(); - T5::spec_shaking_marker(); - T6::spec_shaking_marker(); - T7::spec_shaking_marker(); - T8::spec_shaking_marker(); - T9::spec_shaking_marker(); - T10::spec_shaking_marker(); - T11::spec_shaking_marker(); - } -} - -impl< - T0: SpecShakingMarker, - T1: SpecShakingMarker, - T2: SpecShakingMarker, - T3: SpecShakingMarker, - T4: SpecShakingMarker, - T5: SpecShakingMarker, - T6: SpecShakingMarker, - T7: SpecShakingMarker, - T8: SpecShakingMarker, - T9: SpecShakingMarker, - T10: SpecShakingMarker, - T11: SpecShakingMarker, - T12: SpecShakingMarker, - > SpecShakingMarker for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) -{ - #[inline(always)] - fn spec_shaking_marker() { - T0::spec_shaking_marker(); - T1::spec_shaking_marker(); - T2::spec_shaking_marker(); - T3::spec_shaking_marker(); - T4::spec_shaking_marker(); - T5::spec_shaking_marker(); - T6::spec_shaking_marker(); - T7::spec_shaking_marker(); - T8::spec_shaking_marker(); - T9::spec_shaking_marker(); - T10::spec_shaking_marker(); - T11::spec_shaking_marker(); - T12::spec_shaking_marker(); - } + fn spec_shaking_marker() {} } -// SDK type implementations (no-op for built-in types, propagate for containers) -// These are imported via crate:: to avoid circular dependencies - -impl SpecShakingMarker for crate::Address {} -impl SpecShakingMarker for crate::Bytes {} -impl SpecShakingMarker for crate::BytesN {} -impl SpecShakingMarker for crate::String {} -impl SpecShakingMarker for crate::Symbol {} -impl SpecShakingMarker for crate::U256 {} -impl SpecShakingMarker for crate::I256 {} -impl SpecShakingMarker for crate::Timepoint {} -impl SpecShakingMarker for crate::Duration {} -impl SpecShakingMarker for crate::Val {} -impl SpecShakingMarker for crate::Error {} - -// Container types - propagate to inner types -impl SpecShakingMarker for crate::Vec { +impl SpecShakingMarker for &T { #[inline(always)] fn spec_shaking_marker() { T::spec_shaking_marker(); } } -impl SpecShakingMarker for crate::Map { - #[inline(always)] - fn spec_shaking_marker() { - K::spec_shaking_marker(); - V::spec_shaking_marker(); - } +/// Implemented by generated UDTs so sidecar graph records can refer to exact type specs. +/// +/// This is also generated for `export = false` UDTs when spec shaking v2 is +/// enabled so graph records can be built without adding those types to +/// `contractspecv0`. +#[doc(hidden)] +pub trait SpecTypeId { + const SPEC_TYPE_ID: [u8; 32]; } - -// Additional SDK types -impl SpecShakingMarker for crate::MuxedAddress {} -impl SpecShakingMarker for crate::crypto::Hash {} -impl SpecShakingMarker for crate::crypto::bls12_381::Bls12381G1Affine {} -impl SpecShakingMarker for crate::crypto::bls12_381::Bls12381G2Affine {} -impl SpecShakingMarker for crate::crypto::bls12_381::Bls12381Fp {} -impl SpecShakingMarker for crate::crypto::bls12_381::Bls12381Fp2 {} -impl SpecShakingMarker for crate::crypto::bls12_381::Bls12381Fr {} -impl SpecShakingMarker for crate::crypto::bn254::Bn254G1Affine {} -impl SpecShakingMarker for crate::crypto::bn254::Bn254G2Affine {} -impl SpecShakingMarker for crate::crypto::bn254::Bn254Fp {} -impl SpecShakingMarker for crate::crypto::bn254::Bn254Fr {} - -// Auth types - these have export=false but are legitimately used at external -// boundaries (as inputs to __check_auth in custom account contracts). -// They don't emit specs themselves because they're internal SDK types. -impl SpecShakingMarker for crate::auth::Context {} -impl SpecShakingMarker for crate::auth::ContractContext {} -impl SpecShakingMarker for crate::auth::CreateContractHostFnContext {} -impl SpecShakingMarker for crate::auth::CreateContractWithConstructorHostFnContext {} -impl SpecShakingMarker for crate::auth::ContractExecutable {} -impl SpecShakingMarker for crate::auth::InvokerContractAuthEntry {} -impl SpecShakingMarker for crate::auth::SubContractInvocation {} diff --git a/soroban-sdk/src/try_from_val_for_contract_fn.rs b/soroban-sdk/src/try_from_val_for_contract_fn.rs index 51f94d955..32f51fd56 100644 --- a/soroban-sdk/src/try_from_val_for_contract_fn.rs +++ b/soroban-sdk/src/try_from_val_for_contract_fn.rs @@ -14,9 +14,8 @@ //! is most appropriate. For types that should only be used and converted to as //! part of contract function invocation, then this trait is appropriate. //! -//! When the `experimental_spec_shaking_v2` feature is enabled, this trait also -//! calls `SpecShakingMarker::spec_shaking_marker()` to ensure that type specs -//! are included in the WASM when types are used at external boundaries. +//! Spec shaking roots function parameter types from the `contractspecv0` +//! function entries, so this conversion path does not need to emit marker code. use crate::{env::internal::Env, Error, TryFromVal}; use core::fmt::Debug; @@ -30,21 +29,6 @@ pub trait TryFromValForContractFn: Sized { fn try_from_val_for_contract_fn(env: &E, v: &V) -> Result; } -#[cfg(feature = "experimental_spec_shaking_v2")] -#[doc(hidden)] -#[allow(deprecated)] -impl TryFromValForContractFn for U -where - U: TryFromVal + crate::SpecShakingMarker, -{ - type Error = U::Error; - fn try_from_val_for_contract_fn(e: &E, v: &T) -> Result { - U::spec_shaking_marker(); - U::try_from_val(e, v) - } -} - -#[cfg(not(feature = "experimental_spec_shaking_v2"))] #[doc(hidden)] #[allow(deprecated)] impl TryFromValForContractFn for U diff --git a/soroban-sdk/test_snapshots/tests/address/test_get_existing_contract_address_executable_wasm.1.json b/soroban-sdk/test_snapshots/tests/address/test_get_existing_contract_address_executable_wasm.1.json index d5ea589bd..3351dbf2a 100644 --- a/soroban-sdk/test_snapshots/tests/address/test_get_existing_contract_address_executable_wasm.1.json +++ b/soroban-sdk/test_snapshots/tests/address/test_get_existing_contract_address_executable_wasm.1.json @@ -18,7 +18,7 @@ } }, "executable": { - "wasm": "d31850fea406e46577bb137d5fbe2e78a574caf8b868eec8eac690449b06e9ec" + "wasm": "0ee9dab6c9f5369bae3f1dbc15dd28bd6726291f3659172c44f5227c9b9fd72a" }, "constructor_args": [] } @@ -70,7 +70,7 @@ "val": { "contract_instance": { "executable": { - "wasm": "d31850fea406e46577bb137d5fbe2e78a574caf8b868eec8eac690449b06e9ec" + "wasm": "0ee9dab6c9f5369bae3f1dbc15dd28bd6726291f3659172c44f5227c9b9fd72a" }, "storage": null } @@ -91,21 +91,21 @@ "ext": "v0", "cost_inputs": { "ext": "v0", - "n_instructions": 831, - "n_functions": 8, + "n_instructions": 1524, + "n_functions": 17, "n_globals": 4, "n_table_entries": 0, - "n_types": 8, + "n_types": 13, "n_data_segments": 1, "n_elem_segments": 0, - "n_imports": 7, - "n_exports": 5, + "n_imports": 13, + "n_exports": 7, "n_data_segment_bytes": 132 } } }, - "hash": "d31850fea406e46577bb137d5fbe2e78a574caf8b868eec8eac690449b06e9ec", - "code": "0061736d01000000012e0860017e017e60037e7e7e017e60047e7e7e7e017e60027e7e017e60027f7f0060027f7f017f60027f7e00600000022b070176013300000162016d0001016d01610002017601680001016901320000017601310003016901310000030908040405060403070705030100110621047f01418080c0000b7f00418481c0000b7f00418481c0000b7f00419081c0000b072f05066d656d6f7279020003616464000c015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030aa50e08800704017f027e017f017e23808080800041c0006b220224808080800041002d00aa80c080001a41002d008e80c080001a41002d009c80c080001a41002d008080c080001a024002402001290300220342ff018342cb00510d00200041043a00000c010b200310808080800021042002410036021020022003370308200220044220883e0214200241186a200241086a1088808080000240024002400240200229031822034202510d002003a74101710d00024020022903202203a741ff0171220141ca00460d002001410e470d010b0240024002400240200341c880c08000ad4220864204844284808080c000108180808000422088a70e0400010203050b200228021020022802141089808080000d04410021050c050b2002280210200228021410898080800041014b0d03200241186a200241086a108880808000200229031822034202510d032003a74101710d0320022903202103410021010240034020014118460d01200241186a20016a4202370300200141086a21010c000b0b200342ff018342cc00520d03200341ec80c08000ad422086420484200241186aad4220864204844284808080301082808080001a200241306a2002290318108a8080800020022802300d0320022903382104200241306a2002290320108a8080800020022802300d032002290328220642ff018342cb00520d0320022903382103410121050c040b2002280210200228021410898080800041014b0d02200241186a200241086a108880808000200229031822034202510d022003a74101710d022002290320220342ff01834204520d02410a410f41092003422088a72201410f461b2001410a461b22014109460d02410221050c040b2002280210200228021410898080800041014b0d01200241186a200241086a108880808000200229031822034202510d012003a74101710d012002290320220342ff018342cb00520d01410021010240034020014110460d01200241306a20016a4202370300200141086a21010c000b0b2003200241306aad4220864204844284808080201083808080001a200241186a2002290330108a8080800020022802184101460d012002290338220342ff018342cb00520d0120022903202104410321050c020b200041043a00000c030b200041043a00000c020b0b200020063703182000200337031020002004370308200020013a0001200020053a00000b200241c0006a2480808080000b4a02017e017f42022102024020012802082203200128020c4f0d00200020012903002003ad4220864204841085808080003703082001200341016a360208420021020b200020023703000b1900024020012000490d00200120006b0f0b108d80808000000b5d02017f017e024002402001a741ff0171220241c100460d00024020024107460d00420121034283908080800121010c020b20014208872101420021030c010b42002103200110848080800021010b20002003370300200020013703080b7803017f017e017f23808080800041106b220224808080800042022103024020012802082204200128020c4f0d00200220012903002004ad422086420484108580808000108a8080800020022903002103200020022903083703082001200441016a3602080b20002003370300200241106a2480808080000bd60404027f017e017f057e23808080800041c0006b22022480808080002002200137030820022000370300200241106a200210878080800002400240024020022d001022034104460d00200229032021012002290318210420023100112100200241106a200241086a10878080800020022d001022054104460d00200229032021062002290318210720023100112108420021094200210a024002400240024020030e0405020100050b200110808080800021002002410036023820022001370330200220004220883e023c420021010340200241106a200241306a108b80808000200229031022004202510d032000a74101710d0620022903182200420053200120007c2200200153470d06200021010c000b0b2000210a0c030b2001420053200420017c220a20045373450d020c030b2001420053200420017c220a20045373450d010c020b000b0240024002400240024020050e0404020100040b200610808080800021012002410036023820022006370330200220014220883e023c420021010340200241106a200241306a108b80808000200229031022004202510d032000a74101710d0520022903182200420053200120007c2200200153470d05200021010c000b0b200821090c020b2006420053200720067c2209200753730d020c010b2001420053200720017c2209200753730d010b2009420053200a20097c2201200a53730d000240024020014280808080808080c0007c42ffffffffffffffff00560d00200142088642078421010c010b200110868080800021010b200241c0006a24808080800020010f0b108d80808000000b0900108e80808000000b0300000b0b8e010100418080c0000b8401537045635631f3b0ab40690d48b4537045635631aff793ba9e4dde9a537045635631eb9f12269a76282a53704563563116276438ffc9b1f85564744155647442556474435564744438001000040000003c001000040000004000100004000000440010000400000061626300680010000100000069001000010000006a0010000100000000cf030e636f6e74726163747370656376300000000000000000000000036164640000000002000000000000000161000000000007d000000007556474456e756d00000000000000000162000000000007d000000007556474456e756d00000000010000000700000002000000000000000000000007556474456e756d0000000004000000000000000000000004556474410000000100000000000000045564744200000001000007d0000000095564745374727563740000000000000100000000000000045564744300000001000007d000000008556474456e756d320000000100000000000000045564744400000001000007d0000000085564745475706c6500000003000000000000000000000008556474456e756d32000000020000000000000001410000000000000a0000000000000001420000000000000f000000010000000000000000000000085564745475706c650000000200000000000000013000000000000007000000000000000131000000000003ea0000000700000001000000000000000000000009556474537472756374000000000000030000000000000001610000000000000700000000000000016200000000000007000000000000000163000000000003ea00000007001e11636f6e7472616374656e766d6574617630000000000000001a00000000004f0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e39312e3000000000000000000012727373646b5f737065635f7368616b696e6700000000000132000000" + "hash": "0ee9dab6c9f5369bae3f1dbc15dd28bd6726291f3659172c44f5227c9b9fd72a", + "code": "0061736d01000000014e0d60017e017e60037e7e7e017e60027e7e017e60047e7e7e7e017e60027f7e0060027f7f0060037e7f7f017e60027f7f017f60057e7f7f7f7f0060000060017f017e60037f7f7f0060027f7f017e024f0d017601330000017601680001016901320000017601310002016901310000017601380000016d01340002016d013100020176016700020162016a0002016d01390001016d016100030162016d00010312110405060708040404050209000a020b0c0905030100110621047f01418080c0000b7f00418481c0000b7f00418481c0000b7f00419081c0000b074c07066d656d6f727902000361646400160972656375727369766500180e7265637572736976655f656e756d001a015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030aaa1a11b60604017f017e027f017e23808080800041c0006b220224808080800002400240200142ff018342cb00510d00200041043a00000c010b200110808080800021032002410036021020022001370308200220034220883e0214200241186a200241086a108e808080000240024002400240200229031822014202510d002001a74101710d00024020022903202201a741ff0171220441ca00460d002004410e470d010b02400240024002402001419080c080004104108f80808000422088a70e0400010203050b200228021020022802141090808080000d04410021050c050b2002280210200228021410908080800041014b0d03200241186a200241086a108e80808000200229031822014202510d032001a74101710d0320022903202101410021040240034020044118460d01200241186a20046a4202370300200441086a21040c000b0b200142ff018342cc00520d03200141b480c080004103200241186a4103109180808000200241306a200229031810928080800020022802300d0320022903382103200241306a200229032010928080800020022802300d032002290328220642ff018342cb00520d0320022903382101410121050c040b2002280210200228021410908080800041014b0d02200241186a200241086a108e80808000200229031822014202510d022001a74101710d022002290320220142ff01834204520d02410a410f41092001422088a72204410f461b2004410a461b22044109460d02410221050c040b2002280210200228021410908080800041014b0d01200241186a200241086a108e80808000200229031822014202510d012001a74101710d012002290320220142ff018342cb00520d01410021040240034020044110460d01200241306a20046a4202370300200441086a21040c000b0b2001200241306aad4220864204844284808080201081808080001a200241186a200229033010928080800020022802184101460d012002290338220142ff018342cb00520d0120022903202103410321050c020b200041043a00000c030b200041043a00000c020b0b200020063703182000200137031020002003370308200020043a0001200020053a00000b200241c0006a2480808080000b4a02017e017f42022102024020012802082203200128020c4f0d00200020012903002003ad4220864204841083808080003703082001200341016a360208420021020b200020023703000b1c0020002001ad4220864204842002ad422086420484108c808080000b1900024020012000490d00200120006b0f0b109780808000000b3100024020022004460d00000b20002001ad4220864204842003ad4220864204842002ad422086420484108b808080001a0b5d02017f017e024002402001a741ff0171220241c100460d00024020024107460d00420121034283908080800121010c020b20014208872101420021030c010b42002103200110828080800021010b20002003370300200020013703080bb50102027f027e23808080800041106b2202248080808000410021030240034020034110460d01200220036a4202370300200341086a21030c000b0b420121040240200142ff018342cc00520d00200141cc80c08000410220024102109180808000024020022903002201a741ff0171220341ca00460d002003410e470d010b2002290308220542ff018342cb00520d002000200537031020002001370308420021040b20002004370300200241106a2480808080000bb50102027f027e23808080800041106b2202248080808000410021030240034020034110460d01200220036a4202370300200341086a21030c000b0b420121040240200142ff018342cc00520d00200141cc80c08000410220024102109180808000024020022903002201a741ff0171220341ca00460d002003410e470d010b2002290308220542ff018342cc00520d002000200537031020002001370308420021040b20002004370300200241106a2480808080000b7803017f017e017f23808080800041106b220224808080800042022103024020012802082204200128020c4f0d00200220012903002004ad42208642048410838080800010928080800020022903002103200020022903083703082001200441016a3602080b20002003370300200241106a2480808080000bb70404027f027e017f057e23808080800041306b220224808080800020022000108d8080800002400240024020022d000022034104460d0020022903102100200229030821042002310001210520022001108d8080800020022d000022064104460d002002290310210720022903082108200231000121094200210a4200210b024002400240024020030e0405020100050b200010808080800021012002410036022820022000370320200220014220883e022c4200210003402002200241206a109580808000200229030022014202510d032001a74101710d0620022903082201420053200020017c2201200053470d06200121000c000b0b2005210b0c030b2000420053200420007c220b20045373450d020c030b2000420053200420007c220b20045373450d010c020b000b0240024002400240024020060e0404020100040b200710808080800021002002410036022820022007370320200220004220883e022c4200210003402002200241206a109580808000200229030022014202510d032001a74101710d0520022903082201420053200020017c2201200053470d05200121000c000b0b2009210a0c020b2007420053200820077c220a200853730d020c010b2000420053200820007c220a200853730d010b200a420053200b200a7c2200200b53730d000240024020004280808080808080c0007c42ffffffffffffffff00560d00200042088642078421000c010b200010848080800021000b200241306a24808080800020000f0b109780808000000b0900109d80808000000b9f0102017f017e23808080800041206b2201248080808000200141086a2000109380808000024020012802084101460d0042022100024020012903182202108080808000428080808010540d00200141086a200210858080800010938080800020012802084101460d01200129031021002001200129031837031020012000370308200141086a10998080800021000b200141206a24808080800020000f0b000b240041cc80c08000ad4220864204842000ad422086420484428480808020108a808080000bf60503017f017e017f23808080800041c0006b22022480808080000240200042ff018342cb00520d00200010808080800021032002410036021020022000370308200220034220883e0214200241186a200241086a108e80808000200229031822004202510d002000a74101710d00024020022903202200a741ff0171220441ca00460d002004410e470d010b024002400240024002400240200041f480c080004102108f80808000422088a70e020100060b2002280210200228021410908080800041014b0d05200241306a200241086a108e80808000200229033022004202510d052000a74101710d05200241186a200229033810948080800020022802184101460d05200142ff01834204520d052002290328220020014284808080708322011086808080004201520d0120002001108780808000220042ff018342cb00520d05200010808080800021012002410036021020022000370308200220014220883e0214200241186a200241086a108e80808000200229031822004202510d052000a74101710d05024020022903202200a741ff0171220441ca00460d002004410e470d060b200041f480c080004102108f80808000422088a70e020302050b200228021020022802141090808080000d04200142ff01834204520d040b420221000c020b2002280210200228021410908080800041014b0d02200241306a200241086a108e80808000200229033022004202510d022000a74101710d02200241186a200229033810948080800020022802184101460d022002290328210020022903202101200241186a41e880c080004109109b8080800020022802180d022002290320210320022000370320200220013703182002200241186a10998080800037032020022003370318200241186a4102109c8080800021000c010b200228021020022802141090808080000d01200241186a41dc80c08000410c109b8080800020022802180d0120022002290320370318200241186a4101109c8080800021000b200241c0006a24808080800020000f0b000bd60102017e037f02400240200241094b0d0042002103410021040340024020044109470d002003420886420e8421030c030b410121050240200120046a2d0000220641df00460d0002400240200641506a41ff0171410a490d00200641bf7f6a41ff0171411a490d012006419f7f6a41ff0171411a4f0d04200641456a21050c020b200641526a21050c010b2006414b6a21050b20034206862005ad42ff0183842103200441016a21040c000b0b2001ad4220864204842002ad42208642048410898080800021030b20004200370300200020033703080b1a002000ad4220864204842001ad4220864204841088808080000b0300000b0b8e010100418080c0000b8401556474415564744255647443556474440000100004000000040010000400000008001000040000000c0010000400000061626300300010000100000031001000010000003200100001000000300010000100000031001000010000004e6f745265637572736976655265637572736976650000005c0010000c000000680010000900000000db1c0e636f6e74726163747370656376300000000000000000000000036164640000000002000000000000000161000000000007d000000007556474456e756d00000000000000000162000000000007d000000007556474456e756d00000000010000000700000002000000000000000000000007556474456e756d0000000004000000000000000000000004556474410000000100000000000000045564744200000001000007d0000000095564745374727563740000000000000100000000000000045564744300000001000007d000000008556474456e756d320000000100000000000000045564744400000001000007d0000000085564745475706c6500000003000000000000000000000008556474456e756d32000000020000000000000001410000000000000a0000000000000001420000000000000f000000010000000000000000000000085564745475706c650000000200000000000000013000000000000007000000000000000131000000000003ea0000000700000001000000000000000000000009556474537472756374000000000000030000000000000001610000000000000700000000000000016200000000000007000000000000000163000000000003ea0000000700000000000000000000000972656375727369766500000000000001000000000000000161000000000007d00000000c55647452656375727369766500000001000003e8000007d00000000c5564745265637572736976650000000100000000000000000000000c5564745265637572736976650000000200000000000000016100000000000011000000000000000162000000000003ea000007d00000000c5564745265637572736976650000000200000000000000000000000d526563757273697665456e756d0000000000000200000000000000000000000c4e6f7452656375727369766500000001000000000000000952656375727369766500000000000001000007d00000000f526563757273697665546f456e756d000000000100000000000000000000000f526563757273697665546f456e756d000000000200000000000000016100000000000011000000000000000162000000000003ec00000004000007d00000000d526563757273697665456e756d00000000000000000000000000000e7265637572736976655f656e756d000000000002000000000000000161000000000007d00000000d526563757273697665456e756d00000000000000000000036b6579000000000400000001000003e9000003e8000007d00000000d526563757273697665456e756d0000000000000300000002000000e3436f6e74657874206f6620612073696e676c6520617574686f72697a65642063616c6c20706572666f726d656420627920616e20616464726573732e0a0a437573746f6d206163636f756e7420636f6e747261637473207468617420696d706c656d656e7420605f5f636865636b5f6175746860207370656369616c2066756e6374696f6e0a726563656976652061206c697374206f662060436f6e74657874602076616c75657320636f72726573706f6e64696e6720746f20616c6c207468652063616c6c7320746861740a6e65656420746f20626520617574686f72697a65642e000000000000000007436f6e7465787400000000030000000100000014436f6e747261637420696e766f636174696f6e2e00000008436f6e747261637400000001000007d00000000f436f6e7472616374436f6e7465787400000000010000003d436f6e7472616374207468617420686173206120636f6e7374727563746f722077697468206e6f20617267756d656e747320697320637265617465642e00000000000014437265617465436f6e7472616374486f7374466e00000001000007d00000001b437265617465436f6e7472616374486f7374466e436f6e74657874000000000100000044436f6e7472616374207468617420686173206120636f6e7374727563746f7220776974682031206f72206d6f726520617267756d656e747320697320637265617465642e0000001c437265617465436f6e74726163745769746843746f72486f7374466e00000001000007d00000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e74657874000000000001000000bd417574686f72697a6174696f6e20636f6e74657874206f6620612073696e676c6520636f6e74726163742063616c6c2e0a0a546869732073747275637420636f72726573706f6e647320746f20612060726571756972655f617574685f666f725f61726773602063616c6c20666f7220616e20616464726573730a66726f6d2060636f6e7472616374602066756e6374696f6e20776974682060666e5f6e616d6560206e616d6520616e642060617267736020617267756d656e74732e000000000000000000000f436f6e7472616374436f6e746578740000000003000000000000000461726773000003ea000000000000000000000008636f6e7472616374000000130000000000000007666e5f6e616d650000000011000000020000005f436f6e74726163742065786563757461626c65207573656420666f72206372656174696e672061206e657720636f6e747261637420616e64207573656420696e0a60437265617465436f6e7472616374486f7374466e436f6e74657874602e000000000000000012436f6e747261637445786563757461626c650000000000010000000100000000000000045761736d00000001000003ee00000020000000010000003856616c7565206f6620636f6e7472616374206e6f646520696e20496e766f6b6572436f6e747261637441757468456e74727920747265652e0000000000000015537562436f6e7472616374496e766f636174696f6e000000000000020000000000000007636f6e7465787400000007d00000000f436f6e7472616374436f6e7465787400000000000000000f7375625f696e766f636174696f6e7300000003ea000007d000000018496e766f6b6572436f6e747261637441757468456e747279000000020000012f41206e6f646520696e207468652074726565206f6620617574686f72697a6174696f6e7320706572666f726d6564206f6e20626568616c66206f66207468652063757272656e740a636f6e747261637420617320696e766f6b6572206f662074686520636f6e7472616374732064656570657220696e207468652063616c6c20737461636b2e0a0a54686973206973207573656420617320616e20617267756d656e74206f662060617574686f72697a655f61735f63757272656e745f636f6e74726163746020686f73742066756e6374696f6e2e0a0a54686973207472656520636f72726573706f6e64732060726571756972655f617574685b5f666f725f617267735d602063616c6c73206f6e20626568616c66206f66207468650a63757272656e7420636f6e74726163742e000000000000000018496e766f6b6572436f6e747261637441757468456e747279000000030000000100000012496e766f6b65206120636f6e74726163742e000000000008436f6e747261637400000001000007d000000015537562436f6e7472616374496e766f636174696f6e0000000000000100000035437265617465206120636f6e74726163742070617373696e67203020617267756d656e747320746f20636f6e7374727563746f722e00000000000014437265617465436f6e7472616374486f7374466e00000001000007d00000001b437265617465436f6e7472616374486f7374466e436f6e7465787400000000010000003d437265617465206120636f6e74726163742070617373696e672030206f72206d6f726520617267756d656e747320746f20636f6e7374727563746f722e0000000000001c437265617465436f6e74726163745769746843746f72486f7374466e00000001000007d00000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e7465787400000000000100000076417574686f72697a6174696f6e20636f6e7465787420666f7220606372656174655f636f6e74726163746020686f73742066756e6374696f6e2074686174206372656174657320610a6e657720636f6e7472616374206f6e20626568616c66206f6620617574686f72697a657220616464726573732e0000000000000000001b437265617465436f6e7472616374486f7374466e436f6e746578740000000002000000000000000a65786563757461626c650000000007d000000012436f6e747261637445786563757461626c650000000000000000000473616c74000003ee0000002000000001000000d6417574686f72697a6174696f6e20636f6e7465787420666f7220606372656174655f636f6e74726163746020686f73742066756e6374696f6e2074686174206372656174657320610a6e657720636f6e7472616374206f6e20626568616c66206f6620617574686f72697a657220616464726573732e0a54686973206973207468652073616d652061732060437265617465436f6e7472616374486f7374466e436f6e74657874602c2062757420616c736f206861730a636f6e747261637420636f6e7374727563746f7220617267756d656e74732e0000000000000000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e746578740000000000030000000000000010636f6e7374727563746f725f61726773000003ea00000000000000000000000a65786563757461626c650000000007d000000012436f6e747261637445786563757461626c650000000000000000000473616c74000003ee000000200000000200000000000000000000000a45786563757461626c650000000000030000000100000000000000045761736d00000001000003ee0000002000000000000000000000000c5374656c6c617241737365740000000000000000000000074163636f756e740000d10b1c636f6e74726163747370656376302e727373646b2e677261706876305370477256010002f3b0ab40690d48b4819c947c3f41efcff32551d58b90b24218fb8c3eaa8c5e32000316276438ffc9b1f81c66b084b1b8fa798460e4dd703bc52a0eba483a94bbb287aff793ba9e4dde9a3f27a8b9cb949f88f64cc0b918d1c91a35f899a539c2cf9eeb9f12269a76282a7f31372e3391cc63fcecee330f96f2501b39e8c68ff0e0eb5370477256010002aff793ba9e4dde9a3f27a8b9cb949f88f64cc0b918d1c91a35f899a539c2cf9e00005370477256010002eb9f12269a76282a7f31372e3391cc63fcecee330f96f2501b39e8c68ff0e0eb0000537047725601000216276438ffc9b1f81c66b084b1b8fa798460e4dd703bc52a0eba483a94bbb28700005370477256010000ebb96de3341d5b5be44be7e3f42e999bf21ae135a1442ba81b1c560aedc1a4890002f3b0ab40690d48b4819c947c3f41efcff32551d58b90b24218fb8c3eaa8c5e32f3b0ab40690d48b4819c947c3f41efcff32551d58b90b24218fb8c3eaa8c5e325370477256010002c81291fed713f59ce4c703dc402324460d04e26a5fb0ac43fd0bc04a7e3cfc050001c81291fed713f59ce4c703dc402324460d04e26a5fb0ac43fd0bc04a7e3cfc055370477256010002ff7b5620ab0ddc64e77e19833cc23774c69d3d9f8f120e183e2508892e26004d0001e16f55dbd43798147ab22bbbdfdb6e142492bbf14df21026500cd1134a9743695370477256010002e16f55dbd43798147ab22bbbdfdb6e142492bbf14df21026500cd1134a9743690001ff7b5620ab0ddc64e77e19833cc23774c69d3d9f8f120e183e2508892e26004d53704772560100002860835a3b9730d8da5a70cf9ebf82867c30b690104d6613cfd7360c446edbb20002c81291fed713f59ce4c703dc402324460d04e26a5fb0ac43fd0bc04a7e3cfc05c81291fed713f59ce4c703dc402324460d04e26a5fb0ac43fd0bc04a7e3cfc0553704772560100008448210efcdb4d3602aa4ee4ee994a089408a9c044884369c9077eb9a6c5ecaa0002ff7b5620ab0ddc64e77e19833cc23774c69d3d9f8f120e183e2508892e26004dff7b5620ab0ddc64e77e19833cc23774c69d3d9f8f120e183e2508892e26004d5370477256010002a34acff744930b425d95ebfe03798365355c16eb944e65e658771f26f7c070540003f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec15e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e73940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af5370477256010002f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec00005370477256010002b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc000053704772560100029e29488ef0017b7bce9f644f0e44c02c0fe8ee278435729feb60d012481796670002f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec554c7144d3fa3a1f0ca5b704e5488b914a9e0f657f9f5bdb4723c76fb0f4cfe65370477256010002554c7144d3fa3a1f0ca5b704e5488b914a9e0f657f9f5bdb4723c76fb0f4cfe600039e29488ef0017b7bce9f644f0e44c02c0fe8ee278435729feb60d0124817966715e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e73940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af537047725601000215e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e0001b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc537047725601000273940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af0001b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc53704772560100024c7c7b0df4f21aa8f69831e24bcb82344ee697eddfc21c636bd6ce579c78101e0000001e11636f6e7472616374656e766d6574617630000000000000001a00000000004f0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e39312e3000000000000000000012727373646b5f737065635f7368616b696e6700000000000132000000" } }, "ext": "v0" diff --git a/soroban-sdk/test_snapshots/tests/crypto_bls12_381/test_invoke_contract.1.json b/soroban-sdk/test_snapshots/tests/crypto_bls12_381/test_invoke_contract.1.json index 58e682a0b..cc719c8d4 100644 --- a/soroban-sdk/test_snapshots/tests/crypto_bls12_381/test_invoke_contract.1.json +++ b/soroban-sdk/test_snapshots/tests/crypto_bls12_381/test_invoke_contract.1.json @@ -18,7 +18,7 @@ } }, "executable": { - "wasm": "4dac5a023abc307b72bce16cefe96e9809c5a46907858db23f00ae39cbbea07d" + "wasm": "319d07f74063a56bf1aec6384dc94ece42beb14a3e296c03e232682d4eff28f3" }, "constructor_args": [] } @@ -96,7 +96,7 @@ "val": { "contract_instance": { "executable": { - "wasm": "4dac5a023abc307b72bce16cefe96e9809c5a46907858db23f00ae39cbbea07d" + "wasm": "319d07f74063a56bf1aec6384dc94ece42beb14a3e296c03e232682d4eff28f3" }, "storage": null } @@ -117,7 +117,7 @@ "ext": "v0", "cost_inputs": { "ext": "v0", - "n_instructions": 1383, + "n_instructions": 1380, "n_functions": 18, "n_globals": 4, "n_table_entries": 0, @@ -126,12 +126,12 @@ "n_elem_segments": 0, "n_imports": 17, "n_exports": 8, - "n_data_segment_bytes": 148 + "n_data_segment_bytes": 132 } } }, - "hash": "4dac5a023abc307b72bce16cefe96e9809c5a46907858db23f00ae39cbbea07d", - "code": "0061736d0100000001320960047e7e7e7e017e60017e017e60027e7e017e60037e7f7f0060017f0060027f7e0060017f017e60000060037f7f7f017f026711016d0161000001620138000101630138000101630134000101630165000101630161000101630136000201630163000201630167000201760133000101760131000201620131000001620133000201690161000101780130000201690172000201760167000203131201030405050505060207020207040808080805030100110621047f01418080c0000b7f0041c480c0000b7f00419481c0000b7f0041a081c0000b075708066d656d6f727902000c64756d6d795f76657269667900110a66725f7665635f67657400190667315f6d756c001b0667325f6d756c001c015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030a931712870503027f047e017f23808080800041f0016b22012480808080004100210241002d008080c080001a0240034020024128460d01200141086a20026a4202370300200241086a21020c000b0b0240200042ff018342cc00520d002000419c80c08000ad422086420484200141086aad4220864204844284808080d0001080808080001a2001290308220042ff018342c800520d0020001081808080004280808080708342808080808006520d0020014190016a4100413010a0808080001a200020014190016a4130109280808000200141306a20014190016a413010a2808080001a200141306a10938080800020014190016a20012903101094808080002001280290010d00200129039801210320014190016a410041e00010a0808080001a200320014190016a41e000109280808000200141306a20014190016a41e00010a2808080001a200141306a109380808000200141306a41306a10938080800020014190016a20012903181095808080002001280290010d00200129039801210420014190016a20012903201096808080002001280290010d00200129039801210520014190016a20012903281097808080002001280290014101460d00200129039801210620001082808080001083808080001a20031084808080001085808080001a200520041086808080002103200620041087808080002104420221004101210203402000210520024101712107410021022003210020070d000b200120053703900120014190016a1098808080002105420221004101210203402000210320024101712107410021022004210020070d000b2001200337039001200520014190016a1098808080001088808080002100200141f0016a2480808080002000420151ad0f0b000b1f00200042042001ad4220864204842002ad422086420484108b808080001a0b24000240200041e480c080004130109f80808000417f4a0d000f0b410e109e80808000000b4201017e420121020240200142ff018342c800520d002001108180808000428080808070834280808080800c520d0020002001370308420021020b200020023703000ba60102017f017e024002402001a741ff0171220241c600460d00420121032002410c470d010b41c480c08000ad42208642048442848080808004108c80808000108d8080800021030240024002400240200142ce0083420c520d00200342ff0183420c510d010b20012003108e80808000427f550d010c020b20014208882003420888540d010b20012003108f8080800021010b20002001370308420021030b200020033703000b4d01017f23808080800041106b22022480808080002002200110948080800042012101024020022802000d0020002002290308370308420021010b20002001370300200241106a2480808080000b4201017e420121020240200142ff018342c800520d0020011081808080004280808080708342808080808018520d0020002001370308420021020b200020023703000b17002000ad4220864204844284808080101090808080000b870101017f23808080800041106b2202248080808000024002400240200042ff018342cb00520d00200142ff01834204520d0020001089808080004220882001422088580d0120022000200142848080807083108a8080800010958080800020022802004101470d020b000b109a80808000000b20022903082100200241106a24808080800020000b0b00412b109e80808000000b6501017f23808080800041106b220224808080800020022000109680808000024020022802004101460d00200229030821002002200110958080800020022802004101460d00200020022903081086808080002100200241106a24808080800020000f0b000b6501017f23808080800041106b220224808080800020022000109780808000024020022802004101460d00200229030821002002200110958080800020022802004101460d00200020022903081087808080002100200241106a24808080800020000f0b000b0300000b0900109d80808000000b4a01037f4100210302402002450d000240034020002d0000220420012d00002205470d01200041016a2100200141016a21012002417f6a2202450d020c000b0b200420056b21030b20030baa0301057f02400240200241104f0d00200021030c010b024020002000410020006b41037122046a22054f0d002004417f6a21062000210302402004450d0020042107200021030340200320013a0000200341016a21032007417f6a22070d000b0b20064107490d000340200320013a0000200341076a20013a0000200341066a20013a0000200341056a20013a0000200341046a20013a0000200341036a20013a0000200341026a20013a0000200341016a20013a0000200341086a22032005470d000b0b024020052005200220046b2202417c716a22034f0d00200141ff017141818284086c2107034020052007360200200541046a22052003490d000b0b200241037121020b02402003200320026a22074f0d002002417f6a2104024020024107712205450d000340200320013a0000200341016a21032005417f6a22050d000b0b20044107490d000340200320013a0000200341076a20013a0000200341066a20013a0000200341056a20013a0000200341046a20013a0000200341036a20013a0000200341026a20013a0000200341016a20013a0000200341086a22032007470d000b0b20000bb907010c7f23808080800041106b210302400240200241104f0d00200021040c010b024020002000410020006b41037122056a22064f0d002005417f6a2107200021042001210802402005450d002005210920002104200121080340200420082d00003a0000200841016a2108200441016a21042009417f6a22090d000b0b20074107490d000340200420082d00003a0000200441016a200841016a2d00003a0000200441026a200841026a2d00003a0000200441036a200841036a2d00003a0000200441046a200841046a2d00003a0000200441056a200841056a2d00003a0000200441066a200841066a2d00003a0000200441076a200841076a2d00003a0000200841086a2108200441086a22042006470d000b0b2006200220056b2209417c7122076a210402400240200120056a220841037122010d00200620044f0d0120082101034020062001280200360200200141046a2101200641046a22062004490d000c020b0b410021022003410036020c2003410c6a20017221050240410420016b220a410171450d00200520082d00003a0000410121020b0240200a410271450d00200520026a200820026a2f01003b01000b200820016b21022001410374210b200328020c210502400240200641046a2004490d002006210c0c010b4100200b6b411871210d034020062005200b76200241046a22022802002205200d7472360200200641086a210a200641046a220c2106200a2004490d000b0b41002106200341003a0008200341003a00060240024020014101470d00200341086a210d410021014100210a4100210e0c010b200241056a2d0000210a2003200241046a2d000022013a0008200a410874210a4102210e200341066a210d0b02402008410171450d00200d200241046a200e6a2d00003a000020032d0006411074210620032d000821010b200c200a200672200141ff0171724100200b6b411871742005200b76723602000b20094103712102200820076a21010b02402004200420026a22064f0d002002417f6a2109024020024107712208450d000340200420012d00003a0000200141016a2101200441016a21042008417f6a22080d000b0b20094107490d000340200420012d00003a0000200441016a200141016a2d00003a0000200441026a200141026a2d00003a0000200441036a200141036a2d00003a0000200441046a200141046a2d00003a0000200441056a200141056a2d00003a0000200441066a200141066a2d00003a0000200441076a200141076a2d00003a0000200141086a2101200441086a22042006470d000b0b20000b0e0020002001200210a1808080000b0b9e010100418080c0000b940153704563563185570041dc7eb72266706670326672673167320000000e00100002000000100010000300000013001000020000001500100002000000170010000200000073eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff000000011a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab00b7030e636f6e747261637473706563763000000000000000000000000667315f6d756c000000000002000000000000000170000000000003ee000000600000000000000001730000000000000c00000001000003ee0000006000000000000000000000000667325f6d756c000000000002000000000000000170000000000003ee000000c00000000000000001730000000000000c00000001000003ee000000c00000000100000000000000000000000a44756d6d7950726f6f66000000000005000000000000000266700000000003ee00000030000000000000000366703200000003ee000000600000000000000002667200000000000c000000000000000267310000000003ee00000060000000000000000267320000000003ee000000c000000000000000000000000a66725f7665635f676574000000000002000000000000000676616c7565730000000003ea0000000c0000000000000005696e64657800000000000004000000010000000c00000000000000000000000c64756d6d795f76657269667900000001000000000000000570726f6f66000000000007d00000000a44756d6d7950726f6f6600000000000100000001001e11636f6e7472616374656e766d6574617630000000000000001a00000000004f0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e39312e3000000000000000000012727373646b5f737065635f7368616b696e6700000000000132000000" + "hash": "319d07f74063a56bf1aec6384dc94ece42beb14a3e296c03e232682d4eff28f3", + "code": "0061736d0100000001320960047e7e7e7e017e60017e017e60027e7e017e60037e7f7f0060017f0060027f7e0060017f017e60000060037f7f7f017f026711016d0161000001620138000101630138000101630134000101630165000101630161000101630136000201630163000201630167000201760133000101760131000201620131000001620133000201690161000101780130000201690172000201760167000203131201030405050505060207020207040808080805030100110621047f01418080c0000b7f0041b480c0000b7f00418481c0000b7f00419081c0000b075708066d656d6f727902000c64756d6d795f76657269667900110a66725f7665635f67657400190667315f6d756c001b0667325f6d756c001c015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030a891712fd0403027f047e017f23808080800041f0016b2201248080808000410021020240034020024128460d01200141086a20026a4202370300200241086a21020c000b0b0240200042ff018342cc00520d002000418c80c08000ad422086420484200141086aad4220864204844284808080d0001080808080001a2001290308220042ff018342c800520d0020001081808080004280808080708342808080808006520d0020014190016a4100413010a0808080001a200020014190016a4130109280808000200141306a20014190016a413010a2808080001a200141306a10938080800020014190016a20012903101094808080002001280290010d00200129039801210320014190016a410041e00010a0808080001a200320014190016a41e000109280808000200141306a20014190016a41e00010a2808080001a200141306a109380808000200141306a41306a10938080800020014190016a20012903181095808080002001280290010d00200129039801210420014190016a20012903201096808080002001280290010d00200129039801210520014190016a20012903281097808080002001280290014101460d00200129039801210620001082808080001083808080001a20031084808080001085808080001a200520041086808080002103200620041087808080002104420221004101210203402000210520024101712107410021022003210020070d000b200120053703900120014190016a1098808080002105420221004101210203402000210320024101712107410021022004210020070d000b2001200337039001200520014190016a1098808080001088808080002100200141f0016a2480808080002000420151ad0f0b000b1f00200042042001ad4220864204842002ad422086420484108b808080001a0b24000240200041d480c080004130109f80808000417f4a0d000f0b410e109e80808000000b4201017e420121020240200142ff018342c800520d002001108180808000428080808070834280808080800c520d0020002001370308420021020b200020023703000ba60102017f017e024002402001a741ff0171220241c600460d00420121032002410c470d010b41b480c08000ad42208642048442848080808004108c80808000108d8080800021030240024002400240200142ce0083420c520d00200342ff0183420c510d010b20012003108e80808000427f550d010c020b20014208882003420888540d010b20012003108f8080800021010b20002001370308420021030b200020033703000b4d01017f23808080800041106b22022480808080002002200110948080800042012101024020022802000d0020002002290308370308420021010b20002001370300200241106a2480808080000b4201017e420121020240200142ff018342c800520d0020011081808080004280808080708342808080808018520d0020002001370308420021020b200020023703000b17002000ad4220864204844284808080101090808080000b870101017f23808080800041106b2202248080808000024002400240200042ff018342cb00520d00200142ff01834204520d0020001089808080004220882001422088580d0120022000200142848080807083108a8080800010958080800020022802004101470d020b000b109a80808000000b20022903082100200241106a24808080800020000b0b00412b109e80808000000b6501017f23808080800041106b220224808080800020022000109680808000024020022802004101460d00200229030821002002200110958080800020022802004101460d00200020022903081086808080002100200241106a24808080800020000f0b000b6501017f23808080800041106b220224808080800020022000109780808000024020022802004101460d00200229030821002002200110958080800020022802004101460d00200020022903081087808080002100200241106a24808080800020000f0b000b0300000b0900109d80808000000b4a01037f4100210302402002450d000240034020002d0000220420012d00002205470d01200041016a2100200141016a21012002417f6a2202450d020c000b0b200420056b21030b20030baa0301057f02400240200241104f0d00200021030c010b024020002000410020006b41037122046a22054f0d002004417f6a21062000210302402004450d0020042107200021030340200320013a0000200341016a21032007417f6a22070d000b0b20064107490d000340200320013a0000200341076a20013a0000200341066a20013a0000200341056a20013a0000200341046a20013a0000200341036a20013a0000200341026a20013a0000200341016a20013a0000200341086a22032005470d000b0b024020052005200220046b2202417c716a22034f0d00200141ff017141818284086c2107034020052007360200200541046a22052003490d000b0b200241037121020b02402003200320026a22074f0d002002417f6a2104024020024107712205450d000340200320013a0000200341016a21032005417f6a22050d000b0b20044107490d000340200320013a0000200341076a20013a0000200341066a20013a0000200341056a20013a0000200341046a20013a0000200341036a20013a0000200341026a20013a0000200341016a20013a0000200341086a22032007470d000b0b20000bb907010c7f23808080800041106b210302400240200241104f0d00200021040c010b024020002000410020006b41037122056a22064f0d002005417f6a2107200021042001210802402005450d002005210920002104200121080340200420082d00003a0000200841016a2108200441016a21042009417f6a22090d000b0b20074107490d000340200420082d00003a0000200441016a200841016a2d00003a0000200441026a200841026a2d00003a0000200441036a200841036a2d00003a0000200441046a200841046a2d00003a0000200441056a200841056a2d00003a0000200441066a200841066a2d00003a0000200441076a200841076a2d00003a0000200841086a2108200441086a22042006470d000b0b2006200220056b2209417c7122076a210402400240200120056a220841037122010d00200620044f0d0120082101034020062001280200360200200141046a2101200641046a22062004490d000c020b0b410021022003410036020c2003410c6a20017221050240410420016b220a410171450d00200520082d00003a0000410121020b0240200a410271450d00200520026a200820026a2f01003b01000b200820016b21022001410374210b200328020c210502400240200641046a2004490d002006210c0c010b4100200b6b411871210d034020062005200b76200241046a22022802002205200d7472360200200641086a210a200641046a220c2106200a2004490d000b0b41002106200341003a0008200341003a00060240024020014101470d00200341086a210d410021014100210a4100210e0c010b200241056a2d0000210a2003200241046a2d000022013a0008200a410874210a4102210e200341066a210d0b02402008410171450d00200d200241046a200e6a2d00003a000020032d0006411074210620032d000821010b200c200a200672200141ff0171724100200b6b411871742005200b76723602000b20094103712102200820076a21010b02402004200420026a22064f0d002002417f6a2109024020024107712208450d000340200420012d00003a0000200141016a2101200441016a21042008417f6a22080d000b0b20094107490d000340200420012d00003a0000200441016a200141016a2d00003a0000200441026a200141026a2d00003a0000200441036a200141036a2d00003a0000200441046a200141046a2d00003a0000200441056a200141056a2d00003a0000200441066a200141066a2d00003a0000200441076a200141076a2d00003a0000200141086a2101200441086a22042006470d000b0b20000b0e0020002001200210a1808080000b0b8e010100418080c0000b84016670667032667267316732000000100002000000020010000300000005001000020000000700100002000000090010000200000073eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff000000011a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab00cb180e636f6e747261637473706563763000000000000000000000000667315f6d756c000000000002000000000000000170000000000003ee000000600000000000000001730000000000000c00000001000003ee0000006000000000000000000000000667325f6d756c000000000002000000000000000170000000000003ee000000c00000000000000001730000000000000c00000001000003ee000000c00000000100000000000000000000000a44756d6d7950726f6f66000000000005000000000000000266700000000003ee00000030000000000000000366703200000003ee000000600000000000000002667200000000000c000000000000000267310000000003ee00000060000000000000000267320000000003ee000000c000000000000000000000000a66725f7665635f676574000000000002000000000000000676616c7565730000000003ea0000000c0000000000000005696e64657800000000000004000000010000000c00000000000000000000000c64756d6d795f76657269667900000001000000000000000570726f6f66000000000007d00000000a44756d6d7950726f6f660000000000010000000100000002000000e3436f6e74657874206f6620612073696e676c6520617574686f72697a65642063616c6c20706572666f726d656420627920616e20616464726573732e0a0a437573746f6d206163636f756e7420636f6e747261637473207468617420696d706c656d656e7420605f5f636865636b5f6175746860207370656369616c2066756e6374696f6e0a726563656976652061206c697374206f662060436f6e74657874602076616c75657320636f72726573706f6e64696e6720746f20616c6c207468652063616c6c7320746861740a6e65656420746f20626520617574686f72697a65642e000000000000000007436f6e7465787400000000030000000100000014436f6e747261637420696e766f636174696f6e2e00000008436f6e747261637400000001000007d00000000f436f6e7472616374436f6e7465787400000000010000003d436f6e7472616374207468617420686173206120636f6e7374727563746f722077697468206e6f20617267756d656e747320697320637265617465642e00000000000014437265617465436f6e7472616374486f7374466e00000001000007d00000001b437265617465436f6e7472616374486f7374466e436f6e74657874000000000100000044436f6e7472616374207468617420686173206120636f6e7374727563746f7220776974682031206f72206d6f726520617267756d656e747320697320637265617465642e0000001c437265617465436f6e74726163745769746843746f72486f7374466e00000001000007d00000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e74657874000000000001000000bd417574686f72697a6174696f6e20636f6e74657874206f6620612073696e676c6520636f6e74726163742063616c6c2e0a0a546869732073747275637420636f72726573706f6e647320746f20612060726571756972655f617574685f666f725f61726773602063616c6c20666f7220616e20616464726573730a66726f6d2060636f6e7472616374602066756e6374696f6e20776974682060666e5f6e616d6560206e616d6520616e642060617267736020617267756d656e74732e000000000000000000000f436f6e7472616374436f6e746578740000000003000000000000000461726773000003ea000000000000000000000008636f6e7472616374000000130000000000000007666e5f6e616d650000000011000000020000005f436f6e74726163742065786563757461626c65207573656420666f72206372656174696e672061206e657720636f6e747261637420616e64207573656420696e0a60437265617465436f6e7472616374486f7374466e436f6e74657874602e000000000000000012436f6e747261637445786563757461626c650000000000010000000100000000000000045761736d00000001000003ee00000020000000010000003856616c7565206f6620636f6e7472616374206e6f646520696e20496e766f6b6572436f6e747261637441757468456e74727920747265652e0000000000000015537562436f6e7472616374496e766f636174696f6e000000000000020000000000000007636f6e7465787400000007d00000000f436f6e7472616374436f6e7465787400000000000000000f7375625f696e766f636174696f6e7300000003ea000007d000000018496e766f6b6572436f6e747261637441757468456e747279000000020000012f41206e6f646520696e207468652074726565206f6620617574686f72697a6174696f6e7320706572666f726d6564206f6e20626568616c66206f66207468652063757272656e740a636f6e747261637420617320696e766f6b6572206f662074686520636f6e7472616374732064656570657220696e207468652063616c6c20737461636b2e0a0a54686973206973207573656420617320616e20617267756d656e74206f662060617574686f72697a655f61735f63757272656e745f636f6e74726163746020686f73742066756e6374696f6e2e0a0a54686973207472656520636f72726573706f6e64732060726571756972655f617574685b5f666f725f617267735d602063616c6c73206f6e20626568616c66206f66207468650a63757272656e7420636f6e74726163742e000000000000000018496e766f6b6572436f6e747261637441757468456e747279000000030000000100000012496e766f6b65206120636f6e74726163742e000000000008436f6e747261637400000001000007d000000015537562436f6e7472616374496e766f636174696f6e0000000000000100000035437265617465206120636f6e74726163742070617373696e67203020617267756d656e747320746f20636f6e7374727563746f722e00000000000014437265617465436f6e7472616374486f7374466e00000001000007d00000001b437265617465436f6e7472616374486f7374466e436f6e7465787400000000010000003d437265617465206120636f6e74726163742070617373696e672030206f72206d6f726520617267756d656e747320746f20636f6e7374727563746f722e0000000000001c437265617465436f6e74726163745769746843746f72486f7374466e00000001000007d00000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e7465787400000000000100000076417574686f72697a6174696f6e20636f6e7465787420666f7220606372656174655f636f6e74726163746020686f73742066756e6374696f6e2074686174206372656174657320610a6e657720636f6e7472616374206f6e20626568616c66206f6620617574686f72697a657220616464726573732e0000000000000000001b437265617465436f6e7472616374486f7374466e436f6e746578740000000002000000000000000a65786563757461626c650000000007d000000012436f6e747261637445786563757461626c650000000000000000000473616c74000003ee0000002000000001000000d6417574686f72697a6174696f6e20636f6e7465787420666f7220606372656174655f636f6e74726163746020686f73742066756e6374696f6e2074686174206372656174657320610a6e657720636f6e7472616374206f6e20626568616c66206f6620617574686f72697a657220616464726573732e0a54686973206973207468652073616d652061732060437265617465436f6e7472616374486f7374466e436f6e74657874602c2062757420616c736f206861730a636f6e747261637420636f6e7374727563746f7220617267756d656e74732e0000000000000000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e746578740000000000030000000000000010636f6e7374727563746f725f61726773000003ea00000000000000000000000a65786563757461626c650000000007d000000012436f6e747261637445786563757461626c650000000000000000000473616c74000003ee000000200000000200000000000000000000000a45786563757461626c650000000000030000000100000000000000045761736d00000001000003ee0000002000000000000000000000000c5374656c6c617241737365740000000000000000000000074163636f756e7400009f071c636f6e74726163747370656376302e727373646b2e67726170687630537047725601000285570041dc7eb7227074b6b4089f17a7b3b0df31fed6c3be5dcee22cc095a2c0000053704772560100001aaab3c2907e9fa91bc8d528dd2544f6af36637d5154fe0fc1af4f0d8e1cd0fb00005370477256010000bf0f6a4ba3091fc87cb7b87b3a32a7381a1889c461ab6d215293148bb7768fe100005370477256010000ef791d48c06a404eca034a077941263d129f66aa5c3ab84846935b06ee665d84000053704772560100009471b56985321f5a4d308fb3fa46f64af3aa1eee7287a1d689aeb5df155540fe000185570041dc7eb7227074b6b4089f17a7b3b0df31fed6c3be5dcee22cc095a2c05370477256010002a34acff744930b425d95ebfe03798365355c16eb944e65e658771f26f7c070540003f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec15e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e73940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af5370477256010002f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec00005370477256010002b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc000053704772560100029e29488ef0017b7bce9f644f0e44c02c0fe8ee278435729feb60d012481796670002f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec554c7144d3fa3a1f0ca5b704e5488b914a9e0f657f9f5bdb4723c76fb0f4cfe65370477256010002554c7144d3fa3a1f0ca5b704e5488b914a9e0f657f9f5bdb4723c76fb0f4cfe600039e29488ef0017b7bce9f644f0e44c02c0fe8ee278435729feb60d0124817966715e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e73940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af537047725601000215e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e0001b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc537047725601000273940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af0001b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc53704772560100024c7c7b0df4f21aa8f69831e24bcb82344ee697eddfc21c636bd6ce579c78101e0000001e11636f6e7472616374656e766d6574617630000000000000001a00000000004f0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e39312e3000000000000000000012727373646b5f737065635f7368616b696e6700000000000132000000" } }, "ext": "v0" diff --git a/soroban-spec-markers/Cargo.toml b/soroban-spec-markers/Cargo.toml new file mode 100644 index 000000000..c833a3031 --- /dev/null +++ b/soroban-spec-markers/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "soroban-spec-markers" +description = "Soroban contract spec marker wire-format helpers." +homepage = "https://github.com/stellar/rs-soroban-sdk" +repository = "https://github.com/stellar/rs-soroban-sdk" +authors = ["Stellar Development Foundation "] +readme = "../README.md" +license = "Apache-2.0" +version.workspace = true +edition = "2021" +rust-version.workspace = true + +[dependencies] +sha2 = { version = "0.10.7", default-features = false, optional = true } + +[features] +default = ["alloc", "hash"] +alloc = [] +hash = ["dep:sha2"] diff --git a/soroban-spec-markers/src/lib.rs b/soroban-spec-markers/src/lib.rs new file mode 100644 index 000000000..485690e4f --- /dev/null +++ b/soroban-spec-markers/src/lib.rs @@ -0,0 +1,518 @@ +//! Wire-format helpers for Soroban spec-shaking metadata. +//! +//! This crate owns the byte formats emitted by the Rust SDK and consumed by +//! post-build tooling: +//! +//! - `contractmetav0` keys that opt a contract into spec shaking v2. +//! - `SpEcV1` root markers embedded in reachable contract code. +//! - `SpGrV` graph records emitted into the removable +//! `contractspecv0.rssdk.graphv0` sidecar custom section. +//! +//! It does not implement reachability analysis, Wasm scanning, or spec +//! filtering. Those live in `soroban-spec`. + +#![no_std] + +#[cfg(feature = "alloc")] +extern crate alloc; + +#[cfg(feature = "hash")] +use sha2::{Digest, Sha256}; + +#[cfg(feature = "alloc")] +use alloc::vec::Vec; + +/// The contract meta key that indicates the spec shaking version. +pub const META_KEY: &str = "rssdk_spec_shaking"; + +/// The meta value for spec shaking version 2. +pub const META_VALUE_V2: &str = "2"; + +/// Length of a full SHA256-based spec ID. +pub const SPEC_ID_LEN: usize = 32; + +/// A stable identity for a spec entry. +pub type SpecId = [u8; SPEC_ID_LEN]; + +/// Magic bytes that identify a root spec marker: `SpEcV1`. +pub const MARKER_MAGIC: [u8; 6] = *b"SpEcV1"; + +/// Number of spec ID bytes stored after [`MARKER_MAGIC`]. +pub const MARKER_HASH_LEN: usize = 8; + +/// Total length of a spec marker. +pub const MARKER_LEN: usize = 14; + +/// A spec marker that identifies a spec entry by a truncated spec ID. +pub type Marker = [u8; MARKER_LEN]; + +/// Generates a stable identity for spec entry XDR bytes. +#[cfg(feature = "hash")] +pub fn generate_spec_id_for_xdr(spec_entry_xdr: &[u8]) -> SpecId { + Sha256::digest(spec_entry_xdr).into() +} + +/// Generates a spec marker for spec entry XDR bytes. +#[cfg(feature = "hash")] +pub fn generate_marker_for_xdr(spec_entry_xdr: &[u8]) -> Marker { + let hash = generate_spec_id_for_xdr(spec_entry_xdr); + [ + MARKER_MAGIC[0], + MARKER_MAGIC[1], + MARKER_MAGIC[2], + MARKER_MAGIC[3], + MARKER_MAGIC[4], + MARKER_MAGIC[5], + hash[0], + hash[1], + hash[2], + hash[3], + hash[4], + hash[5], + hash[6], + hash[7], + ] +} + +/// A decoded root marker. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct DecodedMarker { + /// First 8 bytes of `SHA256(spec_entry_xdr)`. + pub spec_id_prefix: [u8; MARKER_HASH_LEN], +} + +/// Error returned when decoding a root marker. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum DecodeMarkerError { + TruncatedMarker, + InvalidMagic, +} + +/// Decodes a root marker from the start of `data`. +pub fn decode_marker(data: &[u8]) -> Result { + if data.len() < MARKER_LEN { + return Err(DecodeMarkerError::TruncatedMarker); + } + + if !data.starts_with(&MARKER_MAGIC) { + return Err(DecodeMarkerError::InvalidMagic); + } + + let mut spec_id_prefix = [0; MARKER_HASH_LEN]; + spec_id_prefix.copy_from_slice(&data[MARKER_MAGIC.len()..MARKER_LEN]); + Ok(DecodedMarker { spec_id_prefix }) +} + +/// The custom section containing removable spec graph records. +pub const GRAPH_SECTION: &str = "contractspecv0.rssdk.graphv0"; + +/// Magic bytes at the start of each removable spec graph record. +pub const GRAPH_RECORD_MAGIC: [u8; 5] = *b"SpGrV"; + +/// Version of the removable spec graph record format. +pub const GRAPH_RECORD_VERSION: u8 = 1; + +/// Length of a spec graph record header before referenced spec IDs. +pub const GRAPH_RECORD_HEADER_LEN: usize = 42; + +/// Graph record kind for a contract function spec entry. +pub const GRAPH_RECORD_KIND_FUNCTION: u16 = 0; + +/// Graph record kind for a contract event spec entry. +pub const GRAPH_RECORD_KIND_EVENT: u16 = 1; + +/// Graph record kind for a UDT spec entry. +pub const GRAPH_RECORD_KIND_UDT: u16 = 2; + +/// The kind of spec entry represented by a spec graph record. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum SpecGraphEntryKind { + Function, + Event, + Udt, +} + +impl SpecGraphEntryKind { + /// Converts a graph record kind value into an enum variant. + pub const fn from_u16(value: u16) -> Option { + match value { + GRAPH_RECORD_KIND_FUNCTION => Some(Self::Function), + GRAPH_RECORD_KIND_EVENT => Some(Self::Event), + GRAPH_RECORD_KIND_UDT => Some(Self::Udt), + _ => None, + } + } + + /// Converts an enum variant into a graph record kind value. + pub const fn to_u16(self) -> u16 { + match self { + Self::Function => GRAPH_RECORD_KIND_FUNCTION, + Self::Event => GRAPH_RECORD_KIND_EVENT, + Self::Udt => GRAPH_RECORD_KIND_UDT, + } + } +} + +/// Returns the encoded byte length for a spec graph record with `ref_count` references. +pub const fn graph_record_len(ref_count: usize) -> usize { + GRAPH_RECORD_HEADER_LEN + ref_count * SPEC_ID_LEN +} + +/// Generates an encoded removable spec graph record in const contexts. +/// +/// This is a `const fn` rather than a fully baked byte literal because SDK macros emit graph +/// records before every referenced UDT's exact spec ID is known. When `derive_*` expands for type +/// `Foo`, it knows `Foo`'s own spec XDR and can hash it, but referenced UDTs such as `Bar` or +/// `Baz` may be defined elsewhere, possibly in another crate. The macro therefore emits each ref +/// as a trait-associated constant expression like `::SPEC_TYPE_ID` and lets +/// const-eval resolve the final 32-byte IDs after all impls are in scope. +pub const fn encode_graph_record( + kind: u16, + spec_id: SpecId, + refs: [SpecId; N], +) -> [u8; LEN] { + assert!(N <= u16::MAX as usize); + assert!(LEN == graph_record_len(N)); + + let mut record = [0; LEN]; + + record[0] = GRAPH_RECORD_MAGIC[0]; + record[1] = GRAPH_RECORD_MAGIC[1]; + record[2] = GRAPH_RECORD_MAGIC[2]; + record[3] = GRAPH_RECORD_MAGIC[3]; + record[4] = GRAPH_RECORD_MAGIC[4]; + record[5] = GRAPH_RECORD_VERSION; + record[6] = (kind >> 8) as u8; + record[7] = kind as u8; + + let mut i = 0; + while i < SPEC_ID_LEN { + record[8 + i] = spec_id[i]; + i += 1; + } + + let ref_count = N as u16; + record[40] = (ref_count >> 8) as u8; + record[41] = ref_count as u8; + + let mut ref_index = 0; + while ref_index < N { + let mut byte_index = 0; + while byte_index < SPEC_ID_LEN { + record[GRAPH_RECORD_HEADER_LEN + ref_index * SPEC_ID_LEN + byte_index] = + refs[ref_index][byte_index]; + byte_index += 1; + } + ref_index += 1; + } + + record +} + +/// Generates an encoded removable spec graph record. +/// +/// # Panics +/// +/// Panics if `refs` contains more than `u16::MAX` entries. +#[cfg(feature = "alloc")] +pub fn generate_graph_record( + kind: SpecGraphEntryKind, + spec_id: SpecId, + refs: &[SpecId], +) -> Vec { + assert!( + refs.len() <= u16::MAX as usize, + "spec graph record cannot encode more than u16::MAX refs" + ); + + let mut bytes = Vec::with_capacity(graph_record_len(refs.len())); + bytes.extend_from_slice(&GRAPH_RECORD_MAGIC); + bytes.push(GRAPH_RECORD_VERSION); + bytes.extend_from_slice(&kind.to_u16().to_be_bytes()); + bytes.extend_from_slice(&spec_id); + bytes.extend_from_slice(&(refs.len() as u16).to_be_bytes()); + for ref_id in refs { + bytes.extend_from_slice(ref_id); + } + bytes +} + +/// A decoded removable spec graph record. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct DecodedGraphRecord<'a> { + pub kind: SpecGraphEntryKind, + pub spec_id: SpecId, + refs: &'a [u8], + encoded_len: usize, +} + +impl<'a> DecodedGraphRecord<'a> { + /// Returns the byte length consumed by this record. + pub const fn encoded_len(&self) -> usize { + self.encoded_len + } + + /// Returns the number of referenced spec IDs in this record. + pub const fn ref_count(&self) -> usize { + self.refs.len() / SPEC_ID_LEN + } + + /// Iterates over referenced spec IDs. + pub const fn refs(&self) -> GraphRecordRefs<'a> { + GraphRecordRefs { bytes: self.refs } + } +} + +/// Iterator over graph record references. +#[derive(Clone, Debug)] +pub struct GraphRecordRefs<'a> { + bytes: &'a [u8], +} + +impl Iterator for GraphRecordRefs<'_> { + type Item = SpecId; + + fn next(&mut self) -> Option { + if self.bytes.len() < SPEC_ID_LEN { + return None; + } + + let (id_bytes, rest) = self.bytes.split_at(SPEC_ID_LEN); + self.bytes = rest; + + let mut id = [0; SPEC_ID_LEN]; + id.copy_from_slice(id_bytes); + Some(id) + } + + fn size_hint(&self) -> (usize, Option) { + let len = self.len(); + (len, Some(len)) + } +} + +impl ExactSizeIterator for GraphRecordRefs<'_> { + fn len(&self) -> usize { + self.bytes.len() / SPEC_ID_LEN + } +} + +/// Error returned when decoding a graph record. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum DecodeGraphRecordError { + TruncatedHeader, + InvalidMagic, + UnsupportedVersion { version: u8 }, + InvalidKind { kind: u16 }, + TruncatedRefs, +} + +/// Decodes a removable spec graph record from the start of `data`. +pub fn decode_graph_record(data: &[u8]) -> Result, DecodeGraphRecordError> { + if data.len() < GRAPH_RECORD_HEADER_LEN { + return Err(DecodeGraphRecordError::TruncatedHeader); + } + + if !data.starts_with(&GRAPH_RECORD_MAGIC) { + return Err(DecodeGraphRecordError::InvalidMagic); + } + + if data[5] != GRAPH_RECORD_VERSION { + return Err(DecodeGraphRecordError::UnsupportedVersion { version: data[5] }); + } + + let kind = u16::from_be_bytes([data[6], data[7]]); + let Some(kind) = SpecGraphEntryKind::from_u16(kind) else { + return Err(DecodeGraphRecordError::InvalidKind { kind }); + }; + + let mut spec_id = [0; SPEC_ID_LEN]; + spec_id.copy_from_slice(&data[8..40]); + + let ref_count = u16::from_be_bytes([data[40], data[41]]) as usize; + let Some(refs_len) = ref_count.checked_mul(SPEC_ID_LEN) else { + return Err(DecodeGraphRecordError::TruncatedRefs); + }; + let Some(record_len) = GRAPH_RECORD_HEADER_LEN.checked_add(refs_len) else { + return Err(DecodeGraphRecordError::TruncatedRefs); + }; + if data.len() < record_len { + return Err(DecodeGraphRecordError::TruncatedRefs); + } + + Ok(DecodedGraphRecord { + kind, + spec_id, + refs: &data[GRAPH_RECORD_HEADER_LEN..record_len], + encoded_len: record_len, + }) +} + +#[cfg(test)] +extern crate std; + +#[cfg(test)] +mod tests { + use super::*; + + #[cfg(feature = "hash")] + #[test] + fn marker_generation_has_stable_bytes() { + let marker = generate_marker_for_xdr(b"hello world"); + assert_eq!(marker, *b"SpEcV1\xb9\x4d\x27\xb9\x93\x4d\x3e\x08"); + } + + #[test] + fn marker_decode_reads_prefix() { + let marker = *b"SpEcV1\x01\x02\x03\x04\x05\x06\x07\x08"; + let decoded = decode_marker(&marker).unwrap(); + + assert_eq!(decoded.spec_id_prefix, marker[6..14]); + } + + #[test] + fn marker_decode_rejects_truncated_marker() { + assert_eq!( + decode_marker(b"SpEcV1\x01\x02\x03").unwrap_err(), + DecodeMarkerError::TruncatedMarker + ); + } + + #[test] + fn marker_decode_rejects_invalid_magic() { + let marker = *b"NoEcV1\x01\x02\x03\x04\x05\x06\x07\x08"; + + assert_eq!( + decode_marker(&marker).unwrap_err(), + DecodeMarkerError::InvalidMagic + ); + } + + #[test] + fn graph_record_kind_rejects_out_of_range_value() { + assert_eq!(SpecGraphEntryKind::from_u16(3), None); + } + + #[test] + fn graph_record_encode_has_stable_bytes() { + const LEN: usize = graph_record_len(2); + let spec_id = [1u8; SPEC_ID_LEN]; + let refs = [[2u8; SPEC_ID_LEN], [3u8; SPEC_ID_LEN]]; + let record = + encode_graph_record::(SpecGraphEntryKind::Event.to_u16(), spec_id, refs); + + assert_eq!(record.len(), graph_record_len(refs.len())); + assert_eq!(&record[0..5], GRAPH_RECORD_MAGIC.as_slice()); + assert_eq!(record[5], GRAPH_RECORD_VERSION); + assert_eq!( + u16::from_be_bytes([record[6], record[7]]), + GRAPH_RECORD_KIND_EVENT + ); + assert_eq!(&record[8..40], spec_id.as_slice()); + assert_eq!( + u16::from_be_bytes([record[40], record[41]]), + refs.len() as u16 + ); + assert_eq!(&record[42..74], refs[0].as_slice()); + assert_eq!(&record[74..106], refs[1].as_slice()); + } + + #[cfg(feature = "alloc")] + #[test] + fn graph_record_const_encoder_matches_vec_encoder() { + const LEN: usize = graph_record_len(2); + let spec_id = [4u8; SPEC_ID_LEN]; + let refs = [[5u8; SPEC_ID_LEN], [6u8; SPEC_ID_LEN]]; + + let const_record = + encode_graph_record::(SpecGraphEntryKind::Udt.to_u16(), spec_id, refs); + let vec_record = generate_graph_record(SpecGraphEntryKind::Udt, spec_id, &refs); + + assert_eq!(const_record.as_slice(), vec_record.as_slice()); + } + + #[test] + fn graph_record_decode_roundtrips() { + const LEN: usize = graph_record_len(2); + let spec_id = [7u8; SPEC_ID_LEN]; + let refs = [[8u8; SPEC_ID_LEN], [9u8; SPEC_ID_LEN]]; + let record = + encode_graph_record::(SpecGraphEntryKind::Function.to_u16(), spec_id, refs); + + let decoded = decode_graph_record(&record).unwrap(); + + assert_eq!(decoded.kind, SpecGraphEntryKind::Function); + assert_eq!(decoded.spec_id, spec_id); + assert_eq!(decoded.encoded_len(), record.len()); + let mut decoded_refs = decoded.refs(); + assert_eq!(decoded_refs.next(), Some(refs[0])); + assert_eq!(decoded_refs.next(), Some(refs[1])); + assert_eq!(decoded_refs.next(), None); + } + + #[test] + fn graph_record_decode_rejects_truncated_header() { + assert_eq!( + decode_graph_record(&[0u8; GRAPH_RECORD_HEADER_LEN - 1]).unwrap_err(), + DecodeGraphRecordError::TruncatedHeader + ); + } + + #[test] + fn graph_record_decode_rejects_invalid_magic() { + let record = [0u8; GRAPH_RECORD_HEADER_LEN]; + + assert_eq!( + decode_graph_record(&record).unwrap_err(), + DecodeGraphRecordError::InvalidMagic + ); + } + + #[test] + fn graph_record_decode_rejects_unsupported_version() { + const LEN: usize = graph_record_len(0); + let mut record = encode_graph_record::( + SpecGraphEntryKind::Function.to_u16(), + [1u8; SPEC_ID_LEN], + [], + ); + record[5] = GRAPH_RECORD_VERSION + 1; + + assert_eq!( + decode_graph_record(&record).unwrap_err(), + DecodeGraphRecordError::UnsupportedVersion { version: record[5] } + ); + } + + #[test] + fn graph_record_decode_rejects_invalid_kind() { + const LEN: usize = graph_record_len(0); + let mut record = encode_graph_record::( + SpecGraphEntryKind::Function.to_u16(), + [1u8; SPEC_ID_LEN], + [], + ); + record[6] = 0xff; + record[7] = 0xff; + + assert_eq!( + decode_graph_record(&record).unwrap_err(), + DecodeGraphRecordError::InvalidKind { kind: u16::MAX } + ); + } + + #[test] + fn graph_record_decode_rejects_truncated_refs() { + const LEN: usize = graph_record_len(1); + let record = encode_graph_record::( + SpecGraphEntryKind::Function.to_u16(), + [1u8; SPEC_ID_LEN], + [[2u8; SPEC_ID_LEN]], + ); + + assert_eq!( + decode_graph_record(&record[..record.len() - 1]).unwrap_err(), + DecodeGraphRecordError::TruncatedRefs + ); + } +} diff --git a/soroban-spec-rust/src/lib.rs b/soroban-spec-rust/src/lib.rs index 9d0ee2a76..a8a05b9f5 100644 --- a/soroban-spec-rust/src/lib.rs +++ b/soroban-spec-rust/src/lib.rs @@ -200,6 +200,12 @@ mod test { #[soroban_sdk::contractclient(name = "Client")] pub trait Contract { fn add(env: soroban_sdk::Env, a: UdtEnum, b: UdtEnum) -> i64; + fn recursive(env: soroban_sdk::Env, a: UdtRecursive) -> Option; + fn recursive_enum( + env: soroban_sdk::Env, + a: RecursiveEnum, + key: u32, + ) -> Result, soroban_sdk::Error>; } #[soroban_sdk::contracttype(export = false)] #[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)] @@ -213,6 +219,44 @@ pub struct UdtStruct { } #[soroban_sdk::contracttype(export = false)] #[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)] +pub struct UdtRecursive { + pub a: soroban_sdk::Symbol, + pub b: soroban_sdk::Vec, +} +#[soroban_sdk::contracttype(export = false)] +#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)] +pub struct RecursiveToEnum { + pub a: soroban_sdk::Symbol, + pub b: soroban_sdk::Map, +} +#[soroban_sdk::contracttype(export = false)] +#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)] +pub struct ContractContext { + pub args: soroban_sdk::Vec, + pub contract: soroban_sdk::Address, + pub fn_name: soroban_sdk::Symbol, +} +#[soroban_sdk::contracttype(export = false)] +#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)] +pub struct SubContractInvocation { + pub context: ContractContext, + pub sub_invocations: soroban_sdk::Vec, +} +#[soroban_sdk::contracttype(export = false)] +#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)] +pub struct CreateContractHostFnContext { + pub executable: ContractExecutable, + pub salt: soroban_sdk::BytesN<32>, +} +#[soroban_sdk::contracttype(export = false)] +#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)] +pub struct CreateContractWithConstructorHostFnContext { + pub constructor_args: soroban_sdk::Vec, + pub executable: ContractExecutable, + pub salt: soroban_sdk::BytesN<32>, +} +#[soroban_sdk::contracttype(export = false)] +#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)] pub enum UdtEnum { UdtA, UdtB(UdtStruct), @@ -220,6 +264,38 @@ pub enum UdtEnum { UdtD(UdtTuple), } #[soroban_sdk::contracttype(export = false)] +#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)] +pub enum RecursiveEnum { + NotRecursive, + Recursive(RecursiveToEnum), +} +#[soroban_sdk::contracttype(export = false)] +#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)] +pub enum Context { + Contract(ContractContext), + CreateContractHostFn(CreateContractHostFnContext), + CreateContractWithCtorHostFn(CreateContractWithConstructorHostFnContext), +} +#[soroban_sdk::contracttype(export = false)] +#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)] +pub enum ContractExecutable { + Wasm(soroban_sdk::BytesN<32>), +} +#[soroban_sdk::contracttype(export = false)] +#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)] +pub enum InvokerContractAuthEntry { + Contract(SubContractInvocation), + CreateContractHostFn(CreateContractHostFnContext), + CreateContractWithCtorHostFn(CreateContractWithConstructorHostFnContext), +} +#[soroban_sdk::contracttype(export = false)] +#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)] +pub enum Executable { + Wasm(soroban_sdk::BytesN<32>), + StellarAsset, + Account, +} +#[soroban_sdk::contracttype(export = false)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] pub enum UdtEnum2 { A = 10, diff --git a/soroban-spec/Cargo.toml b/soroban-spec/Cargo.toml index d74621bb6..e7468103d 100644 --- a/soroban-spec/Cargo.toml +++ b/soroban-spec/Cargo.toml @@ -11,11 +11,11 @@ edition = "2021" rust-version.workspace = true [dependencies] +soroban-spec-markers = { workspace = true, features = ["alloc", "hash"] } stellar-xdr = { workspace = true, features = ["curr", "std", "serde"] } base64 = "0.22.1" thiserror = "1.0.32" wasmparser = "0.116.1" -sha2 = "0.10.7" [dev-dependencies] pretty_assertions = "1.2.1" diff --git a/soroban-spec/src/lib.rs b/soroban-spec/src/lib.rs index 9f454f1f2..a048838fc 100644 --- a/soroban-spec/src/lib.rs +++ b/soroban-spec/src/lib.rs @@ -1,2 +1,3 @@ pub mod read; pub mod shaking; +pub mod strip; diff --git a/soroban-spec/src/shaking.rs b/soroban-spec/src/shaking.rs index 7eba0a4d7..baa43ca9a 100644 --- a/soroban-spec/src/shaking.rs +++ b/soroban-spec/src/shaking.rs @@ -3,53 +3,158 @@ /// ## Meta /// /// The `contractmetav0` section of a WASM may contain an [`ScMetaV0`] entry -/// with key [`META_KEY`] (`rssdk_spec_shaking`). The value indicates the spec -/// shaking version: +/// with key [`soroban_spec_markers::META_KEY`] (`rssdk_spec_shaking`). The value indicates the +/// spec shaking version: /// /// - Absent or `"1"` — version 1 (no markers, no shaking possible). -/// - `"2"` — version 2, markers are embedded in the data section. +/// - `"2"` — version 2, extra-root markers are embedded in the data section. /// /// Use [`spec_shaking_version_for_meta`] to determine the version from the /// contract's meta entries. /// -/// ## Markers (version 2) +/// ## Markers and spec graph pruning (version 2) /// /// The marker is a byte array in the data section with a distinctive pattern: /// - 6 bytes: "SpEcV1" prefix /// - 8 bytes: first 64 bits of SHA256 hash of the spec entry XDR /// -/// Markers are embedded in conversion/usage functions with a volatile read. When the type is used, -/// the function is called and the marker is included. When the type is unused, the function is -/// DCE'd along with its marker. +/// Markers are embedded for roots that cannot be discovered from the spec alone, currently event +/// publish methods and errors thrown by `panic_with_error!` or `assert_with_error!`. Function input +/// and output roots are discovered directly from the function entries in `contractspecv0`, and UDT +/// reachability is discovered from exact spec IDs in the removable +/// `contractspecv0.rssdk.graphv0` sidecar. When a reachable function, event, or UDT entry +/// references UDTs, its graph record must be present and must resolve those referenced UDTs to +/// exported spec entries. The filter keeps function entries themselves as API roots, but their +/// parameter and return UDTs are only reached through graph records. Exact duplicate spec entries +/// are collapsed during filtering. /// /// Post-processing tools (e.g. stellar-cli) can: /// 1. Scan the WASM data section for "SpEcV1" patterns /// 2. Extract the hash from each marker -/// 3. Match against specs in contractspecv0 section (by hashing each spec) -/// 4. Strip unused specs from contractspecv0 +/// 3. Read the removable sidecar graph +/// 4. Keep marked entries and all functions +/// 5. Walk exact spec-ID references from those roots +/// 6. Strip unused specs from contractspecv0 and drop the sidecar graph /// /// Today markers are only used in contracts written in Rust, leveraging how Rust can eliminate -/// dead code to make the markers a good signal for if a type gets used. It's not known if the -/// same pattern could be used in other languages, and so it is not a general part of the SEP-48 -/// Contract Interface Specification. Markers are just a mechanism used by the Rust soroban-sdk and -/// the stellar-cli to achieve accurately scoped contract specs. -use std::collections::HashSet; +/// dead code to make markers a good signal for whether an event is published or an error is thrown +/// by reachable contract code. It's not known if the same pattern could be used in other languages, +/// and so it is not a general part of the SEP-48 Contract Interface Specification. Markers are just +/// a mechanism used by the Rust soroban-sdk and the stellar-cli to achieve accurately scoped +/// contract specs. +use std::{ + collections::{HashMap, HashSet, VecDeque}, + fmt::Write as _, +}; + +use soroban_spec_markers::{ + decode_graph_record, generate_marker_for_xdr, generate_spec_id_for_xdr, DecodeGraphRecordError, + GRAPH_SECTION, MARKER_LEN, MARKER_MAGIC, META_KEY, META_VALUE_V2, +}; +pub use soroban_spec_markers::{Marker, SpecGraphEntryKind, SpecId}; +use stellar_xdr::curr::{ + Limits, ScMetaEntry, ScSpecEntry, ScSpecTypeDef, ScSpecUdtUnionCaseV0, WriteXdr, +}; +use wasmparser::BinaryReaderError; + +/// A removable sidecar graph record for one spec entry. +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct SpecGraphEntry { + pub kind: SpecGraphEntryKind, + pub refs: Vec, +} -use sha2::{Digest, Sha256}; -use stellar_xdr::curr::{Limits, ScMetaEntry, ScSpecEntry, WriteXdr}; +/// Removable sidecar graph data keyed by spec entry ID. +#[derive(Clone, Debug, Default, Eq, PartialEq)] +pub struct SpecGraph { + pub entries: HashMap, +} -/// The contract meta key that indicates the spec shaking version. -/// -/// Stored in the `contractmetav0` section as an [`ScMetaV0`] entry. -pub const META_KEY: &str = "rssdk_spec_shaking"; +impl SpecGraph { + /// Inserts a graph entry, merging refs for duplicate records with the same spec ID. + /// + /// If a duplicate record has a different kind, the first kind is retained; the mismatch is + /// reported later when the graph is validated against the reachable spec entry. + pub fn insert(&mut self, spec_id: SpecId, entry: SpecGraphEntry) { + let existing = self.entries.entry(spec_id).or_insert(SpecGraphEntry { + kind: entry.kind, + refs: Vec::new(), + }); + for ref_id in entry.refs { + if !existing.refs.contains(&ref_id) { + existing.refs.push(ref_id); + } + } + } -/// The meta value for spec shaking version 2. -pub const META_VALUE_V2: &str = "2"; + /// Builds a [`SpecGraph`] from a sequence of `(entry, kind, refs)` tuples. + /// + /// Each tuple becomes one record keyed by the entry's spec ID, with `refs` resolved to spec + /// IDs by hashing each referenced entry. Useful for tests and for synthesizing a graph that + /// mirrors what the SDK macros emit at compile time. + pub fn from_records<'a, I>(records: I) -> Self + where + I: IntoIterator)>, + { + let mut graph = Self::default(); + for (entry, kind, refs) in records { + let spec_id = generate_spec_id_for_entry(entry); + let refs = refs.into_iter().map(generate_spec_id_for_entry).collect(); + graph.insert(spec_id, SpecGraphEntry { kind, refs }); + } + graph + } +} + +#[derive(Debug, thiserror::Error)] +pub enum SpecShakingError { + #[error("reading wasm")] + ReadWasm(BinaryReaderError), + #[error("invalid spec graph record magic at offset {offset}")] + InvalidMagic { offset: usize }, + #[error("unsupported spec graph record version {version} at offset {offset}")] + UnsupportedVersion { offset: usize, version: u8 }, + #[error("invalid spec graph record kind {kind} at offset {offset}")] + InvalidKind { offset: usize, kind: u16 }, + #[error("truncated spec graph record at offset {offset}")] + TruncatedRecord { offset: usize }, + #[error("missing spec graph entry for {entry}")] + MissingGraphEntry { spec_id: SpecId, entry: String }, + #[error("missing graph reference from {entry} to UDT {type_name}")] + MissingGraphReference { + spec_id: SpecId, + entry: String, + type_name: String, + }, + #[error("graph reference from {entry} to UDT {type_name} has unknown spec id {ref_spec_id} and does not match any spec entry")] + MissingReferencedSpecEntry { + spec_id: SpecId, + entry: String, + type_name: String, + ref_id: SpecId, + ref_spec_id: String, + }, + #[error("graph reference from {entry} to UDT {type_name} resolved to {ref_entry}, which is not a UDT spec entry")] + ReferencedSpecEntryNotUdt { + spec_id: SpecId, + entry: String, + type_name: String, + ref_id: SpecId, + ref_entry: String, + }, + #[error("spec graph entry for {entry} has kind {actual:?}, expected {expected:?}")] + GraphEntryKindMismatch { + spec_id: SpecId, + entry: String, + expected: SpecGraphEntryKind, + actual: SpecGraphEntryKind, + }, +} /// Returns the spec shaking version indicated by the contract meta entries. /// /// Looks for an [`ScMetaV0`] entry with key [`META_KEY`]. Returns: -/// - `2` if the value is [`META_VALUE_V2`] (`"2"`). +/// - `2` if the value is [`soroban_spec_markers::META_VALUE_V2`] (`"2"`). /// - `1` otherwise (absent or any other value). pub fn spec_shaking_version_for_meta(meta: &[ScMetaEntry]) -> u32 { for entry in meta { @@ -65,24 +170,17 @@ pub fn spec_shaking_version_for_meta(meta: &[ScMetaEntry]) -> u32 { 1 } -/// Magic bytes that identify a spec marker: `SpEcV1` -const MAGIC: &[u8; 6] = b"SpEcV1"; - -/// Total length of a spec marker (6-byte prefix + 8-byte hash). -const LEN: usize = 14; - -/// A spec marker that identifies a spec entry. +/// Generates a stable identity for a spec entry. +/// +/// # Panics /// -/// Format: "SpEcV1" prefix (6 bytes) + first 8 bytes of SHA256 hash = 14 bytes total. -pub type Marker = [u8; LEN]; - -/// Generates a spec marker for spec entry XDR bytes. -pub fn generate_marker_for_xdr(spec_entry_xdr: &[u8]) -> Marker { - let hash: [u8; 32] = Sha256::digest(spec_entry_xdr).into(); - [ - MAGIC[0], MAGIC[1], MAGIC[2], MAGIC[3], MAGIC[4], MAGIC[5], hash[0], hash[1], hash[2], - hash[3], hash[4], hash[5], hash[6], hash[7], - ] +/// Panics if the spec entry cannot be encoded to XDR, which should never happen +/// for valid `ScSpecEntry` values. +pub fn generate_spec_id_for_entry(entry: &ScSpecEntry) -> SpecId { + let xdr_bytes = entry + .to_xdr(Limits::none()) + .expect("XDR encoding should not fail"); + generate_spec_id_for_xdr(&xdr_bytes) } /// Generates a marker for a spec entry. @@ -103,9 +201,9 @@ pub fn generate_marker_for_entry(entry: &ScSpecEntry) -> Marker { /// Finds all spec markers in a WASM binary's data section. /// -/// The SDK embeds markers in the data section for each spec entry that is -/// actually used in the contract. These markers survive dead code elimination -/// only if the corresponding type/event is used. +/// The SDK embeds markers in the data section for each event entry that is +/// actually published by reachable contract code. Function roots are derived +/// from `contractspecv0` and do not need markers. /// /// Marker format: /// - 6 bytes: `SpEcV1` magic @@ -126,66 +224,412 @@ pub fn find_all(wasm_bytes: &[u8]) -> HashSet { markers } +/// Finds removable spec graph records in a WASM binary. +pub fn find_graph(wasm_bytes: &[u8]) -> Result { + let mut graph = SpecGraph::default(); + + for payload in wasmparser::Parser::new(0).parse_all(wasm_bytes) { + let payload = payload.map_err(SpecShakingError::ReadWasm)?; + + if let wasmparser::Payload::CustomSection(section) = payload { + if section.name() == GRAPH_SECTION { + find_graph_in_data(section.data(), &mut graph)?; + } + } + } + + Ok(graph) +} + +fn find_graph_in_data(data: &[u8], graph: &mut SpecGraph) -> Result<(), SpecShakingError> { + let mut offset = 0; + while offset < data.len() { + let record = decode_graph_record(&data[offset..]) + .map_err(|err| spec_graph_decode_error(offset, err))?; + graph.insert( + record.spec_id, + SpecGraphEntry { + kind: record.kind, + refs: record.refs().collect(), + }, + ); + offset += record.encoded_len(); + } + Ok(()) +} + +fn spec_graph_decode_error(offset: usize, err: DecodeGraphRecordError) -> SpecShakingError { + match err { + DecodeGraphRecordError::TruncatedHeader | DecodeGraphRecordError::TruncatedRefs => { + SpecShakingError::TruncatedRecord { offset } + } + DecodeGraphRecordError::InvalidMagic => SpecShakingError::InvalidMagic { offset }, + DecodeGraphRecordError::UnsupportedVersion { version } => { + SpecShakingError::UnsupportedVersion { offset, version } + } + DecodeGraphRecordError::InvalidKind { kind } => { + SpecShakingError::InvalidKind { offset, kind } + } + } +} + /// Finds spec markers in a data segment. fn find_all_in_data(data: &[u8], markers: &mut HashSet) { // Marker size is exactly 14 bytes: 6 (magic) + 8 (hash) - if data.len() < LEN { + if data.len() < MARKER_LEN { return; } - for i in 0..=data.len() - LEN { + for i in 0..=data.len() - MARKER_LEN { // Look for magic bytes - if data[i..].starts_with(MAGIC) { - let marker_end = i + LEN; - let mut marker_bytes = [0u8; LEN]; + if data[i..].starts_with(&MARKER_MAGIC) { + let marker_end = i + MARKER_LEN; + let mut marker_bytes = [0u8; MARKER_LEN]; marker_bytes.copy_from_slice(&data[i..marker_end]); markers.insert(marker_bytes); } } } -/// Filters spec entries based on markers found in the WASM data section. +/// Filters spec entries using function roots, extra-root markers, and UDT graph reachability. /// -/// This removes any spec entries (types, events) that don't have corresponding -/// markers in the data section. The SDK embeds markers for types/events that -/// are actually used, and these markers survive dead code elimination. -/// -/// Functions are always kept as they define the contract's API. +/// Functions are always kept as they define the contract's API. Function input and output UDTs +/// are queued for reachability through the matching function graph record. Non-function entries +/// are kept when their marker is present in the WASM data section, and their referenced UDTs are +/// queued through their graph records. Exact duplicate spec entries are collapsed. /// /// # Arguments /// /// * `entries` - The spec entries to filter -/// * `markers` - Markers extracted from the WASM data section +/// * `markers` - Extra-root markers extracted from the WASM data section +/// * `graph` - The removable sidecar graph /// -/// # Returns +/// # Errors /// -/// Iterator of filtered entries with only used types/events remaining. +/// Returns an error when a reachable entry references a UDT that cannot be resolved through the +/// graph to an exported spec entry. Empty graphs are accepted for contracts whose reachable +/// entries do not reference any UDTs. #[allow(clippy::implicit_hasher)] pub fn filter<'a, I: IntoIterator + 'a>( entries: I, markers: &'a HashSet, -) -> impl Iterator + 'a { - entries.into_iter().filter(move |entry| { - // Always keep functions - they're the contract's API - if matches!(entry, ScSpecEntry::FunctionV0(_)) { - return true; + graph: &'a SpecGraph, +) -> Result + 'a, SpecShakingError> { + let entries = entries.into_iter().collect::>(); + let reachable = reachable_entry_indexes_with_graph(&entries, markers, graph)?; + Ok(filter_reachable_entries(entries, reachable)) +} + +fn filter_reachable_entries( + entries: Vec, + reachable: HashSet, +) -> impl Iterator { + let mut seen_entries = HashSet::>::new(); + entries + .into_iter() + .enumerate() + .filter_map(move |(i, entry)| { + if !reachable.contains(&i) { + return None; + } + let xdr = entry + .to_xdr(Limits::none()) + .expect("XDR encoding should not fail"); + seen_entries.insert(xdr).then_some(entry) + }) +} + +fn reachable_entry_indexes_with_graph( + entries: &[ScSpecEntry], + markers: &HashSet, + graph: &SpecGraph, +) -> Result, SpecShakingError> { + // The sidecar graph is authoritative for UDT reachability when present. Function entries are + // always API roots, but their argument and return UDTs are only queued through the matching + // function graph record. + let mut entry_indexes_by_id = HashMap::>::new(); + let mut udt_names_by_id = HashMap::>::new(); + let mut entry_descriptions_by_id = HashMap::::new(); + for (i, entry) in entries.iter().enumerate() { + let spec_id = generate_spec_id_for_entry(entry); + entry_indexes_by_id.entry(spec_id).or_default().push(i); + entry_descriptions_by_id + .entry(spec_id) + .or_insert_with(|| spec_entry_description(entry)); + if let Some(name) = udt_entry_name(entry) { + udt_names_by_id.entry(spec_id).or_default().push(name); + } + } + + let mut reachable = HashSet::::new(); + let mut pending_spec_ids = VecDeque::::new(); + + for (i, entry) in entries.iter().enumerate() { + match entry { + ScSpecEntry::FunctionV0(_) => { + reachable.insert(i); + add_graph_refs( + entry, + graph, + &entry_indexes_by_id, + &udt_names_by_id, + &entry_descriptions_by_id, + &mut pending_spec_ids, + )?; + } + _ if markers.contains(&generate_marker_for_entry(entry)) => { + reachable.insert(i); + add_graph_refs( + entry, + graph, + &entry_indexes_by_id, + &udt_names_by_id, + &entry_descriptions_by_id, + &mut pending_spec_ids, + )?; + } + _ => {} + } + } + + let mut visited_spec_ids = HashSet::::new(); + while let Some(spec_id) = pending_spec_ids.pop_front() { + if !visited_spec_ids.insert(spec_id) { + continue; + } + + let Some(indices) = entry_indexes_by_id.get(&spec_id) else { + continue; + }; + for &i in indices { + if reachable.insert(i) { + add_graph_refs( + &entries[i], + graph, + &entry_indexes_by_id, + &udt_names_by_id, + &entry_descriptions_by_id, + &mut pending_spec_ids, + )?; + } + } + } + + Ok(reachable) +} + +fn add_graph_refs( + entry: &ScSpecEntry, + graph: &SpecGraph, + entry_indexes_by_id: &HashMap>, + udt_names_by_id: &HashMap>, + entry_descriptions_by_id: &HashMap, + pending_spec_ids: &mut VecDeque, +) -> Result<(), SpecShakingError> { + let spec_id = generate_spec_id_for_entry(entry); + let entry_description = spec_entry_description(entry); + let expected_names = referenced_udt_names(entry); + if expected_names.is_empty() { + return Ok(()); + } + + let Some(record) = graph.entries.get(&spec_id) else { + return Err(SpecShakingError::MissingGraphEntry { + spec_id, + entry: entry_description, + }); + }; + + let expected_kind = graph_entry_kind_for_spec(entry); + if record.kind != expected_kind { + return Err(SpecShakingError::GraphEntryKindMismatch { + spec_id, + entry: entry_description, + expected: expected_kind, + actual: record.kind, + }); + } + + let expected_name_set = expected_names.iter().cloned().collect::>(); + let mut covered_names = HashSet::::new(); + let mut matched_ref_ids = HashSet::::new(); + let mut missing_ref_id = None; + let mut non_udt_ref = None; + + for ref_id in record.refs.iter().copied() { + if let Some(names) = udt_names_by_id.get(&ref_id) { + for name in names { + if expected_name_set.contains(name) { + covered_names.insert(name.clone()); + matched_ref_ids.insert(ref_id); + } + } + } else if !entry_indexes_by_id.contains_key(&ref_id) { + missing_ref_id.get_or_insert(ref_id); + } else if non_udt_ref.is_none() { + let ref_entry = entry_descriptions_by_id + .get(&ref_id) + .cloned() + .expect("referenced spec entry should have a description"); + non_udt_ref = Some((ref_id, ref_entry)); + } + } + + for expected_name in expected_names { + if covered_names.contains(&expected_name) { + continue; } - // For all other entries (types, events), check if marker exists - let marker = generate_marker_for_entry(entry); - markers.contains(&marker) - }) + if let Some((ref_id, ref_entry)) = non_udt_ref { + return Err(SpecShakingError::ReferencedSpecEntryNotUdt { + spec_id, + entry: entry_description, + type_name: expected_name, + ref_id, + ref_entry, + }); + } + if let Some(ref_id) = missing_ref_id { + return Err(SpecShakingError::MissingReferencedSpecEntry { + spec_id, + entry: entry_description, + type_name: expected_name, + ref_id, + ref_spec_id: spec_id_hex(ref_id), + }); + } + return Err(SpecShakingError::MissingGraphReference { + spec_id, + entry: entry_description, + type_name: expected_name, + }); + } + + // Traverse exact refs whose public UDT names are referenced by this entry. Extra graph refs to + // unrelated names are tolerated and intentionally not rooted. + pending_spec_ids.extend(matched_ref_ids); + Ok(()) +} + +fn graph_entry_kind_for_spec(entry: &ScSpecEntry) -> SpecGraphEntryKind { + match entry { + ScSpecEntry::FunctionV0(_) => SpecGraphEntryKind::Function, + ScSpecEntry::EventV0(_) => SpecGraphEntryKind::Event, + ScSpecEntry::UdtStructV0(_) + | ScSpecEntry::UdtUnionV0(_) + | ScSpecEntry::UdtEnumV0(_) + | ScSpecEntry::UdtErrorEnumV0(_) => SpecGraphEntryKind::Udt, + } +} + +fn udt_entry_name(entry: &ScSpecEntry) -> Option { + match entry { + ScSpecEntry::UdtStructV0(s) => Some(s.name.to_utf8_string_lossy()), + ScSpecEntry::UdtUnionV0(u) => Some(u.name.to_utf8_string_lossy()), + ScSpecEntry::UdtEnumV0(e) => Some(e.name.to_utf8_string_lossy()), + ScSpecEntry::UdtErrorEnumV0(e) => Some(e.name.to_utf8_string_lossy()), + _ => None, + } +} + +fn spec_entry_description(entry: &ScSpecEntry) -> String { + match entry { + ScSpecEntry::FunctionV0(f) => format!("function {}", f.name.to_utf8_string_lossy()), + ScSpecEntry::EventV0(e) => format!("event {}", e.name.to_utf8_string_lossy()), + ScSpecEntry::UdtStructV0(s) => format!("UDT {}", s.name.to_utf8_string_lossy()), + ScSpecEntry::UdtUnionV0(u) => format!("UDT {}", u.name.to_utf8_string_lossy()), + ScSpecEntry::UdtEnumV0(e) => format!("UDT {}", e.name.to_utf8_string_lossy()), + ScSpecEntry::UdtErrorEnumV0(e) => format!("UDT {}", e.name.to_utf8_string_lossy()), + } +} + +fn spec_id_hex(spec_id: SpecId) -> String { + let mut hex = String::with_capacity(64); + for byte in spec_id { + write!(&mut hex, "{byte:02x}").expect("writing to String should not fail"); + } + hex +} + +fn referenced_udt_names(entry: &ScSpecEntry) -> Vec { + let mut names = Vec::new(); + match entry { + ScSpecEntry::FunctionV0(f) => { + for input in f.inputs.iter() { + add_type_def_udt_names(&input.type_, &mut names); + } + for output in f.outputs.iter() { + add_type_def_udt_names(output, &mut names); + } + } + ScSpecEntry::EventV0(e) => { + for param in e.params.iter() { + add_type_def_udt_names(¶m.type_, &mut names); + } + } + ScSpecEntry::UdtStructV0(s) => { + for field in s.fields.iter() { + add_type_def_udt_names(&field.type_, &mut names); + } + } + ScSpecEntry::UdtUnionV0(u) => { + for case in u.cases.iter() { + if let ScSpecUdtUnionCaseV0::TupleV0(tuple) = case { + for type_ in tuple.type_.iter() { + add_type_def_udt_names(type_, &mut names); + } + } + } + } + ScSpecEntry::UdtEnumV0(_) | ScSpecEntry::UdtErrorEnumV0(_) => {} + } + names +} + +fn add_type_def_udt_names(type_: &ScSpecTypeDef, names: &mut Vec) { + // Keep this traversal in sync with `soroban-sdk-macros/src/shaking.rs::type_id_refs`. + // This validator mirrors the macro-emitted graph refs for every spec container. + match type_ { + ScSpecTypeDef::Udt(udt) => names.push(udt.name.to_utf8_string_lossy()), + ScSpecTypeDef::Option(option) => add_type_def_udt_names(&option.value_type, names), + ScSpecTypeDef::Result(result) => { + add_type_def_udt_names(&result.ok_type, names); + add_type_def_udt_names(&result.error_type, names); + } + ScSpecTypeDef::Vec(vec) => add_type_def_udt_names(&vec.element_type, names), + ScSpecTypeDef::Map(map) => { + add_type_def_udt_names(&map.key_type, names); + add_type_def_udt_names(&map.value_type, names); + } + ScSpecTypeDef::Tuple(tuple) => { + for type_ in tuple.value_types.iter() { + add_type_def_udt_names(type_, names); + } + } + _ => {} + } } #[cfg(test)] mod tests { use super::*; + use soroban_spec_markers::generate_graph_record; use stellar_xdr::curr::{ - ScMetaV0, ScSpecEntry, ScSpecEventDataFormat, ScSpecEventV0, ScSpecFunctionInputV0, - ScSpecFunctionV0, ScSpecTypeDef, ScSpecUdtEnumCaseV0, ScSpecUdtEnumV0, - ScSpecUdtStructFieldV0, ScSpecUdtStructV0, StringM, VecM, + ScMetaV0, ScSpecEntry, ScSpecEventDataFormat, ScSpecEventParamLocationV0, + ScSpecEventParamV0, ScSpecEventV0, ScSpecFunctionInputV0, ScSpecFunctionV0, ScSpecTypeDef, + ScSpecTypeUdt, ScSpecTypeVec, ScSpecUdtEnumCaseV0, ScSpecUdtEnumV0, ScSpecUdtStructFieldV0, + ScSpecUdtStructV0, ScSpecUdtUnionCaseTupleV0, ScSpecUdtUnionCaseV0, + ScSpecUdtUnionCaseVoidV0, ScSpecUdtUnionV0, StringM, VecM, }; fn make_function(name: &str, input_types: Vec) -> ScSpecEntry { + make_function_with_outputs(name, input_types, vec![]) + } + + fn make_function_with_outputs( + name: &str, + input_types: Vec, + output_types: Vec, + ) -> ScSpecEntry { let inputs = input_types .into_iter() .enumerate() @@ -202,10 +646,22 @@ mod tests { doc: StringM::default(), name: name.try_into().unwrap(), inputs, - outputs: VecM::default(), + outputs: output_types.try_into().unwrap(), + }) + } + + fn udt(name: &str) -> ScSpecTypeDef { + ScSpecTypeDef::Udt(ScSpecTypeUdt { + name: name.try_into().unwrap(), }) } + fn vec_of(type_: ScSpecTypeDef) -> ScSpecTypeDef { + ScSpecTypeDef::Vec(Box::new(ScSpecTypeVec { + element_type: Box::new(type_), + })) + } + fn make_struct(name: &str, field_types: Vec<(&str, ScSpecTypeDef)>) -> ScSpecEntry { let fields = field_types .into_iter() @@ -242,16 +698,52 @@ mod tests { } fn make_event(name: &str) -> ScSpecEntry { + make_event_with_params(name, vec![]) + } + + fn make_event_with_params(name: &str, param_types: Vec) -> ScSpecEntry { ScSpecEntry::EventV0(ScSpecEventV0 { doc: StringM::default(), lib: StringM::default(), name: name.try_into().unwrap(), prefix_topics: VecM::default(), - params: VecM::default(), + params: param_types + .into_iter() + .enumerate() + .map(|(i, type_)| ScSpecEventParamV0 { + location: ScSpecEventParamLocationV0::Data, + doc: StringM::default(), + name: format!("param{i}").try_into().unwrap(), + type_, + }) + .collect::>() + .try_into() + .unwrap(), data_format: ScSpecEventDataFormat::SingleValue, }) } + fn make_union(name: &str, case_types: Vec) -> ScSpecEntry { + ScSpecEntry::UdtUnionV0(ScSpecUdtUnionV0 { + doc: StringM::default(), + lib: StringM::default(), + name: name.try_into().unwrap(), + cases: vec![ + ScSpecUdtUnionCaseV0::VoidV0(ScSpecUdtUnionCaseVoidV0 { + doc: StringM::default(), + name: "Empty".try_into().unwrap(), + }), + ScSpecUdtUnionCaseV0::TupleV0(ScSpecUdtUnionCaseTupleV0 { + doc: StringM::default(), + name: "Value".try_into().unwrap(), + type_: case_types.try_into().unwrap(), + }), + ] + .try_into() + .unwrap(), + }) + } + #[test] fn test_generate_marker_for_xdr() { let spec_xdr = b"some spec xdr bytes"; @@ -268,7 +760,7 @@ mod tests { // Different input produces different marker let different_xdr = b"different spec xdr bytes"; let different_marker = generate_marker_for_xdr(different_xdr); - assert_eq!(&different_marker[..6], MAGIC.as_slice()); + assert_eq!(&different_marker[..6], MARKER_MAGIC.as_slice()); assert_ne!(marker, different_marker); } @@ -284,10 +776,10 @@ mod tests { let marker = generate_marker_for_entry(&entry); // Marker should be 14 bytes (6-byte prefix + 8-byte hash) - assert_eq!(marker.len(), LEN); + assert_eq!(marker.len(), MARKER_LEN); // First 6 bytes should be magic - assert_eq!(&marker[..6], MAGIC.as_slice()); + assert_eq!(&marker[..6], MARKER_MAGIC.as_slice()); // Same entry produces same marker let marker2 = generate_marker_for_entry(&entry); @@ -304,27 +796,6 @@ mod tests { assert_ne!(marker, marker3); } - #[test] - fn test_generate_marker_for_entry_struct() { - let entry = make_struct("MyStruct", vec![("field", ScSpecTypeDef::U32)]); - let marker = generate_marker_for_entry(&entry); - - // Marker should be 14 bytes (6-byte prefix + 8-byte hash) - assert_eq!(marker.len(), LEN); - - // First 6 bytes should be magic - assert_eq!(&marker[..6], MAGIC.as_slice()); - - // Same entry produces same marker - let marker2 = generate_marker_for_entry(&entry); - assert_eq!(marker, marker2); - - // Different entry produces different marker - let entry2 = make_struct("DifferentStruct", vec![("field", ScSpecTypeDef::U32)]); - let marker3 = generate_marker_for_entry(&entry2); - assert_ne!(marker, marker3); - } - #[test] fn test_find_all_in_data() { let entry1 = make_event("Transfer"); @@ -350,71 +821,263 @@ mod tests { } #[test] - fn test_filter_keeps_used_events() { - let transfer_event = make_event("Transfer"); - let mint_event = make_event("Mint"); + fn test_find_graph_in_data() { + let spec_id = [1u8; 32]; + let ref_id = [2u8; 32]; + let data = generate_graph_record(SpecGraphEntryKind::Function, spec_id, &[ref_id]); + + let mut graph = SpecGraph::default(); + find_graph_in_data(&data, &mut graph).unwrap(); + + assert_eq!( + graph.entries.get(&spec_id), + Some(&SpecGraphEntry { + kind: SpecGraphEntryKind::Function, + refs: vec![ref_id], + }) + ); + } + + #[test] + fn test_generate_graph_record_roundtrip() { + let spec_id = [4u8; 32]; + let refs = [[5u8; 32], [6u8; 32], [7u8; 32]]; + let data = generate_graph_record(SpecGraphEntryKind::Udt, spec_id, &refs); + + let mut graph = SpecGraph::default(); + find_graph_in_data(&data, &mut graph).unwrap(); + + assert_eq!( + graph.entries.get(&spec_id), + Some(&SpecGraphEntry { + kind: SpecGraphEntryKind::Udt, + refs: refs.to_vec(), + }) + ); + } + + #[test] + fn test_filter_keeps_marked_events_and_event_param_types() { + let foo = make_function("foo", vec![ScSpecTypeDef::U32]); + let transfer_payload = make_struct("TransferPayload", vec![("amount", ScSpecTypeDef::U32)]); + let transfer_event = make_event_with_params("Transfer", vec![udt("TransferPayload")]); + let unused_payload = make_struct("UnusedPayload", vec![("amount", ScSpecTypeDef::U32)]); + let unused_event = make_event("Unused"); let entries = vec![ - make_function("foo", vec![ScSpecTypeDef::U32]), + foo.clone(), + transfer_payload.clone(), transfer_event.clone(), - mint_event.clone(), - make_event("Unused"), + unused_payload.clone(), + unused_event.clone(), ]; + let graph = SpecGraph::from_records([ + (&foo, SpecGraphEntryKind::Function, vec![]), + (&transfer_payload, SpecGraphEntryKind::Udt, vec![]), + ( + &transfer_event, + SpecGraphEntryKind::Event, + vec![&transfer_payload], + ), + (&unused_payload, SpecGraphEntryKind::Udt, vec![]), + (&unused_event, SpecGraphEntryKind::Event, vec![]), + ]); let mut markers = HashSet::new(); markers.insert(generate_marker_for_entry(&transfer_event)); - markers.insert(generate_marker_for_entry(&mint_event)); - let filtered: Vec<_> = filter(entries, &markers).collect(); + let filtered: Vec<_> = filter(entries, &markers, &graph).unwrap().collect(); - // Should have: 1 function + 2 used events + // Should have: 1 function + 1 used event + 1 event param type. assert_eq!(filtered.len(), 3); - let event_names: Vec<_> = filtered + assert!(filtered.iter().any(|e| matches!(e, ScSpecEntry::EventV0(event) if event.name.to_utf8_string_lossy() == "Transfer"))); + assert!(filtered.iter().any(|e| matches!(e, ScSpecEntry::UdtStructV0(s) if s.name.to_utf8_string_lossy() == "TransferPayload"))); + assert!(!filtered.iter().any(|e| matches!(e, ScSpecEntry::EventV0(event) if event.name.to_utf8_string_lossy() == "Unused"))); + assert!(!filtered.iter().any(|e| matches!(e, ScSpecEntry::UdtStructV0(s) if s.name.to_utf8_string_lossy() == "UnusedPayload"))); + } + + #[test] + fn test_filter_keeps_marked_udt_and_graph_refs() { + let foo = make_function("foo", vec![ScSpecTypeDef::U32]); + let marked = make_struct("Marked", vec![("child", udt("Child"))]); + let child = make_struct("Child", vec![("field", ScSpecTypeDef::U32)]); + let unused = make_struct("Unused", vec![("field", ScSpecTypeDef::U32)]); + + let entries = vec![foo.clone(), marked.clone(), child.clone(), unused.clone()]; + let graph = SpecGraph::from_records([ + (&foo, SpecGraphEntryKind::Function, vec![]), + (&marked, SpecGraphEntryKind::Udt, vec![&child]), + (&child, SpecGraphEntryKind::Udt, vec![]), + (&unused, SpecGraphEntryKind::Udt, vec![]), + ]); + + let mut markers = HashSet::new(); + markers.insert(generate_marker_for_entry(&marked)); + + let filtered: Vec<_> = filter(entries, &markers, &graph).unwrap().collect(); + + assert!(filtered .iter() - .filter_map(|e| { - if let ScSpecEntry::EventV0(event) = e { - Some(event.name.to_utf8_string_lossy()) - } else { - None - } - }) - .collect(); + .any(|e| matches!(e, ScSpecEntry::UdtStructV0(s) if s.name.to_utf8_string_lossy() == "Marked"))); + assert!(filtered.iter().any( + |e| matches!(e, ScSpecEntry::UdtStructV0(s) if s.name.to_utf8_string_lossy() == "Child") + )); + assert!(!filtered + .iter() + .any(|e| matches!(e, ScSpecEntry::UdtStructV0(s) if s.name.to_utf8_string_lossy() == "Unused"))); + } + + #[test] + fn test_filter_accepts_empty_graph_without_udt_refs() { + let entries = vec![make_function("foo", vec![ScSpecTypeDef::U32])]; + let markers = HashSet::new(); + let graph = SpecGraph::default(); - assert!(event_names.contains(&"Transfer".to_string())); - assert!(event_names.contains(&"Mint".to_string())); - assert!(!event_names.contains(&"Unused".to_string())); + let filtered: Vec<_> = filter(entries.clone(), &markers, &graph).unwrap().collect(); + + assert_eq!(filtered, entries); } #[test] - fn test_filter_removes_all_events_if_no_markers() { + fn test_filter_rejects_missing_graph_entry_for_udt_refs() { let entries = vec![ - make_function("foo", vec![ScSpecTypeDef::U32]), - make_event("Transfer"), - make_event("Mint"), + make_function("foo", vec![udt("Input")]), + make_struct("Input", vec![("field", ScSpecTypeDef::U32)]), ]; + let markers = HashSet::new(); + let graph = SpecGraph::default(); + let Err(err) = filter(entries, &markers, &graph) else { + panic!("missing graph entry should be rejected"); + }; + + assert_eq!(err.to_string(), "missing spec graph entry for function foo"); + assert!( + matches!(&err, SpecShakingError::MissingGraphEntry { entry, .. } if entry == "function foo") + ); + } + + #[test] + fn test_filter_rejects_missing_transitive_graph_entry() { + let foo = make_function("foo", vec![udt("Root")]); + let root = make_struct("Root", vec![("leaf", udt("Leaf"))]); + let leaf = make_struct("Leaf", vec![("field", ScSpecTypeDef::U32)]); + let entries = vec![foo.clone(), root.clone(), leaf.clone()]; + let graph = SpecGraph::from_records([(&foo, SpecGraphEntryKind::Function, vec![&root])]); let markers = HashSet::new(); - let filtered: Vec<_> = filter(entries, &markers).collect(); + let Err(err) = filter(entries, &markers, &graph) else { + panic!("missing transitive graph entry should be rejected"); + }; - // Should have: 1 function, 0 events - assert_eq!(filtered.len(), 1); - assert!(matches!(filtered[0], ScSpecEntry::FunctionV0(_))); + assert!(matches!(err, SpecShakingError::MissingGraphEntry { .. })); + } + + #[test] + fn test_filter_rejects_missing_graph_reference() { + let foo = make_function("foo", vec![udt("Input")]); + let input = make_struct("Input", vec![("field", ScSpecTypeDef::U32)]); + let entries = vec![foo.clone(), input]; + let graph = SpecGraph::from_records([(&foo, SpecGraphEntryKind::Function, vec![])]); + let markers = HashSet::new(); + + let Err(err) = filter(entries, &markers, &graph) else { + panic!("missing graph ref should be rejected"); + }; + + assert!(matches!( + err, + SpecShakingError::MissingGraphReference { type_name, .. } if type_name == "Input" + )); + } + + #[test] + fn test_filter_rejects_missing_referenced_spec_entry() { + let foo = make_function("foo", vec![udt("Hidden")]); + // This mirrors a malformed graph record that refers to an exact type ID without a + // matching exported UDT entry in contractspecv0. + let hidden = make_struct("Hidden", vec![("field", ScSpecTypeDef::U32)]); + let hidden_id = generate_spec_id_for_entry(&hidden); + let graph = SpecGraph::from_records([(&foo, SpecGraphEntryKind::Function, vec![&hidden])]); + let markers = HashSet::new(); + + let Err(err) = filter(vec![foo], &markers, &graph) else { + panic!("missing referenced spec entry should be rejected"); + }; + + assert!(err + .to_string() + .starts_with("graph reference from function foo to UDT Hidden has unknown spec id")); + assert!( + matches!(&err, SpecShakingError::MissingReferencedSpecEntry { entry, type_name, ref_id, .. } if entry == "function foo" && type_name == "Hidden" && ref_id == &hidden_id) + ); } #[test] - fn test_filter_removes_all_types_if_no_markers() { + fn test_filter_rejects_referenced_spec_entry_not_udt() { + let foo = make_function("foo", vec![udt("Input")]); + let bar = make_function("bar", vec![ScSpecTypeDef::U32]); + let entries = vec![foo.clone(), bar.clone()]; + let graph = SpecGraph::from_records([(&foo, SpecGraphEntryKind::Function, vec![&bar])]); + let markers = HashSet::new(); + + let Err(err) = filter(entries, &markers, &graph) else { + panic!("non-UDT graph refs should be rejected"); + }; + + assert_eq!( + err.to_string(), + "graph reference from function foo to UDT Input resolved to function bar, which is not a UDT spec entry" + ); + assert!( + matches!(&err, SpecShakingError::ReferencedSpecEntryNotUdt { entry, type_name, ref_entry, .. } if entry == "function foo" && type_name == "Input" && ref_entry == "function bar") + ); + } + + #[test] + fn test_filter_rejects_graph_entry_kind_mismatch() { + let foo = make_function("foo", vec![udt("Input")]); + let input = make_struct("Input", vec![("field", ScSpecTypeDef::U32)]); + let graph = SpecGraph::from_records([(&foo, SpecGraphEntryKind::Event, vec![&input])]); + let markers = HashSet::new(); + + let Err(err) = filter(vec![foo, input], &markers, &graph) else { + panic!("graph entry kind mismatch should be rejected"); + }; + + assert_eq!( + err.to_string(), + "spec graph entry for function foo has kind Event, expected Function" + ); + assert!( + matches!(&err, SpecShakingError::GraphEntryKindMismatch { entry, expected, actual, .. } if entry == "function foo" && expected == &SpecGraphEntryKind::Function && actual == &SpecGraphEntryKind::Event) + ); + } + + #[test] + fn test_filter_removes_all_non_function_entries_without_markers() { + let foo = make_function("foo", vec![ScSpecTypeDef::U32]); + let my_struct = make_struct("MyStruct", vec![("field", ScSpecTypeDef::U32)]); + let my_enum = make_enum("MyEnum"); + let unused_event = make_event("Unused"); + let entries = vec![ - make_function("foo", vec![ScSpecTypeDef::U32]), - make_struct("MyStruct", vec![("field", ScSpecTypeDef::U32)]), - make_enum("MyEnum"), - make_event("Unused"), + foo.clone(), + my_struct.clone(), + my_enum.clone(), + unused_event.clone(), ]; + let graph = SpecGraph::from_records([ + (&foo, SpecGraphEntryKind::Function, vec![]), + (&my_struct, SpecGraphEntryKind::Udt, vec![]), + (&my_enum, SpecGraphEntryKind::Udt, vec![]), + (&unused_event, SpecGraphEntryKind::Event, vec![]), + ]); let markers = HashSet::new(); // No markers - let filtered: Vec<_> = filter(entries, &markers).collect(); + let filtered: Vec<_> = filter(entries, &markers, &graph).unwrap().collect(); // Should have: only functions (always kept), no types or events assert_eq!(filtered.len(), 1); @@ -424,32 +1087,35 @@ mod tests { } #[test] - fn test_filter_keeps_types_with_markers() { - let used_struct = make_struct("UsedStruct", vec![("field", ScSpecTypeDef::U32)]); - let used_enum = make_enum("UsedEnum"); - let used_event = make_event("UsedEvent"); + fn test_filter_keeps_function_referenced_types_without_markers() { + let foo = make_function_with_outputs("foo", vec![udt("Input")], vec![udt("Output")]); + let input = make_struct("Input", vec![("field", ScSpecTypeDef::U32)]); + let output = make_struct("Output", vec![("field", ScSpecTypeDef::U32)]); + let unused_struct = make_struct("UnusedStruct", vec![("field", ScSpecTypeDef::U32)]); + let unused_event = make_event("UnusedEvent"); let entries = vec![ - make_function("foo", vec![ScSpecTypeDef::U32]), - used_struct.clone(), - make_struct("UnusedStruct", vec![("field", ScSpecTypeDef::U32)]), - used_enum.clone(), - make_enum("UnusedEnum"), - used_event.clone(), - make_event("UnusedEvent"), + foo.clone(), + input.clone(), + output.clone(), + unused_struct.clone(), + unused_event.clone(), ]; + let graph = SpecGraph::from_records([ + (&foo, SpecGraphEntryKind::Function, vec![&input, &output]), + (&input, SpecGraphEntryKind::Udt, vec![]), + (&output, SpecGraphEntryKind::Udt, vec![]), + (&unused_struct, SpecGraphEntryKind::Udt, vec![]), + (&unused_event, SpecGraphEntryKind::Event, vec![]), + ]); - let mut markers = HashSet::new(); - markers.insert(generate_marker_for_entry(&used_struct)); - markers.insert(generate_marker_for_entry(&used_enum)); - markers.insert(generate_marker_for_entry(&used_event)); + let markers = HashSet::new(); - let filtered: Vec<_> = filter(entries, &markers).collect(); + let filtered: Vec<_> = filter(entries, &markers, &graph).unwrap().collect(); - // Should have: 1 function + 1 struct + 1 enum + 1 event - assert_eq!(filtered.len(), 4); + // Should have: 1 function + input and output types. + assert_eq!(filtered.len(), 3); - // Check specific entries let struct_names: Vec<_> = filtered .iter() .filter_map(|e| { @@ -460,45 +1126,186 @@ mod tests { } }) .collect(); - assert_eq!(struct_names, vec!["UsedStruct"]); + assert_eq!(struct_names, vec!["Input", "Output"]); + } - let enum_names: Vec<_> = filtered + #[test] + fn test_filter_keeps_transitive_type_refs() { + let foo = make_function("foo", vec![udt("Root")]); + let root = make_struct("Root", vec![("items", vec_of(udt("Leaf")))]); + let leaf = make_struct("Leaf", vec![("field", ScSpecTypeDef::U32)]); + let unused = make_struct("Unused", vec![("field", ScSpecTypeDef::U32)]); + + let entries = vec![foo.clone(), root.clone(), leaf.clone(), unused.clone()]; + let graph = SpecGraph::from_records([ + (&foo, SpecGraphEntryKind::Function, vec![&root]), + (&root, SpecGraphEntryKind::Udt, vec![&leaf]), + (&leaf, SpecGraphEntryKind::Udt, vec![]), + (&unused, SpecGraphEntryKind::Udt, vec![]), + ]); + + let markers = HashSet::new(); + let filtered: Vec<_> = filter(entries, &markers, &graph).unwrap().collect(); + let struct_names: Vec<_> = filtered .iter() .filter_map(|e| { - if let ScSpecEntry::UdtEnumV0(s) = e { + if let ScSpecEntry::UdtStructV0(s) = e { Some(s.name.to_utf8_string_lossy()) } else { None } }) .collect(); - assert_eq!(enum_names, vec!["UsedEnum"]); + assert_eq!(struct_names, vec!["Root", "Leaf"]); + } + + #[test] + fn test_filter_keeps_union_case_refs() { + let foo = make_function("foo", vec![udt("RootUnion")]); + let root_union = make_union("RootUnion", vec![udt("Leaf")]); + let leaf = make_struct("Leaf", vec![("field", ScSpecTypeDef::U32)]); + let unused = make_struct("Unused", vec![("field", ScSpecTypeDef::U32)]); + + let entries = vec![ + foo.clone(), + root_union.clone(), + leaf.clone(), + unused.clone(), + ]; + let graph = SpecGraph::from_records([ + (&foo, SpecGraphEntryKind::Function, vec![&root_union]), + (&root_union, SpecGraphEntryKind::Udt, vec![&leaf]), + (&leaf, SpecGraphEntryKind::Udt, vec![]), + (&unused, SpecGraphEntryKind::Udt, vec![]), + ]); + + let markers = HashSet::new(); + let filtered: Vec<_> = filter(entries, &markers, &graph).unwrap().collect(); + + assert!(filtered.iter().any(|e| matches!(e, ScSpecEntry::UdtUnionV0(u) if u.name.to_utf8_string_lossy() == "RootUnion"))); + assert!(filtered.iter().any( + |e| matches!(e, ScSpecEntry::UdtStructV0(s) if s.name.to_utf8_string_lossy() == "Leaf") + )); + assert!(!filtered.iter().any(|e| matches!(e, ScSpecEntry::UdtStructV0(s) if s.name.to_utf8_string_lossy() == "Unused"))); + } + + #[test] + fn test_filter_removes_exact_duplicate_entries() { + let foo = make_function("foo", vec![udt("Duplicate")]); + let duplicate = make_struct("Duplicate", vec![("field", udt("Child"))]); + let child = make_struct("Child", vec![("field", ScSpecTypeDef::U32)]); + let unused = make_struct("Unused", vec![("field", ScSpecTypeDef::U32)]); - let event_names: Vec<_> = filtered + let entries = vec![ + foo.clone(), + duplicate.clone(), + duplicate.clone(), + child.clone(), + unused.clone(), + ]; + let graph = SpecGraph::from_records([ + (&foo, SpecGraphEntryKind::Function, vec![&duplicate]), + (&duplicate, SpecGraphEntryKind::Udt, vec![&child]), + (&child, SpecGraphEntryKind::Udt, vec![]), + (&unused, SpecGraphEntryKind::Udt, vec![]), + ]); + + let markers = HashSet::new(); + let filtered: Vec<_> = filter(entries, &markers, &graph).unwrap().collect(); + + let duplicate_count = filtered .iter() - .filter_map(|e| { - if let ScSpecEntry::EventV0(s) = e { - Some(s.name.to_utf8_string_lossy()) - } else { - None - } - }) - .collect(); - assert_eq!(event_names, vec!["UsedEvent"]); + .filter(|e| matches!(e, ScSpecEntry::UdtStructV0(s) if s.name.to_utf8_string_lossy() == "Duplicate")) + .count(); + + assert_eq!(duplicate_count, 1); + assert!(filtered.iter().any( + |e| matches!(e, ScSpecEntry::UdtStructV0(s) if s.name.to_utf8_string_lossy() == "Child") + )); + assert!(!filtered.iter().any(|e| matches!(e, ScSpecEntry::UdtStructV0(s) if s.name.to_utf8_string_lossy() == "Unused"))); } #[test] - fn test_spec_shaking_version_absent() { - let meta = vec![]; - assert_eq!(spec_shaking_version_for_meta(&meta), 1); + fn test_filter_disambiguates_duplicate_udt_names() { + let foo = make_function("foo", vec![udt("Duplicate")]); + let duplicate_struct = make_struct("Duplicate", vec![("field", udt("Child"))]); + let duplicate_enum = make_enum("Duplicate"); + let child = make_struct("Child", vec![("field", ScSpecTypeDef::U32)]); + let unused = make_struct("Unused", vec![("field", ScSpecTypeDef::U32)]); + + let entries = vec![ + foo.clone(), + duplicate_struct.clone(), + duplicate_enum.clone(), + child.clone(), + unused.clone(), + ]; + let graph = SpecGraph::from_records([ + (&foo, SpecGraphEntryKind::Function, vec![&duplicate_struct]), + (&duplicate_struct, SpecGraphEntryKind::Udt, vec![&child]), + (&duplicate_enum, SpecGraphEntryKind::Udt, vec![]), + (&child, SpecGraphEntryKind::Udt, vec![]), + (&unused, SpecGraphEntryKind::Udt, vec![]), + ]); + + let markers = HashSet::new(); + let filtered: Vec<_> = filter(entries, &markers, &graph).unwrap().collect(); + + assert!(filtered.iter().any( + |e| matches!(e, ScSpecEntry::UdtStructV0(s) if s.name.to_utf8_string_lossy() == "Duplicate") + )); + assert!(!filtered.iter().any( + |e| matches!(e, ScSpecEntry::UdtEnumV0(s) if s.name.to_utf8_string_lossy() == "Duplicate") + )); + assert!(filtered.iter().any( + |e| matches!(e, ScSpecEntry::UdtStructV0(s) if s.name.to_utf8_string_lossy() == "Child") + )); + assert!(!filtered.iter().any( + |e| matches!(e, ScSpecEntry::UdtStructV0(s) if s.name.to_utf8_string_lossy() == "Unused") + )); } #[test] - fn test_spec_shaking_version_other_keys() { - let meta = vec![ScMetaEntry::ScMetaV0(ScMetaV0 { - key: "rssdkver".try_into().unwrap(), - val: "1.0.0".try_into().unwrap(), - })]; + fn test_filter_keeps_multiple_same_name_refs_from_one_entry() { + let foo = make_function("foo", vec![udt("Duplicate"), udt("Duplicate")]); + let duplicate_struct = make_struct("Duplicate", vec![("field", ScSpecTypeDef::U32)]); + let duplicate_enum = make_enum("Duplicate"); + let unused = make_struct("Unused", vec![("field", ScSpecTypeDef::U32)]); + + let entries = vec![ + foo.clone(), + duplicate_struct.clone(), + duplicate_enum.clone(), + unused.clone(), + ]; + let graph = SpecGraph::from_records([ + ( + &foo, + SpecGraphEntryKind::Function, + vec![&duplicate_struct, &duplicate_enum], + ), + (&duplicate_struct, SpecGraphEntryKind::Udt, vec![]), + (&duplicate_enum, SpecGraphEntryKind::Udt, vec![]), + (&unused, SpecGraphEntryKind::Udt, vec![]), + ]); + + let markers = HashSet::new(); + let filtered: Vec<_> = filter(entries, &markers, &graph).unwrap().collect(); + + assert!(filtered.iter().any( + |e| matches!(e, ScSpecEntry::UdtStructV0(s) if s.name.to_utf8_string_lossy() == "Duplicate") + )); + assert!(filtered.iter().any( + |e| matches!(e, ScSpecEntry::UdtEnumV0(s) if s.name.to_utf8_string_lossy() == "Duplicate") + )); + assert!(!filtered.iter().any( + |e| matches!(e, ScSpecEntry::UdtStructV0(s) if s.name.to_utf8_string_lossy() == "Unused") + )); + } + + #[test] + fn test_spec_shaking_version_absent() { + let meta = vec![]; assert_eq!(spec_shaking_version_for_meta(&meta), 1); } diff --git a/soroban-spec/src/strip.rs b/soroban-spec/src/strip.rs new file mode 100644 index 000000000..27146d0e9 --- /dev/null +++ b/soroban-spec/src/strip.rs @@ -0,0 +1,460 @@ +//! Wasm rewriting helpers for spec shaking. + +use std::io::Cursor; + +use stellar_xdr::curr as stellar_xdr; +use stellar_xdr::{Limited, Limits, ReadXdr, ScMetaEntry, WriteXdr}; +use wasmparser::{BinaryReaderError, Parser, Payload}; + +use crate::{read, shaking}; +use soroban_spec_markers::GRAPH_SECTION; + +const WASM_HEADER: &[u8; 8] = b"\0asm\x01\0\0\0"; +const CUSTOM_SECTION_ID: u8 = 0; +const CONTRACT_SPEC_SECTION: &str = "contractspecv0"; +const CONTRACT_META_SECTION: &str = "contractmetav0"; + +#[derive(thiserror::Error, Debug)] +pub enum ShakeError { + #[error("reading contract spec")] + ReadSpec(read::FromWasmError), + #[error("reading contract meta")] + ReadMeta(BinaryReaderError), + #[error("parsing contract meta")] + ParseMeta(stellar_xdr::Error), + #[error("unsupported spec shaking version {0}, expected 2")] + UnsupportedSpecShakingVersion(u32), + #[error(transparent)] + SpecShaking(#[from] shaking::SpecShakingError), + #[error("encoding contract spec")] + EncodeSpec(stellar_xdr::Error), + #[error("rewriting wasm")] + Rewrite(RewriteError), +} + +#[derive(thiserror::Error, Debug)] +pub enum RewriteError { + #[error("invalid wasm header")] + InvalidHeader, + #[error("invalid wasm varuint32")] + InvalidVarUint32, + #[error("invalid wasm section length")] + InvalidSectionLength, + #[error("invalid custom section name")] + InvalidCustomSectionName(#[source] std::str::Utf8Error), + #[error("contract spec section not found")] + ContractSpecNotFound, +} + +/// Filters `contractspecv0` using spec shaking v2 reachability and removes the sidecar graph. +/// +/// This helper only operates on Wasms whose `contractmetav0` declares +/// `rssdk_spec_shaking = "2"` and whose graph, when needed for reachable UDT references, is valid +/// and complete. Passing a v1, non-Rust, or corrupted v2 contract would make marker scanning or +/// graph traversal ambiguous, so those inputs are rejected before rewriting. +pub fn shake_contract_spec(wasm: &[u8]) -> Result, ShakeError> { + let meta = contract_meta_from_wasm(wasm)?; + let version = shaking::spec_shaking_version_for_meta(&meta); + if version != 2 { + return Err(ShakeError::UnsupportedSpecShakingVersion(version)); + } + + let entries = read::from_wasm(wasm).map_err(ShakeError::ReadSpec)?; + let markers = shaking::find_all(wasm); + let graph = shaking::find_graph(wasm)?; + let filtered = shaking::filter(entries, &markers, &graph)?; + + let mut spec_xdr = Vec::new(); + for entry in filtered { + spec_xdr.extend( + entry + .to_xdr(Limits::none()) + .map_err(ShakeError::EncodeSpec)?, + ); + } + + rewrite_contract_spec(wasm, &spec_xdr).map_err(ShakeError::Rewrite) +} + +fn contract_meta_from_wasm(wasm: &[u8]) -> Result, ShakeError> { + let mut meta = Vec::new(); + for payload in Parser::new(0).parse_all(wasm) { + let payload = payload.map_err(ShakeError::ReadMeta)?; + let Payload::CustomSection(section) = payload else { + continue; + }; + if section.name() != CONTRACT_META_SECTION { + continue; + } + + let cursor = Cursor::new(section.data()); + let entries = ScMetaEntry::read_xdr_iter(&mut Limited::new( + cursor, + Limits { + depth: 500, + len: 0x1000000, + }, + )) + .collect::, _>>() + .map_err(ShakeError::ParseMeta)?; + meta.extend(entries); + } + Ok(meta) +} + +fn rewrite_contract_spec(wasm: &[u8], spec_xdr: &[u8]) -> Result, RewriteError> { + if wasm.len() < WASM_HEADER.len() || &wasm[..WASM_HEADER.len()] != WASM_HEADER { + return Err(RewriteError::InvalidHeader); + } + + let mut out = Vec::with_capacity(wasm.len()); + out.extend_from_slice(WASM_HEADER); + + let mut offset = WASM_HEADER.len(); + let mut wrote_spec = false; + while offset < wasm.len() { + let section_start = offset; + let section_id = wasm[offset]; + offset += 1; + + let (payload_len, payload_offset) = read_var_u32(wasm, offset)?; + offset = payload_offset; + let payload_len = payload_len as usize; + let payload_end = offset + .checked_add(payload_len) + .ok_or(RewriteError::InvalidSectionLength)?; + if payload_end > wasm.len() { + return Err(RewriteError::InvalidSectionLength); + } + + let payload = &wasm[offset..payload_end]; + offset = payload_end; + + if section_id != CUSTOM_SECTION_ID { + out.extend_from_slice(&wasm[section_start..payload_end]); + continue; + } + + let Some(name) = custom_section_name(payload)? else { + out.extend_from_slice(&wasm[section_start..payload_end]); + continue; + }; + + match name { + CONTRACT_SPEC_SECTION => { + if !wrote_spec { + write_custom_section(&mut out, CONTRACT_SPEC_SECTION, spec_xdr)?; + wrote_spec = true; + } + } + GRAPH_SECTION => {} + _ => out.extend_from_slice(&wasm[section_start..payload_end]), + } + } + + if wrote_spec { + Ok(out) + } else { + Err(RewriteError::ContractSpecNotFound) + } +} + +fn custom_section_name(payload: &[u8]) -> Result, RewriteError> { + let Ok((name_len, name_offset)) = read_var_u32(payload, 0) else { + return Ok(None); + }; + let name_len = name_len as usize; + let name_end = name_offset + .checked_add(name_len) + .ok_or(RewriteError::InvalidSectionLength)?; + if name_end > payload.len() { + return Ok(None); + } + std::str::from_utf8(&payload[name_offset..name_end]) + .map(Some) + .map_err(RewriteError::InvalidCustomSectionName) +} + +fn write_custom_section(out: &mut Vec, name: &str, data: &[u8]) -> Result<(), RewriteError> { + out.push(CUSTOM_SECTION_ID); + + let mut payload = Vec::with_capacity(name.len() + data.len() + 5); + write_var_u32(&mut payload, checked_u32(name.len())?); + payload.extend_from_slice(name.as_bytes()); + payload.extend_from_slice(data); + + write_var_u32(out, checked_u32(payload.len())?); + out.extend_from_slice(&payload); + Ok(()) +} + +fn checked_u32(n: usize) -> Result { + n.try_into().map_err(|_| RewriteError::InvalidSectionLength) +} + +fn read_var_u32(bytes: &[u8], mut offset: usize) -> Result<(u32, usize), RewriteError> { + let mut value = 0u32; + for shift in (0..35).step_by(7) { + let byte = *bytes.get(offset).ok_or(RewriteError::InvalidVarUint32)?; + offset += 1; + + let chunk = (byte & 0x7f) as u32; + if shift == 28 && chunk > 0x0f { + return Err(RewriteError::InvalidVarUint32); + } + value |= chunk << shift; + + if byte & 0x80 == 0 { + return Ok((value, offset)); + } + } + Err(RewriteError::InvalidVarUint32) +} + +fn write_var_u32(out: &mut Vec, mut value: u32) { + loop { + let mut byte = (value & 0x7f) as u8; + value >>= 7; + if value != 0 { + byte |= 0x80; + } + out.push(byte); + if value == 0 { + break; + } + } +} + +#[cfg(test)] +mod tests { + use super::{ + shake_contract_spec, write_custom_section, ShakeError, CONTRACT_META_SECTION, + CONTRACT_SPEC_SECTION, WASM_HEADER, + }; + use crate::{read, shaking}; + use soroban_spec_markers::{ + generate_graph_record, SpecGraphEntryKind, GRAPH_SECTION, META_KEY, META_VALUE_V2, + }; + use stellar_xdr::curr::{ + Limits, ScMetaEntry, ScMetaV0, ScSpecEntry, ScSpecFunctionInputV0, ScSpecFunctionV0, + ScSpecTypeDef, ScSpecTypeUdt, ScSpecUdtStructFieldV0, ScSpecUdtStructV0, StringM, WriteXdr, + }; + + fn function_with_type(name: &str, type_: ScSpecTypeDef) -> ScSpecEntry { + ScSpecEntry::FunctionV0(ScSpecFunctionV0 { + doc: StringM::default(), + name: name.try_into().unwrap(), + inputs: vec![ScSpecFunctionInputV0 { + doc: StringM::default(), + name: "arg".try_into().unwrap(), + type_, + }] + .try_into() + .unwrap(), + outputs: vec![].try_into().unwrap(), + }) + } + + fn function_with_udt(name: &str, udt_name: &str) -> ScSpecEntry { + function_with_type( + name, + ScSpecTypeDef::Udt(ScSpecTypeUdt { + name: udt_name.try_into().unwrap(), + }), + ) + } + + fn struct_entry(name: &str, field_name: &str, type_: ScSpecTypeDef) -> ScSpecEntry { + ScSpecEntry::UdtStructV0(ScSpecUdtStructV0 { + doc: StringM::default(), + lib: StringM::default(), + name: name.try_into().unwrap(), + fields: vec![ScSpecUdtStructFieldV0 { + doc: StringM::default(), + name: field_name.try_into().unwrap(), + type_, + }] + .try_into() + .unwrap(), + }) + } + + fn spec_xdr(entries: &[ScSpecEntry]) -> Vec { + let mut xdr = Vec::new(); + for entry in entries { + xdr.extend(entry.to_xdr(Limits::none()).unwrap()); + } + xdr + } + + fn meta_xdr(value: &str) -> Vec { + ScMetaEntry::ScMetaV0(ScMetaV0 { + key: META_KEY.try_into().unwrap(), + val: value.try_into().unwrap(), + }) + .to_xdr(Limits::none()) + .unwrap() + } + + fn v2_meta_xdr() -> Vec { + meta_xdr(META_VALUE_V2) + } + + fn graph_record(entry: &ScSpecEntry, refs: &[ScSpecEntry]) -> Vec { + let ref_ids: Vec<_> = refs + .iter() + .map(shaking::generate_spec_id_for_entry) + .collect(); + generate_graph_record( + SpecGraphEntryKind::Function, + shaking::generate_spec_id_for_entry(entry), + &ref_ids, + ) + } + + fn minimal_wasm(custom_sections: &[(&str, &[u8])]) -> Vec { + let mut wasm = WASM_HEADER.to_vec(); + for (name, data) in custom_sections { + write_custom_section(&mut wasm, name, data).unwrap(); + } + wasm + } + + #[test] + fn test_shake_contract_spec_rewrites_spec_and_removes_sidecar() { + let function = function_with_udt("run", "Shared"); + let used = struct_entry("Shared", "used", ScSpecTypeDef::I32); + let unused_duplicate = struct_entry("Shared", "unused", ScSpecTypeDef::I64); + let entries = vec![function.clone(), used.clone(), unused_duplicate.clone()]; + + let spec = spec_xdr(&entries); + let meta = v2_meta_xdr(); + let graph = graph_record(&function, std::slice::from_ref(&used)); + let wasm = minimal_wasm(&[ + (CONTRACT_META_SECTION, &meta), + (CONTRACT_SPEC_SECTION, &spec), + (GRAPH_SECTION, &graph), + ]); + + let shaken = shake_contract_spec(&wasm).unwrap(); + let filtered = read::from_wasm(&shaken).unwrap(); + + assert_eq!(filtered, vec![function, used]); + assert!(shaking::find_graph(&shaken).unwrap().entries.is_empty()); + assert!(!shaken + .windows(GRAPH_SECTION.len()) + .any(|bytes| bytes == GRAPH_SECTION.as_bytes())); + } + + #[test] + fn test_shake_contract_spec_keeps_other_custom_sections() { + let function = function_with_udt("run", "Shared"); + let used = struct_entry("Shared", "used", ScSpecTypeDef::I32); + let spec = spec_xdr(&[function.clone(), used.clone()]); + let meta = v2_meta_xdr(); + let graph = graph_record(&function, &[used]); + let other = b"kept"; + let wasm = minimal_wasm(&[ + ("before", other.as_slice()), + (CONTRACT_META_SECTION, &meta), + (CONTRACT_SPEC_SECTION, &spec), + (GRAPH_SECTION, &graph), + ("after", other.as_slice()), + ]); + + let shaken = shake_contract_spec(&wasm).unwrap(); + + assert!(shaken.windows(other.len()).any(|bytes| bytes == other)); + assert!(shaken + .windows("before".len()) + .any(|bytes| bytes == b"before")); + assert!(shaken.windows("after".len()).any(|bytes| bytes == b"after")); + } + + #[test] + fn test_shake_contract_spec_rejects_missing_v2_meta() { + let function = function_with_udt("run", "Shared"); + let used = struct_entry("Shared", "used", ScSpecTypeDef::I32); + let spec = spec_xdr(&[function.clone(), used.clone()]); + let graph = graph_record(&function, &[used]); + let wasm = minimal_wasm(&[(CONTRACT_SPEC_SECTION, &spec), (GRAPH_SECTION, &graph)]); + + let err = shake_contract_spec(&wasm).unwrap_err(); + + assert!(matches!(err, ShakeError::UnsupportedSpecShakingVersion(1))); + } + + #[test] + fn test_shake_contract_spec_rejects_non_v2_meta() { + let function = function_with_udt("run", "Shared"); + let used = struct_entry("Shared", "used", ScSpecTypeDef::I32); + let spec = spec_xdr(&[function.clone(), used.clone()]); + let meta = meta_xdr("1"); + let graph = graph_record(&function, &[used]); + let wasm = minimal_wasm(&[ + (CONTRACT_META_SECTION, &meta), + (CONTRACT_SPEC_SECTION, &spec), + (GRAPH_SECTION, &graph), + ]); + + let err = shake_contract_spec(&wasm).unwrap_err(); + + assert!(matches!(err, ShakeError::UnsupportedSpecShakingVersion(1))); + } + + #[test] + fn test_shake_contract_spec_accepts_v2_meta_with_empty_graph_without_udts() { + let function = function_with_type("run", ScSpecTypeDef::I32); + let spec = spec_xdr(std::slice::from_ref(&function)); + let meta = v2_meta_xdr(); + let wasm = minimal_wasm(&[ + (CONTRACT_META_SECTION, &meta), + (CONTRACT_SPEC_SECTION, &spec), + ]); + + let shaken = shake_contract_spec(&wasm).unwrap(); + + assert_eq!(read::from_wasm(&shaken).unwrap(), vec![function]); + assert!(shaking::find_graph(&shaken).unwrap().entries.is_empty()); + } + + #[test] + fn test_shake_contract_spec_rejects_v2_meta_with_missing_graph_entry() { + let function = function_with_udt("run", "Shared"); + let used = struct_entry("Shared", "used", ScSpecTypeDef::I32); + let spec = spec_xdr(&[function, used]); + let meta = v2_meta_xdr(); + let wasm = minimal_wasm(&[ + (CONTRACT_META_SECTION, &meta), + (CONTRACT_SPEC_SECTION, &spec), + ]); + + let err = shake_contract_spec(&wasm).unwrap_err(); + + assert!(matches!( + err, + ShakeError::SpecShaking(shaking::SpecShakingError::MissingGraphEntry { .. }) + )); + } + + #[test] + fn test_shake_contract_spec_rejects_v2_meta_with_malformed_graph() { + let function = function_with_udt("run", "Shared"); + let used = struct_entry("Shared", "used", ScSpecTypeDef::I32); + let spec = spec_xdr(&[function, used]); + let meta = v2_meta_xdr(); + let truncated_graph = &b"SpGrV"[..]; + let wasm = minimal_wasm(&[ + (CONTRACT_META_SECTION, &meta), + (CONTRACT_SPEC_SECTION, &spec), + (GRAPH_SECTION, truncated_graph), + ]); + + let err = shake_contract_spec(&wasm).unwrap_err(); + + assert!(matches!( + err, + ShakeError::SpecShaking(shaking::SpecShakingError::TruncatedRecord { .. }) + )); + } +} diff --git a/tests-expanded/test_account_tests.rs b/tests-expanded/test_account_tests.rs index e1a15ed18..49409b973 100644 --- a/tests-expanded/test_account_tests.rs +++ b/tests-expanded/test_account_tests.rs @@ -56,11 +56,23 @@ impl Error { *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x05Error\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04Fail\0\0\0\x01" } } -impl soroban_sdk::SpecShakingMarker for Error { +impl soroban_sdk::spec_shaking::SpecTypeId for Error { + const SPEC_TYPE_ID: [u8; 32] = *b"\xa8\x1f\xc4#\x9c\x8f\xeb\x88\xeb \xbbr!pt\x83\xce\xbdLr\"\xde\xe9\xc0\x04\xae\xb1\xf5\xa6dr\x8a"; +} +impl soroban_sdk::spec_shaking::SpecShakingMarker for Error { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() {} } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_ERROR: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\xa8\x1f\xc4#\x9c\x8f\xeb\x88\xeb \xbbr!pt\x83\xce\xbdLr\"\xde\xe9\xc0\x04\xae\xb1\xf5\xa6dr\x8a", + [], +); impl TryFrom for Error { type Error = soroban_sdk::Error; #[inline(always)] @@ -326,6 +338,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0c__check_auth\0\0\0\x03\0\0\0\0\0\0\0\x11signature_payload\0\0\0\0\0\x03\xee\0\0\0 \0\0\0\0\0\0\0\nsignatures\0\0\0\0\0\x02\0\0\0\0\0\0\0\rauth_contexts\0\0\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x07Context\0\0\0\0\x01\0\0\x03\xe9\0\0\0\x02\0\0\0\x03" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT___CHECK_AUTH: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b",\x10\xd9\xc4i\xd1;\xac\xbd\x1c\xeaT.\xc8$\xf0@\0\xd4/\xca\x1c\xa2I\x86\x88\xb5|]A\xb3\x1e", + [::SPEC_TYPE_ID], +); impl<'a> ContractClient<'a> {} impl ContractArgs { #[inline(always)] diff --git a/tests-expanded/test_account_wasm32v1-none.rs b/tests-expanded/test_account_wasm32v1-none.rs index 3b04cdcce..5aab7fbdb 100644 --- a/tests-expanded/test_account_wasm32v1-none.rs +++ b/tests-expanded/test_account_wasm32v1-none.rs @@ -57,7 +57,10 @@ impl Error { *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x05Error\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04Fail\0\0\0\x01" } } -impl soroban_sdk::SpecShakingMarker for Error { +impl soroban_sdk::spec_shaking::SpecTypeId for Error { + const SPEC_TYPE_ID: [u8; 32] = *b"\xa8\x1f\xc4#\x9c\x8f\xeb\x88\xeb \xbbr!pt\x83\xce\xbdLr\"\xde\xe9\xc0\x04\xae\xb1\xf5\xa6dr\x8a"; +} +impl soroban_sdk::spec_shaking::SpecShakingMarker for Error { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() { @@ -67,6 +70,16 @@ impl soroban_sdk::SpecShakingMarker for Error { } } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_ERROR: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\xa8\x1f\xc4#\x9c\x8f\xeb\x88\xeb \xbbr!pt\x83\xce\xbdLr\"\xde\xe9\xc0\x04\xae\xb1\xf5\xa6dr\x8a", + [], +); impl TryFrom for Error { type Error = soroban_sdk::Error; #[inline(always)] @@ -221,6 +234,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0c__check_auth\0\0\0\x03\0\0\0\0\0\0\0\x11signature_payload\0\0\0\0\0\x03\xee\0\0\0 \0\0\0\0\0\0\0\nsignatures\0\0\0\0\0\x02\0\0\0\0\0\0\0\rauth_contexts\0\0\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x07Context\0\0\0\0\x01\0\0\x03\xe9\0\0\0\x02\0\0\0\x03" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT___CHECK_AUTH: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b",\x10\xd9\xc4i\xd1;\xac\xbd\x1c\xeaT.\xc8$\xf0@\0\xd4/\xca\x1c\xa2I\x86\x88\xb5|]A\xb3\x1e", + [::SPEC_TYPE_ID], +); impl<'a> ContractClient<'a> {} impl ContractArgs { #[inline(always)] diff --git a/tests-expanded/test_add_i128_tests.rs b/tests-expanded/test_add_i128_tests.rs index b3434ea58..b2628d1b5 100644 --- a/tests-expanded/test_add_i128_tests.rs +++ b/tests-expanded/test_add_i128_tests.rs @@ -155,6 +155,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x03add\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x0b\0\0\0\x01\0\0\0\x0b" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_ADD: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x0f\x7f\x0e\x86PD7%\xd0\xa4I\xd3\x05q\xcb\x83\xa6J'N\xc97\xf0\xf6\xe5zPD\xbf\xf2\x07\xf4", + [], +); impl<'a> ContractClient<'a> { pub fn add(&self, a: &i128, b: &i128) -> i128 { use core::ops::Not; diff --git a/tests-expanded/test_add_i128_wasm32v1-none.rs b/tests-expanded/test_add_i128_wasm32v1-none.rs index 3a2aabc76..9a07dad7f 100644 --- a/tests-expanded/test_add_i128_wasm32v1-none.rs +++ b/tests-expanded/test_add_i128_wasm32v1-none.rs @@ -44,6 +44,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x03add\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x0b\0\0\0\x01\0\0\0\x0b" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_ADD: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x0f\x7f\x0e\x86PD7%\xd0\xa4I\xd3\x05q\xcb\x83\xa6J'N\xc97\xf0\xf6\xe5zPD\xbf\xf2\x07\xf4", + [], +); impl<'a> ContractClient<'a> { pub fn add(&self, a: &i128, b: &i128) -> i128 { use core::ops::Not; diff --git a/tests-expanded/test_add_u128_tests.rs b/tests-expanded/test_add_u128_tests.rs index 4c42a70a0..eb8ad228b 100644 --- a/tests-expanded/test_add_u128_tests.rs +++ b/tests-expanded/test_add_u128_tests.rs @@ -155,6 +155,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x03add\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\n\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\n\0\0\0\x01\0\0\0\n" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_ADD: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x89\x11\x92\x11\xe2Y\xa1\xfb\xcb14'\xf0\x13\xef\xdf\x9f\xb7\xfb\x11%5 \xc1\x1em\xc3\xcb\xec\x0c\xa0\xb6", + [], +); impl<'a> ContractClient<'a> { pub fn add(&self, a: &u128, b: &u128) -> u128 { use core::ops::Not; diff --git a/tests-expanded/test_add_u128_wasm32v1-none.rs b/tests-expanded/test_add_u128_wasm32v1-none.rs index 5bde2d67a..274c1277b 100644 --- a/tests-expanded/test_add_u128_wasm32v1-none.rs +++ b/tests-expanded/test_add_u128_wasm32v1-none.rs @@ -44,6 +44,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x03add\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\n\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\n\0\0\0\x01\0\0\0\n" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_ADD: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x89\x11\x92\x11\xe2Y\xa1\xfb\xcb14'\xf0\x13\xef\xdf\x9f\xb7\xfb\x11%5 \xc1\x1em\xc3\xcb\xec\x0c\xa0\xb6", + [], +); impl<'a> ContractClient<'a> { pub fn add(&self, a: &u128, b: &u128) -> u128 { use core::ops::Not; diff --git a/tests-expanded/test_add_u64_tests.rs b/tests-expanded/test_add_u64_tests.rs index 8dac902c5..01b88b807 100644 --- a/tests-expanded/test_add_u64_tests.rs +++ b/tests-expanded/test_add_u64_tests.rs @@ -155,6 +155,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x03add\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x06\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x06\0\0\0\x01\0\0\0\x06" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_ADD: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\x03\xedX=\x97\x96\x0b\xa5*Y\x95;WYd\xcb\x0fF\x96\xdf>\xba\x07\x0f{\x08\xfb+dY\xb4,", + [], + ); impl<'a> ContractClient<'a> { pub fn add(&self, a: &u64, b: &u64) -> u64 { use core::ops::Not; diff --git a/tests-expanded/test_add_u64_wasm32v1-none.rs b/tests-expanded/test_add_u64_wasm32v1-none.rs index 62a1bcc94..5c559d6c0 100644 --- a/tests-expanded/test_add_u64_wasm32v1-none.rs +++ b/tests-expanded/test_add_u64_wasm32v1-none.rs @@ -44,6 +44,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x03add\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x06\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x06\0\0\0\x01\0\0\0\x06" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_ADD: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\x03\xedX=\x97\x96\x0b\xa5*Y\x95;WYd\xcb\x0fF\x96\xdf>\xba\x07\x0f{\x08\xfb+dY\xb4,", + [], + ); impl<'a> ContractClient<'a> { pub fn add(&self, a: &u64, b: &u64) -> u64 { use core::ops::Not; diff --git a/tests-expanded/test_associated_type_chained_tests.rs b/tests-expanded/test_associated_type_chained_tests.rs index 547443127..a5d8b3679 100644 --- a/tests-expanded/test_associated_type_chained_tests.rs +++ b/tests-expanded/test_associated_type_chained_tests.rs @@ -215,6 +215,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x07set_val\0\0\0\0\x01\0\0\0\0\0\0\0\x05input\0\0\0\0\0\0\x06\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_SET_VAL: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xc6-\xf8\xb1V\x0eY\x8f\x0fZh\x86p\x8bs\xc3E\x92BZ\x8d\x93d\x92.\xfa\xb2\x95`,;\xb4", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__get_val__spec { @@ -229,6 +236,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x07get_val\0\0\0\0\0\0\0\0\x01\0\0\0\x06" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_GET_VAL: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xb2d\xe3@\xd4W\xa0J\x8f\xfc\xb9\xad\x83}\xa8\xe5\xb9D\x12\x917\xa3\xedS\xaaB\xff\x1a\xf6\x80\xa9\xc8", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__both__spec { @@ -243,6 +259,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x04both\0\0\0\x01\0\0\0\0\0\0\0\x05input\0\0\0\0\0\0\x06\0\0\0\x01\0\0\0\x06" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_BOTH: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x90`f\x8d\xd5\xe8\xe6\xc0F\xa7\xaa\xe2( \xe6t\xd9\xa8\x03dK\xf1p\x98\x19\xba\x81y\xe7m\xe6\x03", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__wrapped__spec { @@ -257,6 +282,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x07wrapped\0\0\0\0\x01\0\0\0\0\0\0\0\x05input\0\0\0\0\0\x03\xea\0\0\0\x06\0\0\0\x01\0\0\x03\xe9\0\0\0\x06\0\0\0\x03" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WRAPPED: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xda\xa7\xa2Fh\xc9\xc3\xe3\xb9\xa2\x85\x9d\x8d\x16d4\xf1\xb9\x0c@Cjd\xc6\x1b=\xedky\xa0;\x92", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__double_wrapped__spec { @@ -272,6 +306,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0edouble_wrapped\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05input\0\0\0\0\0\x03\xe8\0\0\x03\xea\0\0\0\x06\0\0\0\x01\0\0\x03\xe9\0\0\x03\xea\0\0\0\x06\0\0\0\x03" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_DOUBLE_WRAPPED: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"F\x0b\x86\xec]\xcc\t,7\x9c\x9a\x98kB\xcc\x050\xc8,i#Z\xf0\x83\xb7_\xc5O\x92$\xb0\xdc", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__valval__spec { @@ -286,6 +327,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06valval\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05input\0\0\0\0\0\0\x06\0\0\0\x01\0\0\x03\xe8\0\0\0\x06" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_VALVAL: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x13\xeaE\xa5\x1e\xe5\x06\xdf\x9b\xee\x8ds\xc8\xcc\x054\xc9\0\x1f\xf6\x842\xd8u\xd2o\xfen\xc0\x83Q\xf9", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__tuple__spec { @@ -300,6 +350,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x05tuple\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05input\0\0\0\0\0\0\x06\0\0\0\x01\0\0\x03\xed\0\0\0\x02\0\0\0\x06\0\0\0\x06" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TUPLE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xe1ca\xfe\x88\x13\xc3\xec%\xe3\xdd\xd2\xfaT\x86y\xc2\xf55\xe0\xa1\xe1&\xe8E\xf6}\xf3\xe5\x99\x86\xb6", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__valref__spec { @@ -314,6 +373,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06valref\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05input\0\0\0\0\0\0\x06\0\0\0\x01\0\0\0\x06" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_VALREF: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"^\x11\xe1\x0e\xc9\xd2^-\xa7Z?O\x97\xd5\xe3#\xa8\x12!\xf4j\x01\xe8%Z\x9e\xde&P\x80\x17\xd2", + [], +); impl<'a> ContractClient<'a> { pub fn set_val(&self, input: &u64) -> () { use core::ops::Not; diff --git a/tests-expanded/test_associated_type_chained_wasm32v1-none.rs b/tests-expanded/test_associated_type_chained_wasm32v1-none.rs index 79640abab..6ace03db3 100644 --- a/tests-expanded/test_associated_type_chained_wasm32v1-none.rs +++ b/tests-expanded/test_associated_type_chained_wasm32v1-none.rs @@ -104,6 +104,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x07set_val\0\0\0\0\x01\0\0\0\0\0\0\0\x05input\0\0\0\0\0\0\x06\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_SET_VAL: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xc6-\xf8\xb1V\x0eY\x8f\x0fZh\x86p\x8bs\xc3E\x92BZ\x8d\x93d\x92.\xfa\xb2\x95`,;\xb4", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__get_val__spec { @@ -119,6 +127,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x07get_val\0\0\0\0\0\0\0\0\x01\0\0\0\x06" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_GET_VAL: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xb2d\xe3@\xd4W\xa0J\x8f\xfc\xb9\xad\x83}\xa8\xe5\xb9D\x12\x917\xa3\xedS\xaaB\xff\x1a\xf6\x80\xa9\xc8", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__both__spec { @@ -134,6 +152,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x04both\0\0\0\x01\0\0\0\0\0\0\0\x05input\0\0\0\0\0\0\x06\0\0\0\x01\0\0\0\x06" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_BOTH: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x90`f\x8d\xd5\xe8\xe6\xc0F\xa7\xaa\xe2( \xe6t\xd9\xa8\x03dK\xf1p\x98\x19\xba\x81y\xe7m\xe6\x03", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__wrapped__spec { @@ -149,6 +177,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x07wrapped\0\0\0\0\x01\0\0\0\0\0\0\0\x05input\0\0\0\0\0\x03\xea\0\0\0\x06\0\0\0\x01\0\0\x03\xe9\0\0\0\x06\0\0\0\x03" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WRAPPED: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xda\xa7\xa2Fh\xc9\xc3\xe3\xb9\xa2\x85\x9d\x8d\x16d4\xf1\xb9\x0c@Cjd\xc6\x1b=\xedky\xa0;\x92", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__double_wrapped__spec { @@ -165,6 +203,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0edouble_wrapped\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05input\0\0\0\0\0\x03\xe8\0\0\x03\xea\0\0\0\x06\0\0\0\x01\0\0\x03\xe9\0\0\x03\xea\0\0\0\x06\0\0\0\x03" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_DOUBLE_WRAPPED: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"F\x0b\x86\xec]\xcc\t,7\x9c\x9a\x98kB\xcc\x050\xc8,i#Z\xf0\x83\xb7_\xc5O\x92$\xb0\xdc", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__valval__spec { @@ -180,6 +226,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06valval\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05input\0\0\0\0\0\0\x06\0\0\0\x01\0\0\x03\xe8\0\0\0\x06" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_VALVAL: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x13\xeaE\xa5\x1e\xe5\x06\xdf\x9b\xee\x8ds\xc8\xcc\x054\xc9\0\x1f\xf6\x842\xd8u\xd2o\xfen\xc0\x83Q\xf9", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__tuple__spec { @@ -195,6 +251,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x05tuple\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05input\0\0\0\0\0\0\x06\0\0\0\x01\0\0\x03\xed\0\0\0\x02\0\0\0\x06\0\0\0\x06" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TUPLE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xe1ca\xfe\x88\x13\xc3\xec%\xe3\xdd\xd2\xfaT\x86y\xc2\xf55\xe0\xa1\xe1&\xe8E\xf6}\xf3\xe5\x99\x86\xb6", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__valref__spec { @@ -210,6 +276,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06valref\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05input\0\0\0\0\0\0\x06\0\0\0\x01\0\0\0\x06" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_VALREF: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"^\x11\xe1\x0e\xc9\xd2^-\xa7Z?O\x97\xd5\xe3#\xa8\x12!\xf4j\x01\xe8%Z\x9e\xde&P\x80\x17\xd2", + [], +); impl<'a> ContractClient<'a> { pub fn set_val(&self, input: &u64) -> () { use core::ops::Not; diff --git a/tests-expanded/test_associated_types_contracttrait_tests.rs b/tests-expanded/test_associated_types_contracttrait_tests.rs index f147bb0b5..7f3f26b89 100644 --- a/tests-expanded/test_associated_types_contracttrait_tests.rs +++ b/tests-expanded/test_associated_types_contracttrait_tests.rs @@ -399,6 +399,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x04exec\0\0\0\0\0\0\0\x01\0\0\0\x10" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EXEC: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xa5 5J;P\x91\x10g\xe9\x0eC967\xc5\x13\xe6#\xb2\xa0Wtv\xeeL\xed\xa1\x96]z\xf2", + [], + ); impl<'a> ContractClient<'a> { pub fn exec(&self) -> String { use core::ops::Not; @@ -576,6 +583,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x05exec2\0\0\0\0\0\0\0\0\0\0\x01\0\0\0\x10" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EXEC2: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xd36\xb8\x8ccHo\x01\x9cik\xcf)Di6HNGLxS\x0f\xbc\xf2\x14\xfd\x15j\x94F\xf0", + [], + ); impl<'a> ContractClient<'a> { pub fn exec2(&self) -> String { use core::ops::Not; @@ -795,7 +809,7 @@ mod test { mod test_with_wasm { use soroban_sdk::{Env, String}; mod contract { - pub const WASM: &[u8] = b"\x00asm\x01\x00\x00\x00\x01\x11\x03`\x02~~\x01~`\x00\x01~`\x02\x7f\x7f\x01~\x02\x07\x01\x01b\x01i\x00\x00\x03\x04\x03\x01\x02\x01\x05\x03\x01\x00\x11\x06!\x04\x7f\x01A\x80\x80\xc0\x00\x0b\x7f\x00A\x8f\x80\xc0\x00\x0b\x7f\x00A\x8f\x80\xc0\x00\x0b\x7f\x00A\x90\x80\xc0\x00\x0b\x078\x06\x06memory\x02\x00\x04exec\x00\x01\x05exec2\x00\x03\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n>\x03\x10\x00A\x80\x80\xc0\x80\x00A\x07\x10\x82\x80\x80\x80\x00\x0b\x1a\x00 \x00\xadB \x86B\x04\x84 \x01\xadB \x86B\x04\x84\x10\x80\x80\x80\x80\x00\x0b\x10\x00A\x87\x80\xc0\x80\x00A\x08\x10\x82\x80\x80\x80\x00\x0b\x0b\x18\x01\x00A\x80\x80\xc0\x00\x0b\x0fdefaultdefault2\x00K\x0econtractspecv0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04exec\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05exec2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x10\x00\x1e\x11contractenvmetav0\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x00\x00O\x0econtractmetav0\x00\x00\x00\x00\x00\x00\x00\x05rsver\x00\x00\x00\x00\x00\x00\x061.91.0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12rssdk_spec_shaking\x00\x00\x00\x00\x00\x012\x00\x00\x00"; + pub const WASM: &[u8] = b"\x00asm\x01\x00\x00\x00\x01\x11\x03`\x02~~\x01~`\x00\x01~`\x02\x7f\x7f\x01~\x02\x07\x01\x01b\x01i\x00\x00\x03\x04\x03\x01\x02\x01\x05\x03\x01\x00\x11\x06!\x04\x7f\x01A\x80\x80\xc0\x00\x0b\x7f\x00A\x8f\x80\xc0\x00\x0b\x7f\x00A\x8f\x80\xc0\x00\x0b\x7f\x00A\x90\x80\xc0\x00\x0b\x078\x06\x06memory\x02\x00\x04exec\x00\x01\x05exec2\x00\x03\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n>\x03\x10\x00A\x80\x80\xc0\x80\x00A\x07\x10\x82\x80\x80\x80\x00\x0b\x1a\x00 \x00\xadB \x86B\x04\x84 \x01\xadB \x86B\x04\x84\x10\x80\x80\x80\x80\x00\x0b\x10\x00A\x87\x80\xc0\x80\x00A\x08\x10\x82\x80\x80\x80\x00\x0b\x0b\x18\x01\x00A\x80\x80\xc0\x00\x0b\x0fdefaultdefault2\x00\xdf\x15\x0econtractspecv0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04exec\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05exec2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x10\x00\x00\x00\x02\x00\x00\x00\xe3Context of a single authorized call performed by an address.\n\nCustom account contracts that implement `__check_auth` special function\nreceive a list of `Context` values corresponding to all the calls that\nneed to be authorized.\x00\x00\x00\x00\x00\x00\x00\x00\x07Context\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x14Contract invocation.\x00\x00\x00\x08Contract\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0fContractContext\x00\x00\x00\x00\x01\x00\x00\x00=Contract that has a constructor with no arguments is created.\x00\x00\x00\x00\x00\x00\x14CreateContractHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x1bCreateContractHostFnContext\x00\x00\x00\x00\x01\x00\x00\x00DContract that has a constructor with 1 or more arguments is created.\x00\x00\x00\x1cCreateContractWithCtorHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00*CreateContractWithConstructorHostFnContext\x00\x00\x00\x00\x00\x01\x00\x00\x00\xbdAuthorization context of a single contract call.\n\nThis struct corresponds to a `require_auth_for_args` call for an address\nfrom `contract` function with `fn_name` name and `args` arguments.\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fContractContext\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x04args\x00\x00\x03\xea\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08contract\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x07fn_name\x00\x00\x00\x00\x11\x00\x00\x00\x02\x00\x00\x00_Contract executable used for creating a new contract and used in\n`CreateContractHostFnContext`.\x00\x00\x00\x00\x00\x00\x00\x00\x12ContractExecutable\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Wasm\x00\x00\x00\x01\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x01\x00\x00\x008Value of contract node in InvokerContractAuthEntry tree.\x00\x00\x00\x00\x00\x00\x00\x15SubContractInvocation\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x07context\x00\x00\x00\x07\xd0\x00\x00\x00\x0fContractContext\x00\x00\x00\x00\x00\x00\x00\x00\x0fsub_invocations\x00\x00\x00\x03\xea\x00\x00\x07\xd0\x00\x00\x00\x18InvokerContractAuthEntry\x00\x00\x00\x02\x00\x00\x01/A node in the tree of authorizations performed on behalf of the current\ncontract as invoker of the contracts deeper in the call stack.\n\nThis is used as an argument of `authorize_as_current_contract` host function.\n\nThis tree corresponds `require_auth[_for_args]` calls on behalf of the\ncurrent contract.\x00\x00\x00\x00\x00\x00\x00\x00\x18InvokerContractAuthEntry\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x12Invoke a contract.\x00\x00\x00\x00\x00\x08Contract\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x15SubContractInvocation\x00\x00\x00\x00\x00\x00\x01\x00\x00\x005Create a contract passing 0 arguments to constructor.\x00\x00\x00\x00\x00\x00\x14CreateContractHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x1bCreateContractHostFnContext\x00\x00\x00\x00\x01\x00\x00\x00=Create a contract passing 0 or more arguments to constructor.\x00\x00\x00\x00\x00\x00\x1cCreateContractWithCtorHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00*CreateContractWithConstructorHostFnContext\x00\x00\x00\x00\x00\x01\x00\x00\x00vAuthorization context for `create_contract` host function that creates a\nnew contract on behalf of authorizer address.\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1bCreateContractHostFnContext\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\nexecutable\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12ContractExecutable\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04salt\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x01\x00\x00\x00\xd6Authorization context for `create_contract` host function that creates a\nnew contract on behalf of authorizer address.\nThis is the same as `CreateContractHostFnContext`, but also has\ncontract constructor arguments.\x00\x00\x00\x00\x00\x00\x00\x00\x00*CreateContractWithConstructorHostFnContext\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x10constructor_args\x00\x00\x03\xea\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nexecutable\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12ContractExecutable\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04salt\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nExecutable\x00\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Wasm\x00\x00\x00\x01\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStellarAsset\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07Account\x00\x00\x81\x06\x1ccontractspecv0.rssdk.graphv0SpGrV\x01\x00\x00\xa5 5J;P\x91\x10g\xe9\x0eC967\xc5\x13\xe6#\xb2\xa0Wtv\xeeL\xed\xa1\x96]z\xf2\x00\x00SpGrV\x01\x00\x00\xd36\xb8\x8ccHo\x01\x9cik\xcf)Di6HNGLxS\x0f\xbc\xf2\x14\xfd\x15j\x94F\xf0\x00\x00SpGrV\x01\x00\x02\xa3J\xcf\xf7D\x93\x0bB]\x95\xeb\xfe\x03y\x83e5\\\x16\xeb\x94Ne\xe6Xw\x1f&\xf7\xc0pT\x00\x03\xf1\xf9\x90\x07E*e\xfd\x08\x8c\xc2\xb1\x10\xfd\xca\xae6T\x9e)[\xdb\xee_\xfa\xed\xcaE\x9bv\x98\xec\x15\xe5\x1a,\xc0\xc7\xef\xd4\xe0\xda\x0e\x16\x87\x1a\xae\xe73X\x1d2\x8a\x8aP\xab\x81\xef\x18\x8e:\xa2\xa9ns\x94\x0c\x1926\x1d\x90\x19\xc8\x8b=\xbe\xaf\xd7n\xcd=z\t\xb27\xa5.\xde:>\x03\xcd7\x12\xafSpGrV\x01\x00\x02\xf1\xf9\x90\x07E*e\xfd\x08\x8c\xc2\xb1\x10\xfd\xca\xae6T\x9e)[\xdb\xee_\xfa\xed\xcaE\x9bv\x98\xec\x00\x00SpGrV\x01\x00\x02\xb6\xb1Hy\xda\xca\xaf\xcc\x1f\x01\x07y\x9a#g}2\x1c.Q0Vf\xc7ze\xacm\x01\xf5Y\xcc\x00\x00SpGrV\x01\x00\x02\x9e)H\x8e\xf0\x01{{\xce\x9fdO\x0eD\xc0,\x0f\xe8\xee\'\x845r\x9f\xeb`\xd0\x12H\x17\x96g\x00\x02\xf1\xf9\x90\x07E*e\xfd\x08\x8c\xc2\xb1\x10\xfd\xca\xae6T\x9e)[\xdb\xee_\xfa\xed\xcaE\x9bv\x98\xecULqD\xd3\xfa:\x1f\x0c\xa5\xb7\x04\xe5H\x8b\x91J\x9e\x0fe\x7f\x9f[\xdbG#\xc7o\xb0\xf4\xcf\xe6SpGrV\x01\x00\x02ULqD\xd3\xfa:\x1f\x0c\xa5\xb7\x04\xe5H\x8b\x91J\x9e\x0fe\x7f\x9f[\xdbG#\xc7o\xb0\xf4\xcf\xe6\x00\x03\x9e)H\x8e\xf0\x01{{\xce\x9fdO\x0eD\xc0,\x0f\xe8\xee\'\x845r\x9f\xeb`\xd0\x12H\x17\x96g\x15\xe5\x1a,\xc0\xc7\xef\xd4\xe0\xda\x0e\x16\x87\x1a\xae\xe73X\x1d2\x8a\x8aP\xab\x81\xef\x18\x8e:\xa2\xa9ns\x94\x0c\x1926\x1d\x90\x19\xc8\x8b=\xbe\xaf\xd7n\xcd=z\t\xb27\xa5.\xde:>\x03\xcd7\x12\xafSpGrV\x01\x00\x02\x15\xe5\x1a,\xc0\xc7\xef\xd4\xe0\xda\x0e\x16\x87\x1a\xae\xe73X\x1d2\x8a\x8aP\xab\x81\xef\x18\x8e:\xa2\xa9n\x00\x01\xb6\xb1Hy\xda\xca\xaf\xcc\x1f\x01\x07y\x9a#g}2\x1c.Q0Vf\xc7ze\xacm\x01\xf5Y\xccSpGrV\x01\x00\x02s\x94\x0c\x1926\x1d\x90\x19\xc8\x8b=\xbe\xaf\xd7n\xcd=z\t\xb27\xa5.\xde:>\x03\xcd7\x12\xaf\x00\x01\xb6\xb1Hy\xda\xca\xaf\xcc\x1f\x01\x07y\x9a#g}2\x1c.Q0Vf\xc7ze\xacm\x01\xf5Y\xccSpGrV\x01\x00\x02L|{\r\xf4\xf2\x1a\xa8\xf6\x981\xe2K\xcb\x824N\xe6\x97\xed\xdf\xc2\x1cck\xd6\xceW\x9cx\x10\x1e\x00\x00\x00\x1e\x11contractenvmetav0\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x00\x00O\x0econtractmetav0\x00\x00\x00\x00\x00\x00\x00\x05rsver\x00\x00\x00\x00\x00\x00\x061.91.0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12rssdk_spec_shaking\x00\x00\x00\x00\x00\x012\x00\x00\x00"; pub trait Contract { fn exec(env: soroban_sdk::Env) -> soroban_sdk::String; fn exec2(env: soroban_sdk::Env) -> soroban_sdk::String; @@ -1085,6 +1099,4731 @@ mod test_with_wasm { () } } + pub struct ContractContext { + pub args: soroban_sdk::Vec, + pub contract: soroban_sdk::Address, + pub fn_name: soroban_sdk::Symbol, + } + #[automatically_derived] + impl ::core::fmt::Debug for ContractContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "ContractContext", + "args", + &self.args, + "contract", + &self.contract, + "fn_name", + &&self.fn_name, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ContractContext { + #[inline] + fn clone(&self) -> ContractContext { + ContractContext { + args: ::core::clone::Clone::clone(&self.args), + contract: ::core::clone::Clone::clone(&self.contract), + fn_name: ::core::clone::Clone::clone(&self.fn_name), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ContractContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ContractContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ContractContext { + #[inline] + fn eq(&self, other: &ContractContext) -> bool { + self.args == other.args + && self.contract == other.contract + && self.fn_name == other.fn_name + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ContractContext { + #[inline] + fn cmp(&self, other: &ContractContext) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.args, &other.args) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.contract, &other.contract) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.fn_name, &other.fn_name) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ContractContext { + #[inline] + fn partial_cmp( + &self, + other: &ContractContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.args, &other.args) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp(&self.contract, &other.contract) + { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.fn_name, &other.fn_name) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_CONTRACTCONTEXT: [u8; 96usize] = ContractContext::spec_xdr(); + impl ContractContext { + pub const fn spec_xdr() -> [u8; 96usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fContractContext\0\0\0\0\x03\0\0\0\0\0\0\0\x04args\0\0\x03\xea\0\0\0\0\0\0\0\0\0\0\0\x08contract\0\0\0\x13\0\0\0\0\0\0\0\x07fn_name\0\0\0\0\x11" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for ContractContext { + const SPEC_TYPE_ID: [u8; 32] = *b"\x03\x04uN\xea\xd7[\x13V\x9f\xd4\xbd\xc1\x8a\xd6\x7f\xd8iD\xa5B\x89qT\x0b'\xad(\xb8\x9f\x8f\x19"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CONTRACTCONTEXT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\x03\x04uN\xea\xd7[\x13V\x9f\xd4\xbd\xc1\x8a\xd6\x7f\xd8iD\xa5B\x89qT\x0b'\xad(\xb8\x9f\x8f\x19", + [], + ); + impl soroban_sdk::TryFromVal for ContractContext { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["args", "contract", "fn_name"]; + let mut vals: [Val; 3usize] = [Val::VOID.to_val(); 3usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + args: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + contract: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + fn_name: vals[2] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &ContractContext, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["args", "contract", "fn_name"]; + let vals: [Val; 3usize] = [ + (&val.args).try_into_val(env).map_err(|_| ConversionError)?, + (&val.contract) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.fn_name) + .try_into_val(env) + .map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&ContractContext, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + impl soroban_sdk::TryFromVal for ContractContext { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 3usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + args: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "args" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + contract: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "contract" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + fn_name: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "fn_name" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal for ContractContext { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&ContractContext> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &ContractContext) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "args" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.args) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "contract" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.contract) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "fn_name" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.fn_name) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } + } + impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: ContractContext) -> Result { + (&val).try_into() + } + } + impl TryFrom<&ContractContext> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &ContractContext) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: ContractContext) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryContractContext { + args: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + contract: ::Prototype, + fn_name: ::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryContractContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "ArbitraryContractContext", + "args", + &self.args, + "contract", + &self.contract, + "fn_name", + &&self.fn_name, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryContractContext { + #[inline] + fn clone(&self) -> ArbitraryContractContext { + ArbitraryContractContext { + args: ::core::clone::Clone::clone(&self.args), + contract: ::core::clone::Clone::clone(&self.contract), + fn_name: ::core::clone::Clone::clone(&self.fn_name), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryContractContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryContractContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryContractContext { + #[inline] + fn eq(&self, other: &ArbitraryContractContext) -> bool { + self.args == other.args + && self.contract == other.contract + && self.fn_name == other.fn_name + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryContractContext { + #[inline] + fn cmp(&self, other: &ArbitraryContractContext) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.args, &other.args) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.contract, &other.contract) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.fn_name, &other.fn_name) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryContractContext { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryContractContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.args, &other.args) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp( + &self.contract, + &other.contract, + ) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp( + &self.fn_name, + &other.fn_name, + ) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryContractContext: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryContractContext { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryContractContext { + args: arbitrary::Arbitrary::arbitrary(u)?, + contract: arbitrary::Arbitrary::arbitrary(u)?, + fn_name: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryContractContext { + args: arbitrary::Arbitrary::arbitrary(&mut u)?, + contract: arbitrary::Arbitrary::arbitrary(&mut u)?, + fn_name: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for ContractContext { + type Prototype = ArbitraryContractContext; + } + impl soroban_sdk::TryFromVal for ContractContext { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryContractContext, + ) -> std::result::Result { + Ok(ContractContext { + args: soroban_sdk::IntoVal::into_val(&v.args, env), + contract: soroban_sdk::IntoVal::into_val(&v.contract, env), + fn_name: soroban_sdk::IntoVal::into_val(&v.fn_name, env), + }) + } + } + }; + pub struct SubContractInvocation { + pub context: ContractContext, + pub sub_invocations: soroban_sdk::Vec, + } + #[automatically_derived] + impl ::core::fmt::Debug for SubContractInvocation { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "SubContractInvocation", + "context", + &self.context, + "sub_invocations", + &&self.sub_invocations, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for SubContractInvocation { + #[inline] + fn clone(&self) -> SubContractInvocation { + SubContractInvocation { + context: ::core::clone::Clone::clone(&self.context), + sub_invocations: ::core::clone::Clone::clone(&self.sub_invocations), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for SubContractInvocation { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for SubContractInvocation {} + #[automatically_derived] + impl ::core::cmp::PartialEq for SubContractInvocation { + #[inline] + fn eq(&self, other: &SubContractInvocation) -> bool { + self.context == other.context && self.sub_invocations == other.sub_invocations + } + } + #[automatically_derived] + impl ::core::cmp::Ord for SubContractInvocation { + #[inline] + fn cmp(&self, other: &SubContractInvocation) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.context, &other.context) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.sub_invocations, &other.sub_invocations) + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for SubContractInvocation { + #[inline] + fn partial_cmp( + &self, + other: &SubContractInvocation, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.context, &other.context) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp( + &self.sub_invocations, + &other.sub_invocations, + ) + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_SUBCONTRACTINVOCATION: [u8; 144usize] = + SubContractInvocation::spec_xdr(); + impl SubContractInvocation { + pub const fn spec_xdr() -> [u8; 144usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x15SubContractInvocation\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x07context\0\0\0\x07\xd0\0\0\0\x0fContractContext\0\0\0\0\0\0\0\0\x0fsub_invocations\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x18InvokerContractAuthEntry" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for SubContractInvocation { + const SPEC_TYPE_ID: [u8; 32] = *b" \x9d\xc5_\xba\x8fv\x18\x95\x02\xbdJ}\x97\x01KN\xd6\0\xf8\xb6\xefq\xa8j\x11\\\xc7\xd7\xd4\xcf\xf0"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_SUBCONTRACTINVOCATION: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, + >( + 2, + *b" \x9d\xc5_\xba\x8fv\x18\x95\x02\xbdJ}\x97\x01KN\xd6\0\xf8\xb6\xefq\xa8j\x11\\\xc7\xd7\xd4\xcf\xf0", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); + impl soroban_sdk::TryFromVal for SubContractInvocation { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["context", "sub_invocations"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + context: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + sub_invocations: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &SubContractInvocation, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["context", "sub_invocations"]; + let vals: [Val; 2usize] = [ + (&val.context) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.sub_invocations) + .try_into_val(env) + .map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&SubContractInvocation, + ) -> Result { + <_ as soroban_sdk::TryFromVal< + soroban_sdk::Env, + SubContractInvocation, + >>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal for SubContractInvocation { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 2usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + context: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "context" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + sub_invocations: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "sub_invocations" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal for SubContractInvocation { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&SubContractInvocation> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &SubContractInvocation) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "context" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.context) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "sub_invocations" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.sub_invocations) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } + } + impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: SubContractInvocation) -> Result { + (&val).try_into() + } + } + impl TryFrom<&SubContractInvocation> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &SubContractInvocation) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: SubContractInvocation) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitrarySubContractInvocation { + context: ::Prototype, + sub_invocations: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitrarySubContractInvocation { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "ArbitrarySubContractInvocation", + "context", + &self.context, + "sub_invocations", + &&self.sub_invocations, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitrarySubContractInvocation { + #[inline] + fn clone(&self) -> ArbitrarySubContractInvocation { + ArbitrarySubContractInvocation { + context: ::core::clone::Clone::clone(&self.context), + sub_invocations: ::core::clone::Clone::clone(&self.sub_invocations), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitrarySubContractInvocation { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitrarySubContractInvocation {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitrarySubContractInvocation { + #[inline] + fn eq(&self, other: &ArbitrarySubContractInvocation) -> bool { + self.context == other.context && self.sub_invocations == other.sub_invocations + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitrarySubContractInvocation { + #[inline] + fn cmp(&self, other: &ArbitrarySubContractInvocation) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.context, &other.context) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.sub_invocations, &other.sub_invocations) + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitrarySubContractInvocation { + #[inline] + fn partial_cmp( + &self, + other: &ArbitrarySubContractInvocation, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.context, &other.context) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp( + &self.sub_invocations, + &other.sub_invocations, + ) + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitrarySubContractInvocation: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitrarySubContractInvocation { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitrarySubContractInvocation.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitrarySubContractInvocation { + context: arbitrary::Arbitrary::arbitrary(u)?, + sub_invocations: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitrarySubContractInvocation.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitrarySubContractInvocation.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitrarySubContractInvocation { + context: arbitrary::Arbitrary::arbitrary(&mut u)?, + sub_invocations: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitrarySubContractInvocation.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for SubContractInvocation { + type Prototype = ArbitrarySubContractInvocation; + } + impl soroban_sdk::TryFromVal + for SubContractInvocation + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitrarySubContractInvocation, + ) -> std::result::Result { + Ok(SubContractInvocation { + context: soroban_sdk::IntoVal::into_val(&v.context, env), + sub_invocations: soroban_sdk::IntoVal::into_val(&v.sub_invocations, env), + }) + } + } + }; + pub struct CreateContractHostFnContext { + pub executable: ContractExecutable, + pub salt: soroban_sdk::BytesN<32>, + } + #[automatically_derived] + impl ::core::fmt::Debug for CreateContractHostFnContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "CreateContractHostFnContext", + "executable", + &self.executable, + "salt", + &&self.salt, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for CreateContractHostFnContext { + #[inline] + fn clone(&self) -> CreateContractHostFnContext { + CreateContractHostFnContext { + executable: ::core::clone::Clone::clone(&self.executable), + salt: ::core::clone::Clone::clone(&self.salt), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for CreateContractHostFnContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for CreateContractHostFnContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for CreateContractHostFnContext { + #[inline] + fn eq(&self, other: &CreateContractHostFnContext) -> bool { + self.executable == other.executable && self.salt == other.salt + } + } + #[automatically_derived] + impl ::core::cmp::Ord for CreateContractHostFnContext { + #[inline] + fn cmp(&self, other: &CreateContractHostFnContext) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.executable, &other.executable) { + ::core::cmp::Ordering::Equal => ::core::cmp::Ord::cmp(&self.salt, &other.salt), + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for CreateContractHostFnContext { + #[inline] + fn partial_cmp( + &self, + other: &CreateContractHostFnContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.executable, &other.executable) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_CREATECONTRACTHOSTFNCONTEXT: [u8; 116usize] = + CreateContractHostFnContext::spec_xdr(); + impl CreateContractHostFnContext { + pub const fn spec_xdr() -> [u8; 116usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x1bCreateContractHostFnContext\0\0\0\0\x02\0\0\0\0\0\0\0\nexecutable\0\0\0\0\x07\xd0\0\0\0\x12ContractExecutable\0\0\0\0\0\0\0\0\0\x04salt\0\0\x03\xee\0\0\0 " + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for CreateContractHostFnContext { + const SPEC_TYPE_ID: [u8; 32] = *b"\xe1\"T\xf0&\x19?P\xad\xa3\xa0\xd2\xf1\xea\xf8~\xde\xe7\x12\xe5_&\xb62Cl\xc8x\xcc.\xd4\xcd"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CREATECONTRACTHOSTFNCONTEXT: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, + >( + 2, + *b"\xe1\"T\xf0&\x19?P\xad\xa3\xa0\xd2\xf1\xea\xf8~\xde\xe7\x12\xe5_&\xb62Cl\xc8x\xcc.\xd4\xcd", + [::SPEC_TYPE_ID], + ); + impl soroban_sdk::TryFromVal for CreateContractHostFnContext { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["executable", "salt"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + executable: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + salt: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &CreateContractHostFnContext, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["executable", "salt"]; + let vals: [Val; 2usize] = [ + (&val.executable) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.salt).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&CreateContractHostFnContext, + ) -> Result { + <_ as soroban_sdk::TryFromVal< + soroban_sdk::Env, + CreateContractHostFnContext, + >>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal + for CreateContractHostFnContext + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 2usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + executable: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "executable" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + salt: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "salt" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal + for CreateContractHostFnContext + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&CreateContractHostFnContext> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: &CreateContractHostFnContext, + ) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "executable" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.executable) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "salt" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.salt) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } + } + impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: CreateContractHostFnContext) -> Result { + (&val).try_into() + } + } + impl TryFrom<&CreateContractHostFnContext> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: &CreateContractHostFnContext, + ) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: CreateContractHostFnContext) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryCreateContractHostFnContext { + executable: ::Prototype, + salt: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryCreateContractHostFnContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "ArbitraryCreateContractHostFnContext", + "executable", + &self.executable, + "salt", + &&self.salt, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryCreateContractHostFnContext { + #[inline] + fn clone(&self) -> ArbitraryCreateContractHostFnContext { + ArbitraryCreateContractHostFnContext { + executable: ::core::clone::Clone::clone(&self.executable), + salt: ::core::clone::Clone::clone(&self.salt), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryCreateContractHostFnContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryCreateContractHostFnContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryCreateContractHostFnContext { + #[inline] + fn eq(&self, other: &ArbitraryCreateContractHostFnContext) -> bool { + self.executable == other.executable && self.salt == other.salt + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryCreateContractHostFnContext { + #[inline] + fn cmp( + &self, + other: &ArbitraryCreateContractHostFnContext, + ) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.executable, &other.executable) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryCreateContractHostFnContext { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryCreateContractHostFnContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.executable, &other.executable) + { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext: + ::std::thread::LocalKey> = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryCreateContractHostFnContext { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryCreateContractHostFnContext { + executable: arbitrary::Arbitrary::arbitrary(u)?, + salt: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryCreateContractHostFnContext { + executable: arbitrary::Arbitrary::arbitrary(&mut u)?, + salt: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for CreateContractHostFnContext { + type Prototype = ArbitraryCreateContractHostFnContext; + } + impl soroban_sdk::TryFromVal + for CreateContractHostFnContext + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryCreateContractHostFnContext, + ) -> std::result::Result { + Ok(CreateContractHostFnContext { + executable: soroban_sdk::IntoVal::into_val(&v.executable, env), + salt: soroban_sdk::IntoVal::into_val(&v.salt, env), + }) + } + } + }; + pub struct CreateContractWithConstructorHostFnContext { + pub constructor_args: soroban_sdk::Vec, + pub executable: ContractExecutable, + pub salt: soroban_sdk::BytesN<32>, + } + #[automatically_derived] + impl ::core::fmt::Debug for CreateContractWithConstructorHostFnContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "CreateContractWithConstructorHostFnContext", + "constructor_args", + &self.constructor_args, + "executable", + &self.executable, + "salt", + &&self.salt, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for CreateContractWithConstructorHostFnContext { + #[inline] + fn clone(&self) -> CreateContractWithConstructorHostFnContext { + CreateContractWithConstructorHostFnContext { + constructor_args: ::core::clone::Clone::clone(&self.constructor_args), + executable: ::core::clone::Clone::clone(&self.executable), + salt: ::core::clone::Clone::clone(&self.salt), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for CreateContractWithConstructorHostFnContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for CreateContractWithConstructorHostFnContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for CreateContractWithConstructorHostFnContext { + #[inline] + fn eq(&self, other: &CreateContractWithConstructorHostFnContext) -> bool { + self.constructor_args == other.constructor_args + && self.executable == other.executable + && self.salt == other.salt + } + } + #[automatically_derived] + impl ::core::cmp::Ord for CreateContractWithConstructorHostFnContext { + #[inline] + fn cmp( + &self, + other: &CreateContractWithConstructorHostFnContext, + ) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.constructor_args, &other.constructor_args) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.executable, &other.executable) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for CreateContractWithConstructorHostFnContext { + #[inline] + fn partial_cmp( + &self, + other: &CreateContractWithConstructorHostFnContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp( + &self.constructor_args, + &other.constructor_args, + ) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp( + &self.executable, + &other.executable, + ) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_CREATECONTRACTWITHCONSTRUCTORHOSTFNCONTEXT: [u8; 164usize] = + CreateContractWithConstructorHostFnContext::spec_xdr(); + impl CreateContractWithConstructorHostFnContext { + pub const fn spec_xdr() -> [u8; 164usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0*CreateContractWithConstructorHostFnContext\0\0\0\0\0\x03\0\0\0\0\0\0\0\x10constructor_args\0\0\x03\xea\0\0\0\0\0\0\0\0\0\0\0\nexecutable\0\0\0\0\x07\xd0\0\0\0\x12ContractExecutable\0\0\0\0\0\0\0\0\0\x04salt\0\0\x03\xee\0\0\0 " + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for CreateContractWithConstructorHostFnContext { + const SPEC_TYPE_ID: [u8; 32] = *b"\xd2;\xff\xe6\x97\xda;\x83c$F\x15Z\xf1r\xf4\xc18\xfda!\x0b\r\x87\x88\xa0\x9a\x08Yu\xccS"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CREATECONTRACTWITHCONSTRUCTORHOSTFNCONTEXT: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, + >( + 2, + *b"\xd2;\xff\xe6\x97\xda;\x83c$F\x15Z\xf1r\xf4\xc18\xfda!\x0b\r\x87\x88\xa0\x9a\x08Yu\xccS", + [::SPEC_TYPE_ID], + ); + impl soroban_sdk::TryFromVal + for CreateContractWithConstructorHostFnContext + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["constructor_args", "executable", "salt"]; + let mut vals: [Val; 3usize] = [Val::VOID.to_val(); 3usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + constructor_args: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + executable: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + salt: vals[2] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal + for soroban_sdk::Val + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &CreateContractWithConstructorHostFnContext, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["constructor_args", "executable", "salt"]; + let vals: [Val; 3usize] = [ + (&val.constructor_args) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.executable) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.salt).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal + for soroban_sdk::Val + { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&CreateContractWithConstructorHostFnContext, + ) -> Result { + <_ as soroban_sdk::TryFromVal< + soroban_sdk::Env, + CreateContractWithConstructorHostFnContext, + >>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal + for CreateContractWithConstructorHostFnContext + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 3usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + constructor_args: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "constructor_args" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + executable: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "executable" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + salt: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "salt" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal + for CreateContractWithConstructorHostFnContext + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&CreateContractWithConstructorHostFnContext> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: &CreateContractWithConstructorHostFnContext, + ) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "constructor_args" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.constructor_args) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "executable" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.executable) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "salt" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.salt) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } + } + impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: CreateContractWithConstructorHostFnContext, + ) -> Result { + (&val).try_into() + } + } + impl TryFrom<&CreateContractWithConstructorHostFnContext> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: &CreateContractWithConstructorHostFnContext, + ) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: CreateContractWithConstructorHostFnContext, + ) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryCreateContractWithConstructorHostFnContext { + constructor_args: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + executable: ::Prototype, + salt: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "ArbitraryCreateContractWithConstructorHostFnContext", + "constructor_args", + &self.constructor_args, + "executable", + &self.executable, + "salt", + &&self.salt, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn clone(&self) -> ArbitraryCreateContractWithConstructorHostFnContext { + ArbitraryCreateContractWithConstructorHostFnContext { + constructor_args: ::core::clone::Clone::clone(&self.constructor_args), + executable: ::core::clone::Clone::clone(&self.executable), + salt: ::core::clone::Clone::clone(&self.salt), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryCreateContractWithConstructorHostFnContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn eq(&self, other: &ArbitraryCreateContractWithConstructorHostFnContext) -> bool { + self.constructor_args == other.constructor_args + && self.executable == other.executable + && self.salt == other.salt + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn cmp( + &self, + other: &ArbitraryCreateContractWithConstructorHostFnContext, + ) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.constructor_args, &other.constructor_args) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.executable, &other.executable) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryCreateContractWithConstructorHostFnContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp( + &self.constructor_args, + &other.constructor_args, + ) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp( + &self.executable, + &other.executable, + ) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext: + ::std::thread::LocalKey> = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> + for ArbitraryCreateContractWithConstructorHostFnContext + { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext + .with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryCreateContractWithConstructorHostFnContext { + constructor_args: arbitrary::Arbitrary::arbitrary(u)?, + executable: arbitrary::Arbitrary::arbitrary(u)?, + salt: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext + .with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext + .with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryCreateContractWithConstructorHostFnContext { + constructor_args: arbitrary::Arbitrary::arbitrary(&mut u)?, + executable: arbitrary::Arbitrary::arbitrary(&mut u)?, + salt: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext + .with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary + for CreateContractWithConstructorHostFnContext + { + type Prototype = ArbitraryCreateContractWithConstructorHostFnContext; + } + impl + soroban_sdk::TryFromVal< + soroban_sdk::Env, + ArbitraryCreateContractWithConstructorHostFnContext, + > for CreateContractWithConstructorHostFnContext + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryCreateContractWithConstructorHostFnContext, + ) -> std::result::Result { + Ok(CreateContractWithConstructorHostFnContext { + constructor_args: soroban_sdk::IntoVal::into_val(&v.constructor_args, env), + executable: soroban_sdk::IntoVal::into_val(&v.executable, env), + salt: soroban_sdk::IntoVal::into_val(&v.salt, env), + }) + } + } + }; + pub enum Context { + Contract(ContractContext), + CreateContractHostFn(CreateContractHostFnContext), + CreateContractWithCtorHostFn(CreateContractWithConstructorHostFnContext), + } + #[automatically_derived] + impl ::core::fmt::Debug for Context { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + Context::Contract(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Contract", &__self_0) + } + Context::CreateContractHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractHostFn", + &__self_0, + ) + } + Context::CreateContractWithCtorHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractWithCtorHostFn", + &__self_0, + ) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for Context { + #[inline] + fn clone(&self) -> Context { + match self { + Context::Contract(__self_0) => { + Context::Contract(::core::clone::Clone::clone(__self_0)) + } + Context::CreateContractHostFn(__self_0) => { + Context::CreateContractHostFn(::core::clone::Clone::clone(__self_0)) + } + Context::CreateContractWithCtorHostFn(__self_0) => { + Context::CreateContractWithCtorHostFn(::core::clone::Clone::clone(__self_0)) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for Context { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for Context {} + #[automatically_derived] + impl ::core::cmp::PartialEq for Context { + #[inline] + fn eq(&self, other: &Context) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + (Context::Contract(__self_0), Context::Contract(__arg1_0)) => { + __self_0 == __arg1_0 + } + ( + Context::CreateContractHostFn(__self_0), + Context::CreateContractHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + ( + Context::CreateContractWithCtorHostFn(__self_0), + Context::CreateContractWithCtorHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for Context { + #[inline] + fn cmp(&self, other: &Context) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + (Context::Contract(__self_0), Context::Contract(__arg1_0)) => { + ::core::cmp::Ord::cmp(__self_0, __arg1_0) + } + ( + Context::CreateContractHostFn(__self_0), + Context::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + Context::CreateContractWithCtorHostFn(__self_0), + Context::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for Context { + #[inline] + fn partial_cmp( + &self, + other: &Context, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + (Context::Contract(__self_0), Context::Contract(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + ( + Context::CreateContractHostFn(__self_0), + Context::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + Context::CreateContractWithCtorHostFn(__self_0), + Context::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + pub static __SPEC_XDR_TYPE_CONTEXT: [u8; 244usize] = Context::spec_xdr(); + impl Context { + pub const fn spec_xdr() -> [u8; 244usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x07Context\0\0\0\0\x03\0\0\0\x01\0\0\0\0\0\0\0\x08Contract\0\0\0\x01\0\0\x07\xd0\0\0\0\x0fContractContext\0\0\0\0\x01\0\0\0\0\0\0\0\x14CreateContractHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0\x1bCreateContractHostFnContext\0\0\0\0\x01\0\0\0\0\0\0\0\x1cCreateContractWithCtorHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0*CreateContractWithConstructorHostFnContext\0\0" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for Context { + const SPEC_TYPE_ID: [u8; 32] = *b"\r\xb6\x0b\xec\x8f\xd04l1\xb3-\xa0{\x90\xa3\xc2\xab\x93\xd4\x82x\xe1_\x8a\xa8N?.\xcd\xc1\xfc\x08"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CONTEXT: [u8; 138usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 138usize, + 3usize, + >( + 2, + *b"\r\xb6\x0b\xec\x8f\xd04l1\xb3-\xa0{\x90\xa3\xc2\xab\x93\xd4\x82x\xe1_\x8a\xa8N?.\xcd\xc1\xfc\x08", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); + impl soroban_sdk::TryFromVal for Context { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &[ + "Contract", + "CreateContractHostFn", + "CreateContractWithCtorHostFn", + ]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Contract( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 2 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractWithCtorHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &Context, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + Context::Contract(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Contract")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + Context::CreateContractHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"CreateContractHostFn")? + .to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + Context::CreateContractWithCtorHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val( + env, + &"CreateContractWithCtorHostFn", + )? + .to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&Context, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal for Context { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "Contract" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::Contract( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "CreateContractHostFn" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::CreateContractHostFn( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "CreateContractWithCtorHostFn" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::CreateContractWithCtorHostFn( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl soroban_sdk::TryFromVal for Context { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&Context> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &Context) -> Result { + extern crate alloc; + Ok(match val { + Context::Contract(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Contract" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + Context::CreateContractHostFn(value0) => ( + soroban_sdk::xdr::ScSymbol( + "CreateContractHostFn" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + Context::CreateContractWithCtorHostFn(value0) => ( + soroban_sdk::xdr::ScSymbol( + "CreateContractWithCtorHostFn" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Context) -> Result { + (&val).try_into() + } + } + impl TryFrom<&Context> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &Context) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Context) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryContext { + Contract( + ::Prototype, + ), + CreateContractHostFn( + ::Prototype, + ), + CreateContractWithCtorHostFn( + ::Prototype, + ), + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryContext::Contract(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, "Contract", &__self_0, + ) + } + ArbitraryContext::CreateContractHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractHostFn", + &__self_0, + ) + } + ArbitraryContext::CreateContractWithCtorHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractWithCtorHostFn", + &__self_0, + ) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryContext { + #[inline] + fn clone(&self) -> ArbitraryContext { + match self { + ArbitraryContext::Contract(__self_0) => { + ArbitraryContext::Contract(::core::clone::Clone::clone(__self_0)) + } + ArbitraryContext::CreateContractHostFn(__self_0) => { + ArbitraryContext::CreateContractHostFn(::core::clone::Clone::clone( + __self_0, + )) + } + ArbitraryContext::CreateContractWithCtorHostFn(__self_0) => { + ArbitraryContext::CreateContractWithCtorHostFn( + ::core::clone::Clone::clone(__self_0), + ) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryContext { + #[inline] + fn eq(&self, other: &ArbitraryContext) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + ArbitraryContext::Contract(__self_0), + ArbitraryContext::Contract(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryContext::CreateContractHostFn(__self_0), + ArbitraryContext::CreateContractHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryContext::CreateContractWithCtorHostFn(__self_0), + ArbitraryContext::CreateContractWithCtorHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryContext { + #[inline] + fn cmp(&self, other: &ArbitraryContext) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + ArbitraryContext::Contract(__self_0), + ArbitraryContext::Contract(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryContext::CreateContractHostFn(__self_0), + ArbitraryContext::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryContext::CreateContractWithCtorHostFn(__self_0), + ArbitraryContext::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryContext { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + ArbitraryContext::Contract(__self_0), + ArbitraryContext::Contract(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + ArbitraryContext::CreateContractHostFn(__self_0), + ArbitraryContext::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + ArbitraryContext::CreateContractWithCtorHostFn(__self_0), + ArbitraryContext::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryContext: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryContext { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) + * 3u64) + >> 32 + { + 0u64 => ArbitraryContext::Contract( + arbitrary::Arbitrary::arbitrary(u)?, + ), + 1u64 => ArbitraryContext::CreateContractHostFn( + arbitrary::Arbitrary::arbitrary(u)?, + ), + 2u64 => ArbitraryContext::CreateContractWithCtorHostFn( + arbitrary::Arbitrary::arbitrary(u)?, + ), + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) + * 3u64) + >> 32 + { + 0u64 => ArbitraryContext::Contract( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 1u64 => ArbitraryContext::CreateContractHostFn( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 2u64 => ArbitraryContext::CreateContractWithCtorHostFn( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for Context { + type Prototype = ArbitraryContext; + } + impl soroban_sdk::TryFromVal for Context { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryContext, + ) -> std::result::Result { + Ok(match v { + ArbitraryContext::Contract(field_0) => { + Context::Contract(soroban_sdk::IntoVal::into_val(field_0, env)) + } + ArbitraryContext::CreateContractHostFn(field_0) => { + Context::CreateContractHostFn(soroban_sdk::IntoVal::into_val( + field_0, env, + )) + } + ArbitraryContext::CreateContractWithCtorHostFn(field_0) => { + Context::CreateContractWithCtorHostFn(soroban_sdk::IntoVal::into_val( + field_0, env, + )) + } + }) + } + } + }; + pub enum ContractExecutable { + Wasm(soroban_sdk::BytesN<32>), + } + #[automatically_derived] + impl ::core::fmt::Debug for ContractExecutable { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ContractExecutable::Wasm(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm", &__self_0) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ContractExecutable { + #[inline] + fn clone(&self) -> ContractExecutable { + match self { + ContractExecutable::Wasm(__self_0) => { + ContractExecutable::Wasm(::core::clone::Clone::clone(__self_0)) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ContractExecutable { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ContractExecutable {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ContractExecutable { + #[inline] + fn eq(&self, other: &ContractExecutable) -> bool { + match (self, other) { + (ContractExecutable::Wasm(__self_0), ContractExecutable::Wasm(__arg1_0)) => { + __self_0 == __arg1_0 + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ContractExecutable { + #[inline] + fn cmp(&self, other: &ContractExecutable) -> ::core::cmp::Ordering { + match (self, other) { + (ContractExecutable::Wasm(__self_0), ContractExecutable::Wasm(__arg1_0)) => { + ::core::cmp::Ord::cmp(__self_0, __arg1_0) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ContractExecutable { + #[inline] + fn partial_cmp( + &self, + other: &ContractExecutable, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match (self, other) { + (ContractExecutable::Wasm(__self_0), ContractExecutable::Wasm(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + } + } + } + pub static __SPEC_XDR_TYPE_CONTRACTEXECUTABLE: [u8; 68usize] = + ContractExecutable::spec_xdr(); + impl ContractExecutable { + pub const fn spec_xdr() -> [u8; 68usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x12ContractExecutable\0\0\0\0\0\x01\0\0\0\x01\0\0\0\0\0\0\0\x04Wasm\0\0\0\x01\0\0\x03\xee\0\0\0 " + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for ContractExecutable { + const SPEC_TYPE_ID: [u8; 32] = *b"^\xbe34\xd8\x99\x84\x91\x81\x9fu\x9fu\x05\xb8\xb4\x14\x95\xb7\x9d|\x06$\x04y\xe9\"\xb9\x14\xfc\xf9\x85"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CONTRACTEXECUTABLE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"^\xbe34\xd8\x99\x84\x91\x81\x9fu\x9fu\x05\xb8\xb4\x14\x95\xb7\x9d|\x06$\x04y\xe9\"\xb9\x14\xfc\xf9\x85", + [], + ); + impl soroban_sdk::TryFromVal for ContractExecutable { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["Wasm"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Wasm( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &ContractExecutable, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + ContractExecutable::Wasm(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Wasm")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&ContractExecutable, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + impl soroban_sdk::TryFromVal for ContractExecutable { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "Wasm" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::Wasm( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl soroban_sdk::TryFromVal for ContractExecutable { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&ContractExecutable> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &ContractExecutable) -> Result { + extern crate alloc; + Ok(match val { + ContractExecutable::Wasm(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Wasm" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: ContractExecutable) -> Result { + (&val).try_into() + } + } + impl TryFrom<&ContractExecutable> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &ContractExecutable) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: ContractExecutable) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryContractExecutable { + Wasm( + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + ), + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryContractExecutable { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryContractExecutable::Wasm(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm", &__self_0) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryContractExecutable { + #[inline] + fn clone(&self) -> ArbitraryContractExecutable { + match self { + ArbitraryContractExecutable::Wasm(__self_0) => { + ArbitraryContractExecutable::Wasm(::core::clone::Clone::clone(__self_0)) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryContractExecutable { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryContractExecutable {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryContractExecutable { + #[inline] + fn eq(&self, other: &ArbitraryContractExecutable) -> bool { + match (self, other) { + ( + ArbitraryContractExecutable::Wasm(__self_0), + ArbitraryContractExecutable::Wasm(__arg1_0), + ) => __self_0 == __arg1_0, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryContractExecutable { + #[inline] + fn cmp(&self, other: &ArbitraryContractExecutable) -> ::core::cmp::Ordering { + match (self, other) { + ( + ArbitraryContractExecutable::Wasm(__self_0), + ArbitraryContractExecutable::Wasm(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryContractExecutable { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryContractExecutable, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match (self, other) { + ( + ArbitraryContractExecutable::Wasm(__self_0), + ArbitraryContractExecutable::Wasm(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryContractExecutable: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryContractExecutable { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractExecutable.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) + * 1u64) + >> 32 + { + 0u64 => ArbitraryContractExecutable::Wasm( + arbitrary::Arbitrary::arbitrary(u)?, + ), + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractExecutable.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractExecutable.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) + * 1u64) + >> 32 + { + 0u64 => ArbitraryContractExecutable::Wasm( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractExecutable.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for ContractExecutable { + type Prototype = ArbitraryContractExecutable; + } + impl soroban_sdk::TryFromVal for ContractExecutable { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryContractExecutable, + ) -> std::result::Result { + Ok(match v { + ArbitraryContractExecutable::Wasm(field_0) => { + ContractExecutable::Wasm(soroban_sdk::IntoVal::into_val(field_0, env)) + } + }) + } + } + }; + pub enum InvokerContractAuthEntry { + Contract(SubContractInvocation), + CreateContractHostFn(CreateContractHostFnContext), + CreateContractWithCtorHostFn(CreateContractWithConstructorHostFnContext), + } + #[automatically_derived] + impl ::core::fmt::Debug for InvokerContractAuthEntry { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + InvokerContractAuthEntry::Contract(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Contract", &__self_0) + } + InvokerContractAuthEntry::CreateContractHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractHostFn", + &__self_0, + ) + } + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractWithCtorHostFn", + &__self_0, + ) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for InvokerContractAuthEntry { + #[inline] + fn clone(&self) -> InvokerContractAuthEntry { + match self { + InvokerContractAuthEntry::Contract(__self_0) => { + InvokerContractAuthEntry::Contract(::core::clone::Clone::clone(__self_0)) + } + InvokerContractAuthEntry::CreateContractHostFn(__self_0) => { + InvokerContractAuthEntry::CreateContractHostFn(::core::clone::Clone::clone( + __self_0, + )) + } + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0) => { + InvokerContractAuthEntry::CreateContractWithCtorHostFn( + ::core::clone::Clone::clone(__self_0), + ) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for InvokerContractAuthEntry { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for InvokerContractAuthEntry {} + #[automatically_derived] + impl ::core::cmp::PartialEq for InvokerContractAuthEntry { + #[inline] + fn eq(&self, other: &InvokerContractAuthEntry) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + InvokerContractAuthEntry::Contract(__self_0), + InvokerContractAuthEntry::Contract(__arg1_0), + ) => __self_0 == __arg1_0, + ( + InvokerContractAuthEntry::CreateContractHostFn(__self_0), + InvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + ( + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0), + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for InvokerContractAuthEntry { + #[inline] + fn cmp(&self, other: &InvokerContractAuthEntry) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + InvokerContractAuthEntry::Contract(__self_0), + InvokerContractAuthEntry::Contract(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractHostFn(__self_0), + InvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0), + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for InvokerContractAuthEntry { + #[inline] + fn partial_cmp( + &self, + other: &InvokerContractAuthEntry, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + InvokerContractAuthEntry::Contract(__self_0), + InvokerContractAuthEntry::Contract(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractHostFn(__self_0), + InvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0), + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + pub static __SPEC_XDR_TYPE_INVOKERCONTRACTAUTHENTRY: [u8; 268usize] = + InvokerContractAuthEntry::spec_xdr(); + impl InvokerContractAuthEntry { + pub const fn spec_xdr() -> [u8; 268usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x18InvokerContractAuthEntry\0\0\0\x03\0\0\0\x01\0\0\0\0\0\0\0\x08Contract\0\0\0\x01\0\0\x07\xd0\0\0\0\x15SubContractInvocation\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x14CreateContractHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0\x1bCreateContractHostFnContext\0\0\0\0\x01\0\0\0\0\0\0\0\x1cCreateContractWithCtorHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0*CreateContractWithConstructorHostFnContext\0\0" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for InvokerContractAuthEntry { + const SPEC_TYPE_ID: [u8; 32] = *b"\xf0{\xa6\xe9r\xf3\x10\xf6\x0b)\xdb\x8e\r\xea\xe0\xa0\x89\xca\x1a\x1c\x12\xf8\x8f'K\xda\x9b\x87\xab\xaa\xf8="; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_INVOKERCONTRACTAUTHENTRY: [u8; 138usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 138usize, + 3usize, + >( + 2, + *b"\xf0{\xa6\xe9r\xf3\x10\xf6\x0b)\xdb\x8e\r\xea\xe0\xa0\x89\xca\x1a\x1c\x12\xf8\x8f'K\xda\x9b\x87\xab\xaa\xf8=", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); + impl soroban_sdk::TryFromVal for InvokerContractAuthEntry { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &[ + "Contract", + "CreateContractHostFn", + "CreateContractWithCtorHostFn", + ]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Contract( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 2 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractWithCtorHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &InvokerContractAuthEntry, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + InvokerContractAuthEntry::Contract(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Contract")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + InvokerContractAuthEntry::CreateContractHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"CreateContractHostFn")? + .to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + InvokerContractAuthEntry::CreateContractWithCtorHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val( + env, + &"CreateContractWithCtorHostFn", + )? + .to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&InvokerContractAuthEntry, + ) -> Result { + <_ as soroban_sdk::TryFromVal< + soroban_sdk::Env, + InvokerContractAuthEntry, + >>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal + for InvokerContractAuthEntry + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "Contract" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::Contract( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "CreateContractHostFn" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::CreateContractHostFn( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "CreateContractWithCtorHostFn" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::CreateContractWithCtorHostFn( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl soroban_sdk::TryFromVal + for InvokerContractAuthEntry + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&InvokerContractAuthEntry> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &InvokerContractAuthEntry) -> Result { + extern crate alloc; + Ok(match val { + InvokerContractAuthEntry::Contract(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Contract" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + InvokerContractAuthEntry::CreateContractHostFn(value0) => ( + soroban_sdk::xdr::ScSymbol( + "CreateContractHostFn" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + InvokerContractAuthEntry::CreateContractWithCtorHostFn(value0) => ( + soroban_sdk::xdr::ScSymbol( + "CreateContractWithCtorHostFn" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: InvokerContractAuthEntry) -> Result { + (&val).try_into() + } + } + impl TryFrom<&InvokerContractAuthEntry> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &InvokerContractAuthEntry) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: InvokerContractAuthEntry) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryInvokerContractAuthEntry { + Contract( + ::Prototype, + ), + CreateContractHostFn( + ::Prototype, + ), + CreateContractWithCtorHostFn( + ::Prototype, + ), + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryInvokerContractAuthEntry { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryInvokerContractAuthEntry::Contract(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, "Contract", &__self_0, + ) + } + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractHostFn", + &__self_0, + ) + } + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __self_0, + ) => ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractWithCtorHostFn", + &__self_0, + ), + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryInvokerContractAuthEntry { + #[inline] + fn clone(&self) -> ArbitraryInvokerContractAuthEntry { + match self { + ArbitraryInvokerContractAuthEntry::Contract(__self_0) => { + ArbitraryInvokerContractAuthEntry::Contract( + ::core::clone::Clone::clone(__self_0), + ) + } + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0) => { + ArbitraryInvokerContractAuthEntry::CreateContractHostFn( + ::core::clone::Clone::clone(__self_0), + ) + } + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __self_0, + ) => ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + ::core::clone::Clone::clone(__self_0), + ), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryInvokerContractAuthEntry { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryInvokerContractAuthEntry {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryInvokerContractAuthEntry { + #[inline] + fn eq(&self, other: &ArbitraryInvokerContractAuthEntry) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + ArbitraryInvokerContractAuthEntry::Contract(__self_0), + ArbitraryInvokerContractAuthEntry::Contract(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0), + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __self_0, + ), + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __arg1_0, + ), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryInvokerContractAuthEntry { + #[inline] + fn cmp(&self, other: &ArbitraryInvokerContractAuthEntry) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + ArbitraryInvokerContractAuthEntry::Contract(__self_0), + ArbitraryInvokerContractAuthEntry::Contract(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0), + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __self_0, + ), + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __arg1_0, + ), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryInvokerContractAuthEntry { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryInvokerContractAuthEntry, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + ArbitraryInvokerContractAuthEntry::Contract(__self_0), + ArbitraryInvokerContractAuthEntry::Contract(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0), + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __self_0, + ), + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __arg1_0, + ), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryInvokerContractAuthEntry { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from( + ::arbitrary(u)?, + ) * 3u64) >> 32 + { + 0u64 => { + ArbitraryInvokerContractAuthEntry::Contract( + arbitrary::Arbitrary::arbitrary(u)?, + ) + } + 1u64 => { + ArbitraryInvokerContractAuthEntry::CreateContractHostFn( + arbitrary::Arbitrary::arbitrary(u)?, + ) + } + 2u64 => { + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + arbitrary::Arbitrary::arbitrary(u)?, + ) + } + _ => { + ::core::panicking::panic( + "internal error: entered unreachable code", + ) + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from( + ::arbitrary(&mut u)?, + ) * 3u64) >> 32 + { + 0u64 => { + ArbitraryInvokerContractAuthEntry::Contract( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ) + } + 1u64 => { + ArbitraryInvokerContractAuthEntry::CreateContractHostFn( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ) + } + 2u64 => { + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ) + } + _ => { + ::core::panicking::panic( + "internal error: entered unreachable code", + ) + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for InvokerContractAuthEntry { + type Prototype = ArbitraryInvokerContractAuthEntry; + } + impl soroban_sdk::TryFromVal + for InvokerContractAuthEntry + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryInvokerContractAuthEntry, + ) -> std::result::Result { + Ok(match v { + ArbitraryInvokerContractAuthEntry::Contract(field_0) => { + InvokerContractAuthEntry::Contract(soroban_sdk::IntoVal::into_val( + field_0, env, + )) + } + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(field_0) => { + InvokerContractAuthEntry::CreateContractHostFn( + soroban_sdk::IntoVal::into_val(field_0, env), + ) + } + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + field_0, + ) => InvokerContractAuthEntry::CreateContractWithCtorHostFn( + soroban_sdk::IntoVal::into_val(field_0, env), + ), + }) + } + } + }; + pub enum Executable { + Wasm(soroban_sdk::BytesN<32>), + StellarAsset, + Account, + } + #[automatically_derived] + impl ::core::fmt::Debug for Executable { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + Executable::Wasm(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm", &__self_0) + } + Executable::StellarAsset => { + ::core::fmt::Formatter::write_str(f, "StellarAsset") + } + Executable::Account => ::core::fmt::Formatter::write_str(f, "Account"), + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for Executable { + #[inline] + fn clone(&self) -> Executable { + match self { + Executable::Wasm(__self_0) => { + Executable::Wasm(::core::clone::Clone::clone(__self_0)) + } + Executable::StellarAsset => Executable::StellarAsset, + Executable::Account => Executable::Account, + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for Executable { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for Executable {} + #[automatically_derived] + impl ::core::cmp::PartialEq for Executable { + #[inline] + fn eq(&self, other: &Executable) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + (Executable::Wasm(__self_0), Executable::Wasm(__arg1_0)) => { + __self_0 == __arg1_0 + } + _ => true, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for Executable { + #[inline] + fn cmp(&self, other: &Executable) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + (Executable::Wasm(__self_0), Executable::Wasm(__arg1_0)) => { + ::core::cmp::Ord::cmp(__self_0, __arg1_0) + } + _ => ::core::cmp::Ordering::Equal, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for Executable { + #[inline] + fn partial_cmp( + &self, + other: &Executable, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + (Executable::Wasm(__self_0), Executable::Wasm(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + pub static __SPEC_XDR_TYPE_EXECUTABLE: [u8; 104usize] = Executable::spec_xdr(); + impl Executable { + pub const fn spec_xdr() -> [u8; 104usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\nExecutable\0\0\0\0\0\x03\0\0\0\x01\0\0\0\0\0\0\0\x04Wasm\0\0\0\x01\0\0\x03\xee\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\x0cStellarAsset\0\0\0\0\0\0\0\0\0\0\0\x07Account\0" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for Executable { + const SPEC_TYPE_ID: [u8; 32] = *b"L|{\r\xf4\xf2\x1a\xa8\xf6\x981\xe2K\xcb\x824N\xe6\x97\xed\xdf\xc2\x1cck\xd6\xceW\x9cx\x10\x1e"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_EXECUTABLE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"L|{\r\xf4\xf2\x1a\xa8\xf6\x981\xe2K\xcb\x824N\xe6\x97\xed\xdf\xc2\x1cck\xd6\xceW\x9cx\x10\x1e", + [], + ); + impl soroban_sdk::TryFromVal for Executable { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["Wasm", "StellarAsset", "Account"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Wasm( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 0 { + return Err(soroban_sdk::ConversionError); + } + Self::StellarAsset + } + 2 => { + if iter.len() > 0 { + return Err(soroban_sdk::ConversionError); + } + Self::Account + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &Executable, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + Executable::Wasm(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Wasm")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + Executable::StellarAsset => { + let tup: (soroban_sdk::Val,) = + (soroban_sdk::Symbol::try_from_val(env, &"StellarAsset")?.to_val(),); + tup.try_into_val(env).map_err(Into::into) + } + Executable::Account => { + let tup: (soroban_sdk::Val,) = + (soroban_sdk::Symbol::try_from_val(env, &"Account")?.to_val(),); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&Executable, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + impl soroban_sdk::TryFromVal for Executable { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "Wasm" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::Wasm( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "StellarAsset" => { + if iter.len() > 0 { + return Err(soroban_sdk::xdr::Error::Invalid); + } + Self::StellarAsset + } + "Account" => { + if iter.len() > 0 { + return Err(soroban_sdk::xdr::Error::Invalid); + } + Self::Account + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl soroban_sdk::TryFromVal for Executable { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&Executable> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &Executable) -> Result { + extern crate alloc; + Ok(match val { + Executable::Wasm(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Wasm" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + Executable::StellarAsset => { + let symbol = soroban_sdk::xdr::ScSymbol( + "StellarAsset" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ); + let val = soroban_sdk::xdr::ScVal::Symbol(symbol); + (val,) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + } + Executable::Account => { + let symbol = soroban_sdk::xdr::ScSymbol( + "Account" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ); + let val = soroban_sdk::xdr::ScVal::Symbol(symbol); + (val,) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + } + }) + } + } + impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Executable) -> Result { + (&val).try_into() + } + } + impl TryFrom<&Executable> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &Executable) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Executable) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryExecutable { + Wasm( + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + ), + StellarAsset, + Account, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryExecutable { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryExecutable::Wasm(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm", &__self_0) + } + ArbitraryExecutable::StellarAsset => { + ::core::fmt::Formatter::write_str(f, "StellarAsset") + } + ArbitraryExecutable::Account => { + ::core::fmt::Formatter::write_str(f, "Account") + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryExecutable { + #[inline] + fn clone(&self) -> ArbitraryExecutable { + match self { + ArbitraryExecutable::Wasm(__self_0) => { + ArbitraryExecutable::Wasm(::core::clone::Clone::clone(__self_0)) + } + ArbitraryExecutable::StellarAsset => ArbitraryExecutable::StellarAsset, + ArbitraryExecutable::Account => ArbitraryExecutable::Account, + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryExecutable { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryExecutable {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryExecutable { + #[inline] + fn eq(&self, other: &ArbitraryExecutable) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + ArbitraryExecutable::Wasm(__self_0), + ArbitraryExecutable::Wasm(__arg1_0), + ) => __self_0 == __arg1_0, + _ => true, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryExecutable { + #[inline] + fn cmp(&self, other: &ArbitraryExecutable) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + ArbitraryExecutable::Wasm(__self_0), + ArbitraryExecutable::Wasm(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => ::core::cmp::Ordering::Equal, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryExecutable { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryExecutable, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + ArbitraryExecutable::Wasm(__self_0), + ArbitraryExecutable::Wasm(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryExecutable: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryExecutable { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryExecutable.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) + * 3u64) + >> 32 + { + 0u64 => ArbitraryExecutable::Wasm( + arbitrary::Arbitrary::arbitrary(u)?, + ), + 1u64 => ArbitraryExecutable::StellarAsset, + 2u64 => ArbitraryExecutable::Account, + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryExecutable.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryExecutable.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) + * 3u64) + >> 32 + { + 0u64 => ArbitraryExecutable::Wasm( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 1u64 => ArbitraryExecutable::StellarAsset, + 2u64 => ArbitraryExecutable::Account, + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryExecutable.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all(&[]), + arbitrary::size_hint::and_all(&[]), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for Executable { + type Prototype = ArbitraryExecutable; + } + impl soroban_sdk::TryFromVal for Executable { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryExecutable, + ) -> std::result::Result { + Ok(match v { + ArbitraryExecutable::Wasm(field_0) => { + Executable::Wasm(soroban_sdk::IntoVal::into_val(field_0, env)) + } + ArbitraryExecutable::StellarAsset => Executable::StellarAsset, + ArbitraryExecutable::Account => Executable::Account, + }) + } + } + }; } extern crate test; #[rustc_test_marker = "test_with_wasm::test_exec"] diff --git a/tests-expanded/test_associated_types_contracttrait_wasm32v1-none.rs b/tests-expanded/test_associated_types_contracttrait_wasm32v1-none.rs index 355082368..0d5722a98 100644 --- a/tests-expanded/test_associated_types_contracttrait_wasm32v1-none.rs +++ b/tests-expanded/test_associated_types_contracttrait_wasm32v1-none.rs @@ -146,6 +146,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x04exec\0\0\0\0\0\0\0\x01\0\0\0\x10" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EXEC: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xa5 5J;P\x91\x10g\xe9\x0eC967\xc5\x13\xe6#\xb2\xa0Wtv\xeeL\xed\xa1\x96]z\xf2", + [], + ); impl<'a> ContractClient<'a> { pub fn exec(&self) -> String { use core::ops::Not; @@ -223,6 +231,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x05exec2\0\0\0\0\0\0\0\0\0\0\x01\0\0\0\x10" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EXEC2: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xd36\xb8\x8ccHo\x01\x9cik\xcf)Di6HNGLxS\x0f\xbc\xf2\x14\xfd\x15j\x94F\xf0", + [], + ); impl<'a> ContractClient<'a> { pub fn exec2(&self) -> String { use core::ops::Not; diff --git a/tests-expanded/test_associated_types_tests.rs b/tests-expanded/test_associated_types_tests.rs index 28b337c10..afa3e0231 100644 --- a/tests-expanded/test_associated_types_tests.rs +++ b/tests-expanded/test_associated_types_tests.rs @@ -169,6 +169,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x04exec\0\0\0\0\0\0\0\x01\0\0\0\x10" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EXEC: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xa5 5J;P\x91\x10g\xe9\x0eC967\xc5\x13\xe6#\xb2\xa0Wtv\xeeL\xed\xa1\x96]z\xf2", + [], + ); impl<'a> ContractClient<'a> { pub fn exec(&self) -> String { use core::ops::Not; diff --git a/tests-expanded/test_associated_types_wasm32v1-none.rs b/tests-expanded/test_associated_types_wasm32v1-none.rs index 850fcd958..b834dbdd2 100644 --- a/tests-expanded/test_associated_types_wasm32v1-none.rs +++ b/tests-expanded/test_associated_types_wasm32v1-none.rs @@ -58,6 +58,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x04exec\0\0\0\0\0\0\0\x01\0\0\0\x10" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EXEC: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xa5 5J;P\x91\x10g\xe9\x0eC967\xc5\x13\xe6#\xb2\xa0Wtv\xeeL\xed\xa1\x96]z\xf2", + [], + ); impl<'a> ContractClient<'a> { pub fn exec(&self) -> String { use core::ops::Not; diff --git a/tests-expanded/test_auth_tests.rs b/tests-expanded/test_auth_tests.rs index 075ea8b10..a4c4647b4 100644 --- a/tests-expanded/test_auth_tests.rs +++ b/tests-expanded/test_auth_tests.rs @@ -156,6 +156,15 @@ impl ContractA { *b"\0\0\0\0\0\0\0\0\0\0\0\x03fn1\0\0\0\0\x01\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x13\0\0\0\x01\0\0\0\x06" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTA_FN1: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"U#\xb4\xa8;\n\xa3\x17\x06\x11\xa7P\x8dz\x1a4\x12\xd0\xde\xa4y\xa3\xc1VQ\x94G\x01\xd5\x14|(", + [], +); impl<'a> ContractAClient<'a> { pub fn fn1(&self, a: &Address) -> u64 { use core::ops::Not; @@ -819,6 +828,15 @@ mod test_a { *b"\0\0\0\0\0\0\0\0\0\0\0\x0c__check_auth\0\0\0\x03\0\0\0\0\0\0\0\x11signature_payload\0\0\0\0\0\0\0\0\0\0\0\0\0\0\nsignatures\0\0\0\0\0\0\0\0\0\0\0\0\0\x0cauth_context\0\0\0\0\0\0\0\0" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT___CHECK_AUTH: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b"\xa2\xc1v))\xa3\xed\x1em\x90\xb0\x17Hb`G\x14\x9dk\xfb\x9a\x8dN\x83\xe4\xbb\xdc\xce\xdf\x15V\xbb", + [], + ); impl<'a> ContractClient<'a> {} impl ContractArgs { #[inline(always)] @@ -1124,11 +1142,23 @@ mod test_a { *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x05Error\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x07Decline\0\0\0\0\x01" } } - impl soroban_sdk::SpecShakingMarker for Error { + impl soroban_sdk::spec_shaking::SpecTypeId for Error { + const SPEC_TYPE_ID: [u8; 32] = *b"`\xfc\xd6\xce\xb5\x01y\x85\xf2\xcc\xa5\xd8\xd0\xd6\xd9P\xa7I\xa1\x17\x12\x9e\xe9\xee\x9d\r\x94\x07H\xbf\xd6\xdf"; + } + impl soroban_sdk::spec_shaking::SpecShakingMarker for Error { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() {} } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ERROR: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"`\xfc\xd6\xce\xb5\x01y\x85\xf2\xcc\xa5\xd8\xd0\xd6\xd9P\xa7I\xa1\x17\x12\x9e\xe9\xee\x9d\r\x94\x07H\xbf\xd6\xdf", + [], + ); impl TryFrom for Error { type Error = soroban_sdk::Error; #[inline(always)] @@ -1262,6 +1292,15 @@ mod test_a { *b"\0\0\0\0\0\0\0\0\0\0\0\x0c__check_auth\0\0\0\x03\0\0\0\0\0\0\0\x11signature_payload\0\0\0\0\0\0\0\0\0\0\0\0\0\0\nsignatures\0\0\0\0\0\0\0\0\0\0\0\0\0\x0cauth_context\0\0\0\0\0\0\0\x01\0\0\x03\xe9\0\0\0\x02\0\0\0\x03" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT___CHECK_AUTH: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b">\xe2\x0f\x88\xbb\x9a\xd3\x12\x17\x85P\xd7\x140\xe6\xab\x85B$\x84$/\xfc!'\x92\xdca\xca\x90m\x9c", + [], + ); impl<'a> ContractClient<'a> {} impl ContractArgs { #[inline(always)] @@ -1525,6 +1564,15 @@ impl ContractB { *b"\0\0\0\0\0\0\0\0\0\0\0\x03fn2\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x13\0\0\0\0\0\0\0\x03sub\0\0\0\0\x13\0\0\0\x01\0\0\0\x06" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTB_FN2: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x9e\x03\x9b\x84@\xae\x95\xa0\xb5\x02h`(l\xc1\xde\x0bf\xce}\x9d\x04\xba\xffL\xad\x99}m\x9cmI", + [], +); impl<'a> ContractBClient<'a> { pub fn fn2(&self, a: &Address, sub: &Address) -> u64 { use core::ops::Not; @@ -2301,6 +2349,15 @@ mod test_b { *b"\0\0\0\0\0\0\0\0\0\0\0\x0c__check_auth\0\0\0\x03\0\0\0\0\0\0\0\x11signature_payload\0\0\0\0\0\0\0\0\0\0\0\0\0\0\nsignatures\0\0\0\0\0\0\0\0\0\0\0\0\0\x0cauth_context\0\0\0\0\0\0\0\0" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT___CHECK_AUTH: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b"\xa2\xc1v))\xa3\xed\x1em\x90\xb0\x17Hb`G\x14\x9dk\xfb\x9a\x8dN\x83\xe4\xbb\xdc\xce\xdf\x15V\xbb", + [], + ); impl<'a> ContractClient<'a> {} impl ContractArgs { #[inline(always)] @@ -2606,11 +2663,23 @@ mod test_b { *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x05Error\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x07Decline\0\0\0\0\x01" } } - impl soroban_sdk::SpecShakingMarker for Error { + impl soroban_sdk::spec_shaking::SpecTypeId for Error { + const SPEC_TYPE_ID: [u8; 32] = *b"`\xfc\xd6\xce\xb5\x01y\x85\xf2\xcc\xa5\xd8\xd0\xd6\xd9P\xa7I\xa1\x17\x12\x9e\xe9\xee\x9d\r\x94\x07H\xbf\xd6\xdf"; + } + impl soroban_sdk::spec_shaking::SpecShakingMarker for Error { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() {} } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ERROR: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"`\xfc\xd6\xce\xb5\x01y\x85\xf2\xcc\xa5\xd8\xd0\xd6\xd9P\xa7I\xa1\x17\x12\x9e\xe9\xee\x9d\r\x94\x07H\xbf\xd6\xdf", + [], + ); impl TryFrom for Error { type Error = soroban_sdk::Error; #[inline(always)] @@ -2744,6 +2813,15 @@ mod test_b { *b"\0\0\0\0\0\0\0\0\0\0\0\x0c__check_auth\0\0\0\x03\0\0\0\0\0\0\0\x11signature_payload\0\0\0\0\0\0\0\0\0\0\0\0\0\0\nsignatures\0\0\0\0\0\0\0\0\0\0\0\0\0\x0cauth_context\0\0\0\0\0\0\0\x01\0\0\x03\xe9\0\0\0\x02\0\0\0\x03" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT___CHECK_AUTH: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b">\xe2\x0f\x88\xbb\x9a\xd3\x12\x17\x85P\xd7\x140\xe6\xab\x85B$\x84$/\xfc!'\x92\xdca\xca\x90m\x9c", + [], + ); impl<'a> ContractClient<'a> {} impl ContractArgs { #[inline(always)] diff --git a/tests-expanded/test_auth_wasm32v1-none.rs b/tests-expanded/test_auth_wasm32v1-none.rs index f1c274095..0e1e09e08 100644 --- a/tests-expanded/test_auth_wasm32v1-none.rs +++ b/tests-expanded/test_auth_wasm32v1-none.rs @@ -45,6 +45,16 @@ impl ContractA { *b"\0\0\0\0\0\0\0\0\0\0\0\x03fn1\0\0\0\0\x01\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x13\0\0\0\x01\0\0\0\x06" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTA_FN1: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"U#\xb4\xa8;\n\xa3\x17\x06\x11\xa7P\x8dz\x1a4\x12\xd0\xde\xa4y\xa3\xc1VQ\x94G\x01\xd5\x14|(", + [], +); impl<'a> ContractAClient<'a> { pub fn fn1(&self, a: &Address) -> u64 { use core::ops::Not; @@ -156,6 +166,16 @@ impl ContractB { *b"\0\0\0\0\0\0\0\0\0\0\0\x03fn2\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x13\0\0\0\0\0\0\0\x03sub\0\0\0\0\x13\0\0\0\x01\0\0\0\x06" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTB_FN2: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x9e\x03\x9b\x84@\xae\x95\xa0\xb5\x02h`(l\xc1\xde\x0bf\xce}\x9d\x04\xba\xffL\xad\x99}m\x9cmI", + [], +); impl<'a> ContractBClient<'a> { pub fn fn2(&self, a: &Address, sub: &Address) -> u64 { use core::ops::Not; diff --git a/tests-expanded/test_bls_tests.rs b/tests-expanded/test_bls_tests.rs index b1efa2440..85ed7ae32 100644 --- a/tests-expanded/test_bls_tests.rs +++ b/tests-expanded/test_bls_tests.rs @@ -22,17 +22,18 @@ impl DummyProof { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\nDummyProof\0\0\0\0\0\x05\0\0\0\0\0\0\0\x02fp\0\0\0\0\x03\xee\0\0\00\0\0\0\0\0\0\0\x03fp2\0\0\0\x03\xee\0\0\0`\0\0\0\0\0\0\0\x02fr\0\0\0\0\0\x0c\0\0\0\0\0\0\0\x02g1\0\0\0\0\x03\xee\0\0\0`\0\0\0\0\0\0\0\x02g2\0\0\0\0\x03\xee\0\0\0\xc0" } } -impl soroban_sdk::SpecShakingMarker for DummyProof { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - ::spec_shaking_marker(); - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for DummyProof { + const SPEC_TYPE_ID: [u8; 32] = *b"\x85W\0A\xdc~\xb7\"pt\xb6\xb4\x08\x9f\x17\xa7\xb3\xb0\xdf1\xfe\xd6\xc3\xbe]\xce\xe2,\xc0\x95\xa2\xc0"; } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_DUMMYPROOF: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\x85W\0A\xdc~\xb7\"pt\xb6\xb4\x08\x9f\x17\xa7\xb3\xb0\xdf1\xfe\xd6\xc3\xbe]\xce\xe2,\xc0\x95\xa2\xc0", + [], +); impl soroban_sdk::TryFromVal for DummyProof { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -752,6 +753,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06g1_mul\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01p\0\0\0\0\0\x03\xee\0\0\0`\0\0\0\0\0\0\0\x01s\0\0\0\0\0\0\x0c\0\0\0\x01\0\0\x03\xee\0\0\0`" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_G1_MUL: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x1a\xaa\xb3\xc2\x90~\x9f\xa9\x1b\xc8\xd5(\xdd%D\xf6\xaf6c}QT\xfe\x0f\xc1\xafO\r\x8e\x1c\xd0\xfb", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__g2_mul__spec { @@ -766,6 +776,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06g2_mul\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01p\0\0\0\0\0\x03\xee\0\0\0\xc0\0\0\0\0\0\0\0\x01s\0\0\0\0\0\0\x0c\0\0\0\x01\0\0\x03\xee\0\0\0\xc0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_G2_MUL: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xbf\x0fjK\xa3\t\x1f\xc8|\xb7\xb8{:2\xa78\x1a\x18\x89\xc4a\xabm!R\x93\x14\x8b\xb7v\x8f\xe1", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__dummy_verify__spec { @@ -780,6 +799,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0cdummy_verify\0\0\0\x01\0\0\0\0\0\0\0\x05proof\0\0\0\0\0\x07\xd0\0\0\0\nDummyProof\0\0\0\0\0\x01\0\0\0\x01" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_DUMMY_VERIFY: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"\x94q\xb5i\x852\x1fZM0\x8f\xb3\xfaF\xf6J\xf3\xaa\x1e\xeer\x87\xa1\xd6\x89\xae\xb5\xdf\x15U@\xfe", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__fr_vec_get__spec { @@ -794,6 +822,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\nfr_vec_get\0\0\0\0\0\x02\0\0\0\0\0\0\0\x06values\0\0\0\0\x03\xea\0\0\0\x0c\0\0\0\0\0\0\0\x05index\0\0\0\0\0\0\x04\0\0\0\x01\0\0\0\x0c" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_FR_VEC_GET: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xefy\x1dH\xc0j@N\xca\x03J\x07yA&=\x12\x9ff\xaa\\:\xb8HF\x93[\x06\xeef]\x84", + [], + ); impl<'a> ContractClient<'a> { pub fn g1_mul(&self, p: &Bls12381G1Affine, s: &Bls12381Fr) -> Bls12381G1Affine { use core::ops::Not; diff --git a/tests-expanded/test_bls_wasm32v1-none.rs b/tests-expanded/test_bls_wasm32v1-none.rs index 1bc77fcf7..9135a6b34 100644 --- a/tests-expanded/test_bls_wasm32v1-none.rs +++ b/tests-expanded/test_bls_wasm32v1-none.rs @@ -23,21 +23,19 @@ impl DummyProof { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\nDummyProof\0\0\0\0\0\x05\0\0\0\0\0\0\0\x02fp\0\0\0\0\x03\xee\0\0\00\0\0\0\0\0\0\0\x03fp2\0\0\0\x03\xee\0\0\0`\0\0\0\0\0\0\0\x02fr\0\0\0\0\0\x0c\0\0\0\0\0\0\0\x02g1\0\0\0\0\x03\xee\0\0\0`\0\0\0\0\0\0\0\x02g2\0\0\0\0\x03\xee\0\0\0\xc0" } } -impl soroban_sdk::SpecShakingMarker for DummyProof { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - ::spec_shaking_marker(); - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\x85W\0A\xdc~\xb7\""; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for DummyProof { + const SPEC_TYPE_ID: [u8; 32] = *b"\x85W\0A\xdc~\xb7\"pt\xb6\xb4\x08\x9f\x17\xa7\xb3\xb0\xdf1\xfe\xd6\xc3\xbe]\xce\xe2,\xc0\x95\xa2\xc0"; } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_DUMMYPROOF: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\x85W\0A\xdc~\xb7\"pt\xb6\xb4\x08\x9f\x17\xa7\xb3\xb0\xdf1\xfe\xd6\xc3\xbe]\xce\xe2,\xc0\x95\xa2\xc0", + [], +); impl soroban_sdk::TryFromVal for DummyProof { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -181,6 +179,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06g1_mul\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01p\0\0\0\0\0\x03\xee\0\0\0`\0\0\0\0\0\0\0\x01s\0\0\0\0\0\0\x0c\0\0\0\x01\0\0\x03\xee\0\0\0`" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_G1_MUL: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x1a\xaa\xb3\xc2\x90~\x9f\xa9\x1b\xc8\xd5(\xdd%D\xf6\xaf6c}QT\xfe\x0f\xc1\xafO\r\x8e\x1c\xd0\xfb", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__g2_mul__spec { @@ -196,6 +204,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06g2_mul\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01p\0\0\0\0\0\x03\xee\0\0\0\xc0\0\0\0\0\0\0\0\x01s\0\0\0\0\0\0\x0c\0\0\0\x01\0\0\x03\xee\0\0\0\xc0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_G2_MUL: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xbf\x0fjK\xa3\t\x1f\xc8|\xb7\xb8{:2\xa78\x1a\x18\x89\xc4a\xabm!R\x93\x14\x8b\xb7v\x8f\xe1", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__dummy_verify__spec { @@ -211,6 +229,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0cdummy_verify\0\0\0\x01\0\0\0\0\0\0\0\x05proof\0\0\0\0\0\x07\xd0\0\0\0\nDummyProof\0\0\0\0\0\x01\0\0\0\x01" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_DUMMY_VERIFY: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"\x94q\xb5i\x852\x1fZM0\x8f\xb3\xfaF\xf6J\xf3\xaa\x1e\xeer\x87\xa1\xd6\x89\xae\xb5\xdf\x15U@\xfe", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__fr_vec_get__spec { @@ -226,6 +254,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\nfr_vec_get\0\0\0\0\0\x02\0\0\0\0\0\0\0\x06values\0\0\0\0\x03\xea\0\0\0\x0c\0\0\0\0\0\0\0\x05index\0\0\0\0\0\0\x04\0\0\0\x01\0\0\0\x0c" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_FR_VEC_GET: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xefy\x1dH\xc0j@N\xca\x03J\x07yA&=\x12\x9ff\xaa\\:\xb8HF\x93[\x06\xeef]\x84", + [], + ); impl<'a> ContractClient<'a> { pub fn g1_mul(&self, p: &Bls12381G1Affine, s: &Bls12381Fr) -> Bls12381G1Affine { use core::ops::Not; diff --git a/tests-expanded/test_bn254_tests.rs b/tests-expanded/test_bn254_tests.rs index 825322cb9..f9eec5a5d 100644 --- a/tests-expanded/test_bn254_tests.rs +++ b/tests-expanded/test_bn254_tests.rs @@ -19,14 +19,17 @@ impl MockProof { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\tMockProof\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02g1\0\0\0\0\x03\xea\0\0\x03\xee\0\0\0@\0\0\0\0\0\0\0\x02g2\0\0\0\0\x03\xea\0\0\x03\xee\0\0\0\x80" } } -impl soroban_sdk::SpecShakingMarker for MockProof { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for MockProof { + const SPEC_TYPE_ID: [u8; 32] = + *b":\x81\xa6\xa0\x9e\xe7\xa7\x1f\xb2\xd7\xc9\x1b)/\x02d\xafvb+Mi[n13\xa4\x87\xd6\x1dT\x08"; } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_MOCKPROOF: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b":\x81\xa6\xa0\x9e\xe7\xa7\x1f\xb2\xd7\xc9\x1b)/\x02d\xafvb+Mi[n13\xa4\x87\xd6\x1dT\x08", + [], + ); impl soroban_sdk::TryFromVal for MockProof { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -565,6 +568,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0everify_pairing\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05proof\0\0\0\0\0\x07\xd0\0\0\0\tMockProof\0\0\0\0\0\0\x01\0\0\0\x01" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_VERIFY_PAIRING: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"(\xf5\xcfQ\xad\x8eE\xd6x\xb8\xe8\xb3\x81\xe7\xa4\x18w\xfa\xe4\x0e{a\xf9\x05\xdb\xb0\xa6\xaf\x06\xbe\x1aw", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__g1_add__spec { @@ -579,6 +591,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06g1_add\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\x03\xee\0\0\0@\0\0\0\0\0\0\0\x01b\0\0\0\0\0\x03\xee\0\0\0@\0\0\0\x01\0\0\x03\xee\0\0\0@" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_G1_ADD: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xe0\xaf\xf3\xacg\xce\x8d2\x14\xbai\x82\xa7q\xf3\xf5g\xd2*\xdb\xc8\xae\x04\xbaC\xe1\xc1\xed\x95l\xccv", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__g1_mul__spec { @@ -593,6 +614,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06g1_mul\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01p\0\0\0\0\0\x03\xee\0\0\0@\0\0\0\0\0\0\0\x01s\0\0\0\0\0\0\x0c\0\0\0\x01\0\0\x03\xee\0\0\0@" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_G1_MUL: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"86PV\x83\x14\xc9\xec+\x07\xc3\x91\x12\x10\x9c\xae\xd5:XB\x80\x95\xf8\xd4s\x901_\xb0r\xa2^", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__fr_vec_get__spec { @@ -607,6 +637,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\nfr_vec_get\0\0\0\0\0\x02\0\0\0\0\0\0\0\x06values\0\0\0\0\x03\xea\0\0\0\x0c\0\0\0\0\0\0\0\x05index\0\0\0\0\0\0\x04\0\0\0\x01\0\0\0\x0c" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_FR_VEC_GET: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xefy\x1dH\xc0j@N\xca\x03J\x07yA&=\x12\x9ff\xaa\\:\xb8HF\x93[\x06\xeef]\x84", + [], + ); impl<'a> ContractClient<'a> { pub fn verify_pairing(&self, proof: &MockProof) -> bool { use core::ops::Not; diff --git a/tests-expanded/test_bn254_wasm32v1-none.rs b/tests-expanded/test_bn254_wasm32v1-none.rs index ebd06e40e..cffc71e5f 100644 --- a/tests-expanded/test_bn254_wasm32v1-none.rs +++ b/tests-expanded/test_bn254_wasm32v1-none.rs @@ -20,18 +20,18 @@ impl MockProof { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\tMockProof\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02g1\0\0\0\0\x03\xea\0\0\x03\xee\0\0\0@\0\0\0\0\0\0\0\x02g2\0\0\0\0\x03\xea\0\0\x03\xee\0\0\0\x80" } } -impl soroban_sdk::SpecShakingMarker for MockProof { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1:\x81\xa6\xa0\x9e\xe7\xa7\x1f"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for MockProof { + const SPEC_TYPE_ID: [u8; 32] = + *b":\x81\xa6\xa0\x9e\xe7\xa7\x1f\xb2\xd7\xc9\x1b)/\x02d\xafvb+Mi[n13\xa4\x87\xd6\x1dT\x08"; } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_MOCKPROOF: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b":\x81\xa6\xa0\x9e\xe7\xa7\x1f\xb2\xd7\xc9\x1b)/\x02d\xafvb+Mi[n13\xa4\x87\xd6\x1dT\x08", + [], + ); impl soroban_sdk::TryFromVal for MockProof { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -141,6 +141,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0everify_pairing\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05proof\0\0\0\0\0\x07\xd0\0\0\0\tMockProof\0\0\0\0\0\0\x01\0\0\0\x01" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_VERIFY_PAIRING: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"(\xf5\xcfQ\xad\x8eE\xd6x\xb8\xe8\xb3\x81\xe7\xa4\x18w\xfa\xe4\x0e{a\xf9\x05\xdb\xb0\xa6\xaf\x06\xbe\x1aw", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__g1_add__spec { @@ -156,6 +166,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06g1_add\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\x03\xee\0\0\0@\0\0\0\0\0\0\0\x01b\0\0\0\0\0\x03\xee\0\0\0@\0\0\0\x01\0\0\x03\xee\0\0\0@" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_G1_ADD: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xe0\xaf\xf3\xacg\xce\x8d2\x14\xbai\x82\xa7q\xf3\xf5g\xd2*\xdb\xc8\xae\x04\xbaC\xe1\xc1\xed\x95l\xccv", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__g1_mul__spec { @@ -171,6 +191,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06g1_mul\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01p\0\0\0\0\0\x03\xee\0\0\0@\0\0\0\0\0\0\0\x01s\0\0\0\0\0\0\x0c\0\0\0\x01\0\0\x03\xee\0\0\0@" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_G1_MUL: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"86PV\x83\x14\xc9\xec+\x07\xc3\x91\x12\x10\x9c\xae\xd5:XB\x80\x95\xf8\xd4s\x901_\xb0r\xa2^", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__fr_vec_get__spec { @@ -186,6 +216,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\nfr_vec_get\0\0\0\0\0\x02\0\0\0\0\0\0\0\x06values\0\0\0\0\x03\xea\0\0\0\x0c\0\0\0\0\0\0\0\x05index\0\0\0\0\0\0\x04\0\0\0\x01\0\0\0\x0c" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_FR_VEC_GET: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xefy\x1dH\xc0j@N\xca\x03J\x07yA&=\x12\x9ff\xaa\\:\xb8HF\x93[\x06\xeef]\x84", + [], + ); impl<'a> ContractClient<'a> { pub fn verify_pairing(&self, proof: &MockProof) -> bool { use core::ops::Not; diff --git a/tests-expanded/test_constructor_tests.rs b/tests-expanded/test_constructor_tests.rs index 2ddc1d91a..86bcb5067 100644 --- a/tests-expanded/test_constructor_tests.rs +++ b/tests-expanded/test_constructor_tests.rs @@ -147,13 +147,18 @@ impl DataKey { *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x07DataKey\0\0\0\0\x03\0\0\0\x01\0\0\0\0\0\0\0\nPersistent\0\0\0\0\0\x01\0\0\0\x04\0\0\0\x01\0\0\0\0\0\0\0\x04Temp\0\0\0\x01\0\0\0\x04\0\0\0\x01\0\0\0\0\0\0\0\x08Instance\0\0\0\x01\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for DataKey { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for DataKey { + const SPEC_TYPE_ID: [u8; 32] = *b"\x14\x94}~\xec\x15\x94\x84\xa9\xeb\xe4{6pmG_RP\xb5I\xaf\x83\xfe\x13\xf9%d\xed\x80\x08\x8f"; } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_DATAKEY: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\x14\x94}~\xec\x15\x94\x84\xa9\xeb\xe4{6pmG_RP\xb5I\xaf\x83\xfe\x13\xf9%d\xed\x80\x08\x8f", + [], +); impl soroban_sdk::TryFromVal for DataKey { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -724,6 +729,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\r__constructor\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x08init_key\0\0\0\x04\0\0\0\0\0\0\0\ninit_value\0\0\0\0\0\x07\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT___CONSTRUCTOR: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xd7\xe3\xea\xaf?P\xf2_&\xa2=8B\xbf\x8enr\xd80\xaf\x051\"_\xc7Z\xde3\xa6k\x11\xdb", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__get_data__spec { @@ -738,6 +750,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08get_data\0\0\0\x01\0\0\0\0\0\0\0\x03key\0\0\0\x07\xd0\0\0\0\x07DataKey\0\0\0\0\x01\0\0\x03\xe8\0\0\0\x07" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_GET_DATA: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"\xd1\xaa_\xdb\x070x\xa1~~k\xa3y\xc70\xe5\xd8u^Gi\xf0\\\xb4\xc7\x89\xa1\x7f\xb5\xe2\x1c\x16", + [::SPEC_TYPE_ID], +); impl<'a> ContractClient<'a> { pub fn get_data(&self, key: &DataKey) -> Option { use core::ops::Not; diff --git a/tests-expanded/test_constructor_wasm32v1-none.rs b/tests-expanded/test_constructor_wasm32v1-none.rs index 871059033..b0244a957 100644 --- a/tests-expanded/test_constructor_wasm32v1-none.rs +++ b/tests-expanded/test_constructor_wasm32v1-none.rs @@ -36,17 +36,19 @@ impl DataKey { *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x07DataKey\0\0\0\0\x03\0\0\0\x01\0\0\0\0\0\0\0\nPersistent\0\0\0\0\0\x01\0\0\0\x04\0\0\0\x01\0\0\0\0\0\0\0\x04Temp\0\0\0\x01\0\0\0\x04\0\0\0\x01\0\0\0\0\0\0\0\x08Instance\0\0\0\x01\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for DataKey { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\x14\x94}~\xec\x15\x94\x84"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for DataKey { + const SPEC_TYPE_ID: [u8; 32] = *b"\x14\x94}~\xec\x15\x94\x84\xa9\xeb\xe4{6pmG_RP\xb5I\xaf\x83\xfe\x13\xf9%d\xed\x80\x08\x8f"; } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_DATAKEY: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\x14\x94}~\xec\x15\x94\x84\xa9\xeb\xe4{6pmG_RP\xb5I\xaf\x83\xfe\x13\xf9%d\xed\x80\x08\x8f", + [], +); impl soroban_sdk::TryFromVal for DataKey { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -180,6 +182,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\r__constructor\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x08init_key\0\0\0\x04\0\0\0\0\0\0\0\ninit_value\0\0\0\0\0\x07\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT___CONSTRUCTOR: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xd7\xe3\xea\xaf?P\xf2_&\xa2=8B\xbf\x8enr\xd80\xaf\x051\"_\xc7Z\xde3\xa6k\x11\xdb", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__get_data__spec { @@ -195,6 +205,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08get_data\0\0\0\x01\0\0\0\0\0\0\0\x03key\0\0\0\x07\xd0\0\0\0\x07DataKey\0\0\0\0\x01\0\0\x03\xe8\0\0\0\x07" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_GET_DATA: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"\xd1\xaa_\xdb\x070x\xa1~~k\xa3y\xc70\xe5\xd8u^Gi\xf0\\\xb4\xc7\x89\xa1\x7f\xb5\xe2\x1c\x16", + [::SPEC_TYPE_ID], +); impl<'a> ContractClient<'a> { pub fn get_data(&self, key: &DataKey) -> Option { use core::ops::Not; diff --git a/tests-expanded/test_contract_data_tests.rs b/tests-expanded/test_contract_data_tests.rs index 06e39a38e..70f2c17e8 100644 --- a/tests-expanded/test_contract_data_tests.rs +++ b/tests-expanded/test_contract_data_tests.rs @@ -161,6 +161,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x03put\0\0\0\0\x02\0\0\0\0\0\0\0\x03key\0\0\0\0\x11\0\0\0\0\0\0\0\x03val\0\0\0\0\x11\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_PUT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"e\x0c\0\x05\x14x\xd8\xa1\xf6a@`\xca\xaa\x92\xe3\x86C9J\xb4\xfd\xaa\xac,\t\xe3Y\x93\x9e\x03\xed", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__get__spec { @@ -175,6 +184,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x03get\0\0\0\0\x01\0\0\0\0\0\0\0\x03key\0\0\0\0\x11\0\0\0\x01\0\0\x03\xe8\0\0\0\x11" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_GET: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"y\r\xaa\xcd\xc6b\xde\xa54\tZ3\xeen<6\x0f\xa9\xbf\x1e\xea\xf3\x1axp\x9d\xab\xc34\xe6F\xe7", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__del__spec { @@ -189,6 +207,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x03del\0\0\0\0\x01\0\0\0\0\0\0\0\x03key\0\0\0\0\x11\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_DEL: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xff\xef\x99?\x06NE\xf9\x0f\x99z\xf6'\xe9@\x9ah\x8ch\xae\xff\xe8\xa3\xfa\xd6[=\x1f+W\xa8<", + [], +); impl<'a> ContractClient<'a> { pub fn put(&self, key: &Symbol, val: &Symbol) -> () { use core::ops::Not; diff --git a/tests-expanded/test_contract_data_wasm32v1-none.rs b/tests-expanded/test_contract_data_wasm32v1-none.rs index b60dc39a9..ff1352605 100644 --- a/tests-expanded/test_contract_data_wasm32v1-none.rs +++ b/tests-expanded/test_contract_data_wasm32v1-none.rs @@ -50,6 +50,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x03put\0\0\0\0\x02\0\0\0\0\0\0\0\x03key\0\0\0\0\x11\0\0\0\0\0\0\0\x03val\0\0\0\0\x11\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_PUT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"e\x0c\0\x05\x14x\xd8\xa1\xf6a@`\xca\xaa\x92\xe3\x86C9J\xb4\xfd\xaa\xac,\t\xe3Y\x93\x9e\x03\xed", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__get__spec { @@ -65,6 +75,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x03get\0\0\0\0\x01\0\0\0\0\0\0\0\x03key\0\0\0\0\x11\0\0\0\x01\0\0\x03\xe8\0\0\0\x11" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_GET: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"y\r\xaa\xcd\xc6b\xde\xa54\tZ3\xeen<6\x0f\xa9\xbf\x1e\xea\xf3\x1axp\x9d\xab\xc34\xe6F\xe7", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__del__spec { @@ -80,6 +100,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x03del\0\0\0\0\x01\0\0\0\0\0\0\0\x03key\0\0\0\0\x11\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_DEL: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xff\xef\x99?\x06NE\xf9\x0f\x99z\xf6'\xe9@\x9ah\x8ch\xae\xff\xe8\xa3\xfa\xd6[=\x1f+W\xa8<", + [], +); impl<'a> ContractClient<'a> { pub fn put(&self, key: &Symbol, val: &Symbol) -> () { use core::ops::Not; diff --git a/tests-expanded/test_contracttrait_impl_full_tests.rs b/tests-expanded/test_contracttrait_impl_full_tests.rs index e37897c8a..12a171d2a 100644 --- a/tests-expanded/test_contracttrait_impl_full_tests.rs +++ b/tests-expanded/test_contracttrait_impl_full_tests.rs @@ -1216,6 +1216,15 @@ impl Contract { *b"\0\0\0\0\0\0\0-Test u32 values.\nReturns the input unchanged.\0\0\0\0\0\0\x08test_u32\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x04\0\0\0\x01\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U32: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x8dR\xda\x86B-/\xc4kN\x18Z\xecF\xf8\xc8\xb8\xa7!U\x86\x99\x8bv@#\xd2\x92\x02\xd3\x96\x1d", + [], +); #[doc(hidden)] /// Test i32 values. #[allow(non_snake_case)] @@ -1233,6 +1242,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\x10Test i32 values.\0\0\0\x08test_i32\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x05\0\0\0\x01\0\0\0\x05" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I32: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"RO\xc6\xf8W\x07\xe9\xe3_\xe3J9D\xa5\x87\xc3\x9d`\x04c\xa5\xb3%\xe91\x07#E\xc2\xb3l\xd9", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_u64__spec { @@ -1247,6 +1263,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_u64\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x06\0\0\0\x01\0\0\0\x06" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U64: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xeaQ\x08\xd6\xb9\xb9\xe62\x87\xb7\x81$\xf6\x8f\x81\x98\xa5\xae\x1c/\xbc\x9c\x8c\xc4\x95\xc15\xbeg\xb4\xc4\t", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_i64__spec { @@ -1261,6 +1286,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_i64\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x07\0\0\0\x01\0\0\0\x07" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I64: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xa4\x97mN\xcb\x1b\x08}\x84\x02o\xa9;4\xf9*\x80\t\xe52\xe4\xe1.\x96\xfaaZ\x15\x1b\x80\x99L", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_u128__spec { @@ -1275,6 +1309,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_u128\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\n\0\0\0\x01\0\0\0\n" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U128: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xb8\xec\xfb\xc6\xf0k\xa6 ie\x91\xe1\x04{q\x94\xf1Q\x1b\xa6\xda\x1a\xae/Co\xcc\x0c\x94\xbe\t\x01", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_i128__spec { @@ -1289,6 +1332,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_i128\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0b\0\0\0\x01\0\0\0\x0b" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I128: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"K\xdf\x89\x8c\xc4\xc7\xb8Fz\xcb\xff\xb7^,C\xfe\xf7\xde\xd3K\xa4Y\x03Xq\xa62X5z&\x1b", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_bool__spec { @@ -1303,6 +1353,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_bool\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x01\0\0\0\x01\0\0\0\x01" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_BOOL: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"]\xb8\xa6\xf2A\xb4\x93\xa4\xfa\x06\x11\xf2\x9e;\x02}\xb8\\T\xef\xd3]\"\x7f\xd4A\xbf\x89\xe2~\xaa\xc9", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_address__spec { @@ -1317,6 +1376,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0ctest_address\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x13\0\0\0\x01\0\0\0\x13" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ADDRESS: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xe1\xa1\xce]Y\n1X\xf5\xa1\xd0A\xf9\xfa\0,\xa9/2.\xfak\x83.\x9d\xf4\xbe-\xdc\xc8\x15Y", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_bytes__spec { @@ -1331,6 +1397,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ntest_bytes\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0e\0\0\0\x01\0\0\0\x0e" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_BYTES: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"5\xdd\x0c4\x83\xcc&m\xd3@{\x1d'\x01\x89b\xc4E\xe0s\x80w\xaa+\xa7ttU\xb8Z\x99|", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_bytes_n__spec { @@ -1345,6 +1418,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0ctest_bytes_n\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xee\0\0\0 \0\0\0\x01\0\0\x03\xee\0\0\0 " } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_BYTES_N: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"e\xc8ovtK?\xb2ixC\x15b\xb8\xfd\xc2\xd4pf\xc2,\xcd\x1b\xb6\xd5\x97\x16 \xbe\xcf\x81\xdd", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_string__spec { @@ -1359,6 +1439,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_string\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x10\0\0\0\x01\0\0\0\x10" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_STRING: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"G\xfe^\xa9(|>\x01\xc9\xf4\x9f\xfe\xb8\x88\xde8K\xefn\xb7\xd8\xa8\xbb.\xca'\xa9C\xb9\xe2\x0f\x8d", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_symbol__spec { @@ -1373,6 +1462,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_symbol\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x11\0\0\0\x01\0\0\0\x11" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_SYMBOL: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xb3\xbb?\xa3\xe95v]E\x90^\x17\x8dzlte\x02\n%\xe8\x93\xd2f\x16\xec\xc1\x12\x0c}(^", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_vec__spec { @@ -1387,6 +1483,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_vec\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xea\0\0\0\x04\0\0\0\x01\0\0\x03\xea\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_VEC: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"il\x1aVT\xad'\\T\xdf\xbeC\x16\xda\xec\xf7\x93t\xea%'l\x06\x0f\xff\xbd9p_\xf3'\xef", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_map__spec { @@ -1401,6 +1504,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_map\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xec\0\0\0\x04\0\0\0\x04\0\0\0\x01\0\0\x03\xec\0\0\0\x04\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_MAP: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xe0I\xc0\xec\x08W\xe7\x18\xd3\x81E&\xcc!`\xc9\xf7\x81~p\xdd1j\xbc\x1f<\xc2\xdb&+%t", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_duration__spec { @@ -1416,6 +1526,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\rtest_duration\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\t\0\0\0\x01\0\0\0\t" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_DURATION: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\"g\xca\xf3\x95\xc5f\"\x95\xb0\t\"\x12\x01\xf7\xa7\xa7\xe3\x9a\x9a\x90\xdc\x04\xe1\xfft\xd7\xe2\x01\xad\xeb@", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_timepoint__spec { @@ -1431,6 +1550,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_timepoint\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x08\0\0\0\x01\0\0\0\x08" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_TIMEPOINT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x98S\x95 \xc6\xb1\xfa*\x0f\r\x0b\x1f\x0fu\xe9C\xdc\xc17\x07\xf5\xe7\xe4\xa3\xdd\xe4\xd2\xe2\x01\x19\x07k", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_i256__spec { @@ -1445,6 +1573,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_i256\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\r\0\0\0\x01\0\0\0\r" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I256: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\x7f\xef\xe5_|\xbb\xc6\xa9\xbd\xf1HP:jO8U\x8a|E\x03C\xc29\xd1c\xe5\xa1\xf8Q)?", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_u256__spec { @@ -1459,6 +1594,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_u256\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0c\0\0\0\x01\0\0\0\x0c" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U256: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xe3\xff\x18\xda\xd9V\x04P.\xc3\x0bX\xbd\x95\xb2\03U_\x9a~\xb82\"t\xff\x90=,o\x11\x89", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_env_param__spec { @@ -1474,6 +1616,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_env_param\0\0\0\0\0\0\0\0\0\x01\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ENV_PARAM: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xf5\xeb\xae\xe9\xa1L\xe56?k \x12\x8eT\xf3\xfd\x0f\xbc2\xd6XL\xed-\xa9Y}\xe5L9\x85\x16", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_struct__spec { @@ -1488,6 +1637,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_struct\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\x08MyStruct\0\0\0\x01\0\0\x07\xd0\0\0\0\x08MyStruct" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_STRUCT: [u8; 106usize] = + soroban_sdk::spec_shaking::encode_graph_record::<106usize, 2usize>( + 0, + *b"\xe3J\x02q\xbbS\x01G\xe1\x81W'^@\xb2\x8b8\xb1\xe3\x8c\xce'\xde\x8b\xc8]\xc0\xb7Dcl ", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_enum_unit__spec { @@ -1503,6 +1662,18 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_enum_unit\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\nMyEnumUnit\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\nMyEnumUnit\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ENUM_UNIT: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"\x12fTH\xb0\xbd\xb3\xfb\x8f\r&\x857\xf4\xbc\x05\x16\xfa\xfc\x0ey\xee\x07\ra\x18\x80\xa1\x1e4\xbe+", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_enum_variants__spec { @@ -1518,6 +1689,18 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x12test_enum_variants\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\x0eMyEnumVariants\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x0eMyEnumVariants\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ENUM_VARIANTS: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"\xbf\xb8\x9d\xfbU@\x9d_\n\x9b\xb9<`\x90\xda\x14E\x17\xdd{\xd4<\xc2\xadL\xd7f\xaf\x84\xae\xbfe", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); impl<'a> ContractClient<'a> { /// Test u32 values. /// Returns the input unchanged. diff --git a/tests-expanded/test_contracttrait_impl_full_wasm32v1-none.rs b/tests-expanded/test_contracttrait_impl_full_wasm32v1-none.rs index d7d5cd6ad..b4242ef87 100644 --- a/tests-expanded/test_contracttrait_impl_full_wasm32v1-none.rs +++ b/tests-expanded/test_contracttrait_impl_full_wasm32v1-none.rs @@ -706,6 +706,16 @@ impl Contract { *b"\0\0\0\0\0\0\0-Test u32 values.\nReturns the input unchanged.\0\0\0\0\0\0\x08test_u32\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x04\0\0\0\x01\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U32: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x8dR\xda\x86B-/\xc4kN\x18Z\xecF\xf8\xc8\xb8\xa7!U\x86\x99\x8bv@#\xd2\x92\x02\xd3\x96\x1d", + [], +); #[doc(hidden)] /// Test i32 values. #[allow(non_snake_case)] @@ -724,6 +734,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\x10Test i32 values.\0\0\0\x08test_i32\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x05\0\0\0\x01\0\0\0\x05" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I32: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"RO\xc6\xf8W\x07\xe9\xe3_\xe3J9D\xa5\x87\xc3\x9d`\x04c\xa5\xb3%\xe91\x07#E\xc2\xb3l\xd9", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_u64__spec { @@ -739,6 +757,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_u64\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x06\0\0\0\x01\0\0\0\x06" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U64: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xeaQ\x08\xd6\xb9\xb9\xe62\x87\xb7\x81$\xf6\x8f\x81\x98\xa5\xae\x1c/\xbc\x9c\x8c\xc4\x95\xc15\xbeg\xb4\xc4\t", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_i64__spec { @@ -754,6 +782,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_i64\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x07\0\0\0\x01\0\0\0\x07" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I64: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xa4\x97mN\xcb\x1b\x08}\x84\x02o\xa9;4\xf9*\x80\t\xe52\xe4\xe1.\x96\xfaaZ\x15\x1b\x80\x99L", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_u128__spec { @@ -769,6 +807,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_u128\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\n\0\0\0\x01\0\0\0\n" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U128: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xb8\xec\xfb\xc6\xf0k\xa6 ie\x91\xe1\x04{q\x94\xf1Q\x1b\xa6\xda\x1a\xae/Co\xcc\x0c\x94\xbe\t\x01", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_i128__spec { @@ -784,6 +832,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_i128\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0b\0\0\0\x01\0\0\0\x0b" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I128: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"K\xdf\x89\x8c\xc4\xc7\xb8Fz\xcb\xff\xb7^,C\xfe\xf7\xde\xd3K\xa4Y\x03Xq\xa62X5z&\x1b", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_bool__spec { @@ -799,6 +855,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_bool\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x01\0\0\0\x01\0\0\0\x01" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_BOOL: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"]\xb8\xa6\xf2A\xb4\x93\xa4\xfa\x06\x11\xf2\x9e;\x02}\xb8\\T\xef\xd3]\"\x7f\xd4A\xbf\x89\xe2~\xaa\xc9", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_address__spec { @@ -814,6 +880,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0ctest_address\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x13\0\0\0\x01\0\0\0\x13" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ADDRESS: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xe1\xa1\xce]Y\n1X\xf5\xa1\xd0A\xf9\xfa\0,\xa9/2.\xfak\x83.\x9d\xf4\xbe-\xdc\xc8\x15Y", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_bytes__spec { @@ -829,6 +903,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ntest_bytes\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0e\0\0\0\x01\0\0\0\x0e" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_BYTES: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"5\xdd\x0c4\x83\xcc&m\xd3@{\x1d'\x01\x89b\xc4E\xe0s\x80w\xaa+\xa7ttU\xb8Z\x99|", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_bytes_n__spec { @@ -844,6 +926,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0ctest_bytes_n\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xee\0\0\0 \0\0\0\x01\0\0\x03\xee\0\0\0 " } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_BYTES_N: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"e\xc8ovtK?\xb2ixC\x15b\xb8\xfd\xc2\xd4pf\xc2,\xcd\x1b\xb6\xd5\x97\x16 \xbe\xcf\x81\xdd", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_string__spec { @@ -859,6 +949,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_string\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x10\0\0\0\x01\0\0\0\x10" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_STRING: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"G\xfe^\xa9(|>\x01\xc9\xf4\x9f\xfe\xb8\x88\xde8K\xefn\xb7\xd8\xa8\xbb.\xca'\xa9C\xb9\xe2\x0f\x8d", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_symbol__spec { @@ -874,6 +974,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_symbol\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x11\0\0\0\x01\0\0\0\x11" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_SYMBOL: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xb3\xbb?\xa3\xe95v]E\x90^\x17\x8dzlte\x02\n%\xe8\x93\xd2f\x16\xec\xc1\x12\x0c}(^", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_vec__spec { @@ -889,6 +997,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_vec\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xea\0\0\0\x04\0\0\0\x01\0\0\x03\xea\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_VEC: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"il\x1aVT\xad'\\T\xdf\xbeC\x16\xda\xec\xf7\x93t\xea%'l\x06\x0f\xff\xbd9p_\xf3'\xef", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_map__spec { @@ -904,6 +1020,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_map\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xec\0\0\0\x04\0\0\0\x04\0\0\0\x01\0\0\x03\xec\0\0\0\x04\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_MAP: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xe0I\xc0\xec\x08W\xe7\x18\xd3\x81E&\xcc!`\xc9\xf7\x81~p\xdd1j\xbc\x1f<\xc2\xdb&+%t", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_duration__spec { @@ -920,6 +1044,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\rtest_duration\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\t\0\0\0\x01\0\0\0\t" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_DURATION: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\"g\xca\xf3\x95\xc5f\"\x95\xb0\t\"\x12\x01\xf7\xa7\xa7\xe3\x9a\x9a\x90\xdc\x04\xe1\xfft\xd7\xe2\x01\xad\xeb@", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_timepoint__spec { @@ -936,6 +1070,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_timepoint\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x08\0\0\0\x01\0\0\0\x08" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_TIMEPOINT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x98S\x95 \xc6\xb1\xfa*\x0f\r\x0b\x1f\x0fu\xe9C\xdc\xc17\x07\xf5\xe7\xe4\xa3\xdd\xe4\xd2\xe2\x01\x19\x07k", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_i256__spec { @@ -951,6 +1095,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_i256\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\r\0\0\0\x01\0\0\0\r" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I256: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\x7f\xef\xe5_|\xbb\xc6\xa9\xbd\xf1HP:jO8U\x8a|E\x03C\xc29\xd1c\xe5\xa1\xf8Q)?", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_u256__spec { @@ -966,6 +1118,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_u256\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0c\0\0\0\x01\0\0\0\x0c" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U256: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xe3\xff\x18\xda\xd9V\x04P.\xc3\x0bX\xbd\x95\xb2\03U_\x9a~\xb82\"t\xff\x90=,o\x11\x89", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_env_param__spec { @@ -982,6 +1142,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_env_param\0\0\0\0\0\0\0\0\0\x01\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ENV_PARAM: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xf5\xeb\xae\xe9\xa1L\xe56?k \x12\x8eT\xf3\xfd\x0f\xbc2\xd6XL\xed-\xa9Y}\xe5L9\x85\x16", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_struct__spec { @@ -997,6 +1165,17 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_struct\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\x08MyStruct\0\0\0\x01\0\0\x07\xd0\0\0\0\x08MyStruct" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_STRUCT: [u8; 106usize] = + soroban_sdk::spec_shaking::encode_graph_record::<106usize, 2usize>( + 0, + *b"\xe3J\x02q\xbbS\x01G\xe1\x81W'^@\xb2\x8b8\xb1\xe3\x8c\xce'\xde\x8b\xc8]\xc0\xb7Dcl ", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_enum_unit__spec { @@ -1013,6 +1192,19 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_enum_unit\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\nMyEnumUnit\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\nMyEnumUnit\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ENUM_UNIT: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"\x12fTH\xb0\xbd\xb3\xfb\x8f\r&\x857\xf4\xbc\x05\x16\xfa\xfc\x0ey\xee\x07\ra\x18\x80\xa1\x1e4\xbe+", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_enum_variants__spec { @@ -1029,6 +1221,19 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x12test_enum_variants\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\x0eMyEnumVariants\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x0eMyEnumVariants\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ENUM_VARIANTS: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"\xbf\xb8\x9d\xfbU@\x9d_\n\x9b\xb9<`\x90\xda\x14E\x17\xdd{\xd4<\xc2\xadL\xd7f\xaf\x84\xae\xbfe", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); impl<'a> ContractClient<'a> { /// Test u32 values. /// Returns the input unchanged. diff --git a/tests-expanded/test_contracttrait_impl_partial_tests.rs b/tests-expanded/test_contracttrait_impl_partial_tests.rs index f0b8ff548..b7026701f 100644 --- a/tests-expanded/test_contracttrait_impl_partial_tests.rs +++ b/tests-expanded/test_contracttrait_impl_partial_tests.rs @@ -171,6 +171,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_u32\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x04\0\0\0\x01\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U32: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xe2\x92L\x8b L\x07\xa1\x88\x07\xb8C\xc6\x85*\x8a\xc84\xc1\xbeTc8^\xdd\x06B\xb9\x94~8\xdc", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_string__spec { @@ -185,6 +194,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_string\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x10\0\0\0\x01\0\0\0\x10" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_STRING: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"G\xfe^\xa9(|>\x01\xc9\xf4\x9f\xfe\xb8\x88\xde8K\xefn\xb7\xd8\xa8\xbb.\xca'\xa9C\xb9\xe2\x0f\x8d", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_env_param__spec { @@ -200,6 +218,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_env_param\0\0\0\0\0\0\0\0\0\x01\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ENV_PARAM: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xf5\xeb\xae\xe9\xa1L\xe56?k \x12\x8eT\xf3\xfd\x0f\xbc2\xd6XL\xed-\xa9Y}\xe5L9\x85\x16", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_struct__spec { @@ -214,6 +239,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_struct\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\x08MyStruct\0\0\0\x01\0\0\x07\xd0\0\0\0\x08MyStruct" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_STRUCT: [u8; 106usize] = + soroban_sdk::spec_shaking::encode_graph_record::<106usize, 2usize>( + 0, + *b"\xe3J\x02q\xbbS\x01G\xe1\x81W'^@\xb2\x8b8\xb1\xe3\x8c\xce'\xde\x8b\xc8]\xc0\xb7Dcl ", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); impl<'a> ContractClient<'a> { pub fn test_u32(&self, v: &u32) -> u32 { use core::ops::Not; @@ -1603,6 +1638,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\x10Test i32 values.\0\0\0\x08test_i32\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x05\0\0\0\x01\0\0\0\x05" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I32: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"RO\xc6\xf8W\x07\xe9\xe3_\xe3J9D\xa5\x87\xc3\x9d`\x04c\xa5\xb3%\xe91\x07#E\xc2\xb3l\xd9", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_u64__spec { @@ -1617,6 +1659,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_u64\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x06\0\0\0\x01\0\0\0\x06" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U64: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xeaQ\x08\xd6\xb9\xb9\xe62\x87\xb7\x81$\xf6\x8f\x81\x98\xa5\xae\x1c/\xbc\x9c\x8c\xc4\x95\xc15\xbeg\xb4\xc4\t", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_i64__spec { @@ -1631,6 +1682,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_i64\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x07\0\0\0\x01\0\0\0\x07" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I64: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xa4\x97mN\xcb\x1b\x08}\x84\x02o\xa9;4\xf9*\x80\t\xe52\xe4\xe1.\x96\xfaaZ\x15\x1b\x80\x99L", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_u128__spec { @@ -1645,6 +1705,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_u128\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\n\0\0\0\x01\0\0\0\n" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U128: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xb8\xec\xfb\xc6\xf0k\xa6 ie\x91\xe1\x04{q\x94\xf1Q\x1b\xa6\xda\x1a\xae/Co\xcc\x0c\x94\xbe\t\x01", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_i128__spec { @@ -1659,6 +1728,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_i128\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0b\0\0\0\x01\0\0\0\x0b" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I128: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"K\xdf\x89\x8c\xc4\xc7\xb8Fz\xcb\xff\xb7^,C\xfe\xf7\xde\xd3K\xa4Y\x03Xq\xa62X5z&\x1b", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_bool__spec { @@ -1673,6 +1749,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_bool\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x01\0\0\0\x01\0\0\0\x01" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_BOOL: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"]\xb8\xa6\xf2A\xb4\x93\xa4\xfa\x06\x11\xf2\x9e;\x02}\xb8\\T\xef\xd3]\"\x7f\xd4A\xbf\x89\xe2~\xaa\xc9", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_address__spec { @@ -1687,6 +1772,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0ctest_address\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x13\0\0\0\x01\0\0\0\x13" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ADDRESS: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xe1\xa1\xce]Y\n1X\xf5\xa1\xd0A\xf9\xfa\0,\xa9/2.\xfak\x83.\x9d\xf4\xbe-\xdc\xc8\x15Y", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_bytes__spec { @@ -1701,6 +1793,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ntest_bytes\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0e\0\0\0\x01\0\0\0\x0e" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_BYTES: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"5\xdd\x0c4\x83\xcc&m\xd3@{\x1d'\x01\x89b\xc4E\xe0s\x80w\xaa+\xa7ttU\xb8Z\x99|", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_bytes_n__spec { @@ -1715,6 +1814,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0ctest_bytes_n\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xee\0\0\0 \0\0\0\x01\0\0\x03\xee\0\0\0 " } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_BYTES_N: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"e\xc8ovtK?\xb2ixC\x15b\xb8\xfd\xc2\xd4pf\xc2,\xcd\x1b\xb6\xd5\x97\x16 \xbe\xcf\x81\xdd", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_symbol__spec { @@ -1729,6 +1835,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_symbol\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x11\0\0\0\x01\0\0\0\x11" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_SYMBOL: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xb3\xbb?\xa3\xe95v]E\x90^\x17\x8dzlte\x02\n%\xe8\x93\xd2f\x16\xec\xc1\x12\x0c}(^", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_vec__spec { @@ -1743,6 +1856,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_vec\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xea\0\0\0\x04\0\0\0\x01\0\0\x03\xea\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_VEC: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"il\x1aVT\xad'\\T\xdf\xbeC\x16\xda\xec\xf7\x93t\xea%'l\x06\x0f\xff\xbd9p_\xf3'\xef", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_map__spec { @@ -1757,6 +1877,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_map\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xec\0\0\0\x04\0\0\0\x04\0\0\0\x01\0\0\x03\xec\0\0\0\x04\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_MAP: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xe0I\xc0\xec\x08W\xe7\x18\xd3\x81E&\xcc!`\xc9\xf7\x81~p\xdd1j\xbc\x1f<\xc2\xdb&+%t", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_duration__spec { @@ -1772,6 +1899,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\rtest_duration\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\t\0\0\0\x01\0\0\0\t" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_DURATION: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\"g\xca\xf3\x95\xc5f\"\x95\xb0\t\"\x12\x01\xf7\xa7\xa7\xe3\x9a\x9a\x90\xdc\x04\xe1\xfft\xd7\xe2\x01\xad\xeb@", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_timepoint__spec { @@ -1787,6 +1923,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_timepoint\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x08\0\0\0\x01\0\0\0\x08" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_TIMEPOINT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x98S\x95 \xc6\xb1\xfa*\x0f\r\x0b\x1f\x0fu\xe9C\xdc\xc17\x07\xf5\xe7\xe4\xa3\xdd\xe4\xd2\xe2\x01\x19\x07k", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_i256__spec { @@ -1801,6 +1946,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_i256\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\r\0\0\0\x01\0\0\0\r" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I256: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\x7f\xef\xe5_|\xbb\xc6\xa9\xbd\xf1HP:jO8U\x8a|E\x03C\xc29\xd1c\xe5\xa1\xf8Q)?", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_u256__spec { @@ -1815,6 +1967,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_u256\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0c\0\0\0\x01\0\0\0\x0c" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U256: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xe3\xff\x18\xda\xd9V\x04P.\xc3\x0bX\xbd\x95\xb2\03U_\x9a~\xb82\"t\xff\x90=,o\x11\x89", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_enum_unit__spec { @@ -1830,6 +1989,18 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_enum_unit\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\nMyEnumUnit\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\nMyEnumUnit\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ENUM_UNIT: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"\x12fTH\xb0\xbd\xb3\xfb\x8f\r&\x857\xf4\xbc\x05\x16\xfa\xfc\x0ey\xee\x07\ra\x18\x80\xa1\x1e4\xbe+", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_enum_variants__spec { @@ -1845,6 +2016,18 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x12test_enum_variants\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\x0eMyEnumVariants\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x0eMyEnumVariants\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ENUM_VARIANTS: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"\xbf\xb8\x9d\xfbU@\x9d_\n\x9b\xb9<`\x90\xda\x14E\x17\xdd{\xd4<\xc2\xadL\xd7f\xaf\x84\xae\xbfe", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); impl<'a> ContractClient<'a> { /// Test i32 values. pub fn test_i32(&self, v: &i32) -> i32 { diff --git a/tests-expanded/test_contracttrait_impl_partial_wasm32v1-none.rs b/tests-expanded/test_contracttrait_impl_partial_wasm32v1-none.rs index f35f7e083..c8c0104c7 100644 --- a/tests-expanded/test_contracttrait_impl_partial_wasm32v1-none.rs +++ b/tests-expanded/test_contracttrait_impl_partial_wasm32v1-none.rs @@ -60,6 +60,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_u32\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x04\0\0\0\x01\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U32: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xe2\x92L\x8b L\x07\xa1\x88\x07\xb8C\xc6\x85*\x8a\xc84\xc1\xbeTc8^\xdd\x06B\xb9\x94~8\xdc", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_string__spec { @@ -75,6 +85,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_string\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x10\0\0\0\x01\0\0\0\x10" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_STRING: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"G\xfe^\xa9(|>\x01\xc9\xf4\x9f\xfe\xb8\x88\xde8K\xefn\xb7\xd8\xa8\xbb.\xca'\xa9C\xb9\xe2\x0f\x8d", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_env_param__spec { @@ -91,6 +111,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_env_param\0\0\0\0\0\0\0\0\0\x01\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ENV_PARAM: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xf5\xeb\xae\xe9\xa1L\xe56?k \x12\x8eT\xf3\xfd\x0f\xbc2\xd6XL\xed-\xa9Y}\xe5L9\x85\x16", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_struct__spec { @@ -106,6 +134,17 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_struct\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\x08MyStruct\0\0\0\x01\0\0\x07\xd0\0\0\0\x08MyStruct" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_STRUCT: [u8; 106usize] = + soroban_sdk::spec_shaking::encode_graph_record::<106usize, 2usize>( + 0, + *b"\xe3J\x02q\xbbS\x01G\xe1\x81W'^@\xb2\x8b8\xb1\xe3\x8c\xce'\xde\x8b\xc8]\xc0\xb7Dcl ", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); impl<'a> ContractClient<'a> { pub fn test_u32(&self, v: &u32) -> u32 { use core::ops::Not; @@ -911,6 +950,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\x10Test i32 values.\0\0\0\x08test_i32\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x05\0\0\0\x01\0\0\0\x05" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I32: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"RO\xc6\xf8W\x07\xe9\xe3_\xe3J9D\xa5\x87\xc3\x9d`\x04c\xa5\xb3%\xe91\x07#E\xc2\xb3l\xd9", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_u64__spec { @@ -926,6 +973,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_u64\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x06\0\0\0\x01\0\0\0\x06" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U64: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xeaQ\x08\xd6\xb9\xb9\xe62\x87\xb7\x81$\xf6\x8f\x81\x98\xa5\xae\x1c/\xbc\x9c\x8c\xc4\x95\xc15\xbeg\xb4\xc4\t", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_i64__spec { @@ -941,6 +998,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_i64\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x07\0\0\0\x01\0\0\0\x07" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I64: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xa4\x97mN\xcb\x1b\x08}\x84\x02o\xa9;4\xf9*\x80\t\xe52\xe4\xe1.\x96\xfaaZ\x15\x1b\x80\x99L", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_u128__spec { @@ -956,6 +1023,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_u128\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\n\0\0\0\x01\0\0\0\n" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U128: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xb8\xec\xfb\xc6\xf0k\xa6 ie\x91\xe1\x04{q\x94\xf1Q\x1b\xa6\xda\x1a\xae/Co\xcc\x0c\x94\xbe\t\x01", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_i128__spec { @@ -971,6 +1048,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_i128\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0b\0\0\0\x01\0\0\0\x0b" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I128: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"K\xdf\x89\x8c\xc4\xc7\xb8Fz\xcb\xff\xb7^,C\xfe\xf7\xde\xd3K\xa4Y\x03Xq\xa62X5z&\x1b", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_bool__spec { @@ -986,6 +1071,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_bool\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x01\0\0\0\x01\0\0\0\x01" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_BOOL: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"]\xb8\xa6\xf2A\xb4\x93\xa4\xfa\x06\x11\xf2\x9e;\x02}\xb8\\T\xef\xd3]\"\x7f\xd4A\xbf\x89\xe2~\xaa\xc9", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_address__spec { @@ -1001,6 +1096,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0ctest_address\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x13\0\0\0\x01\0\0\0\x13" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ADDRESS: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xe1\xa1\xce]Y\n1X\xf5\xa1\xd0A\xf9\xfa\0,\xa9/2.\xfak\x83.\x9d\xf4\xbe-\xdc\xc8\x15Y", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_bytes__spec { @@ -1016,6 +1119,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ntest_bytes\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0e\0\0\0\x01\0\0\0\x0e" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_BYTES: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"5\xdd\x0c4\x83\xcc&m\xd3@{\x1d'\x01\x89b\xc4E\xe0s\x80w\xaa+\xa7ttU\xb8Z\x99|", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_bytes_n__spec { @@ -1031,6 +1142,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0ctest_bytes_n\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xee\0\0\0 \0\0\0\x01\0\0\x03\xee\0\0\0 " } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_BYTES_N: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"e\xc8ovtK?\xb2ixC\x15b\xb8\xfd\xc2\xd4pf\xc2,\xcd\x1b\xb6\xd5\x97\x16 \xbe\xcf\x81\xdd", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_symbol__spec { @@ -1046,6 +1165,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_symbol\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x11\0\0\0\x01\0\0\0\x11" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_SYMBOL: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xb3\xbb?\xa3\xe95v]E\x90^\x17\x8dzlte\x02\n%\xe8\x93\xd2f\x16\xec\xc1\x12\x0c}(^", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_vec__spec { @@ -1061,6 +1188,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_vec\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xea\0\0\0\x04\0\0\0\x01\0\0\x03\xea\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_VEC: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"il\x1aVT\xad'\\T\xdf\xbeC\x16\xda\xec\xf7\x93t\xea%'l\x06\x0f\xff\xbd9p_\xf3'\xef", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_map__spec { @@ -1076,6 +1211,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_map\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xec\0\0\0\x04\0\0\0\x04\0\0\0\x01\0\0\x03\xec\0\0\0\x04\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_MAP: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xe0I\xc0\xec\x08W\xe7\x18\xd3\x81E&\xcc!`\xc9\xf7\x81~p\xdd1j\xbc\x1f<\xc2\xdb&+%t", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_duration__spec { @@ -1092,6 +1235,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\rtest_duration\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\t\0\0\0\x01\0\0\0\t" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_DURATION: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\"g\xca\xf3\x95\xc5f\"\x95\xb0\t\"\x12\x01\xf7\xa7\xa7\xe3\x9a\x9a\x90\xdc\x04\xe1\xfft\xd7\xe2\x01\xad\xeb@", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_timepoint__spec { @@ -1108,6 +1261,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_timepoint\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x08\0\0\0\x01\0\0\0\x08" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_TIMEPOINT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x98S\x95 \xc6\xb1\xfa*\x0f\r\x0b\x1f\x0fu\xe9C\xdc\xc17\x07\xf5\xe7\xe4\xa3\xdd\xe4\xd2\xe2\x01\x19\x07k", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_i256__spec { @@ -1123,6 +1286,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_i256\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\r\0\0\0\x01\0\0\0\r" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I256: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\x7f\xef\xe5_|\xbb\xc6\xa9\xbd\xf1HP:jO8U\x8a|E\x03C\xc29\xd1c\xe5\xa1\xf8Q)?", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_u256__spec { @@ -1138,6 +1309,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_u256\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0c\0\0\0\x01\0\0\0\x0c" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U256: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xe3\xff\x18\xda\xd9V\x04P.\xc3\x0bX\xbd\x95\xb2\03U_\x9a~\xb82\"t\xff\x90=,o\x11\x89", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_enum_unit__spec { @@ -1154,6 +1333,19 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_enum_unit\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\nMyEnumUnit\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\nMyEnumUnit\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ENUM_UNIT: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"\x12fTH\xb0\xbd\xb3\xfb\x8f\r&\x857\xf4\xbc\x05\x16\xfa\xfc\x0ey\xee\x07\ra\x18\x80\xa1\x1e4\xbe+", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_enum_variants__spec { @@ -1170,6 +1362,19 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x12test_enum_variants\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\x0eMyEnumVariants\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x0eMyEnumVariants\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ENUM_VARIANTS: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"\xbf\xb8\x9d\xfbU@\x9d_\n\x9b\xb9<`\x90\xda\x14E\x17\xdd{\xd4<\xc2\xadL\xd7f\xaf\x84\xae\xbfe", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); impl<'a> ContractClient<'a> { /// Test i32 values. pub fn test_i32(&self, v: &i32) -> i32 { diff --git a/tests-expanded/test_contracttrait_path_crate_tests.rs b/tests-expanded/test_contracttrait_path_crate_tests.rs index 0f58965d7..6bc0d151a 100644 --- a/tests-expanded/test_contracttrait_path_crate_tests.rs +++ b/tests-expanded/test_contracttrait_path_crate_tests.rs @@ -394,6 +394,13 @@ impl ContractCratePath { *b"\0\0\0\0\0\0\0\0\0\0\0\x11crate_path_method\0\0\0\0\0\0\0\0\0\0\x01\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTCRATEPATH_CRATE_PATH_METHOD: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\x8e\xe3\xb7e\r\x17b\xb7\xc7\xc1\t\xa8l\x9f\xdevGZ46\x1a\xe1\x87\x8a\xf6O=\xa4.j\x03I", + [], + ); impl<'a> ContractCratePathClient<'a> { pub fn crate_path_method(&self) -> u32 { use core::ops::Not; diff --git a/tests-expanded/test_contracttrait_path_crate_wasm32v1-none.rs b/tests-expanded/test_contracttrait_path_crate_wasm32v1-none.rs index 3d6a6387d..2a83ceb61 100644 --- a/tests-expanded/test_contracttrait_path_crate_wasm32v1-none.rs +++ b/tests-expanded/test_contracttrait_path_crate_wasm32v1-none.rs @@ -139,6 +139,14 @@ impl ContractCratePath { *b"\0\0\0\0\0\0\0\0\0\0\0\x11crate_path_method\0\0\0\0\0\0\0\0\0\0\x01\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTCRATEPATH_CRATE_PATH_METHOD: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\x8e\xe3\xb7e\r\x17b\xb7\xc7\xc1\t\xa8l\x9f\xdevGZ46\x1a\xe1\x87\x8a\xf6O=\xa4.j\x03I", + [], + ); impl<'a> ContractCratePathClient<'a> { pub fn crate_path_method(&self) -> u32 { use core::ops::Not; diff --git a/tests-expanded/test_contracttrait_path_global_tests.rs b/tests-expanded/test_contracttrait_path_global_tests.rs index a26db70e0..64a093513 100644 --- a/tests-expanded/test_contracttrait_path_global_tests.rs +++ b/tests-expanded/test_contracttrait_path_global_tests.rs @@ -1247,6 +1247,15 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0-Test u32 values.\nReturns the input unchanged.\0\0\0\0\0\0\x08test_u32\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x04\0\0\0\x01\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_U32: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x8dR\xda\x86B-/\xc4kN\x18Z\xecF\xf8\xc8\xb8\xa7!U\x86\x99\x8bv@#\xd2\x92\x02\xd3\x96\x1d", + [], +); #[doc(hidden)] /// Test i32 values. #[allow(non_snake_case)] @@ -1265,6 +1274,13 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\x10Test i32 values.\0\0\0\x08test_i32\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x05\0\0\0\x01\0\0\0\x05" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_I32: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"RO\xc6\xf8W\x07\xe9\xe3_\xe3J9D\xa5\x87\xc3\x9d`\x04c\xa5\xb3%\xe91\x07#E\xc2\xb3l\xd9", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_u64__spec { @@ -1280,6 +1296,15 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_u64\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x06\0\0\0\x01\0\0\0\x06" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_U64: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xeaQ\x08\xd6\xb9\xb9\xe62\x87\xb7\x81$\xf6\x8f\x81\x98\xa5\xae\x1c/\xbc\x9c\x8c\xc4\x95\xc15\xbeg\xb4\xc4\t", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_i64__spec { @@ -1295,6 +1320,15 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_i64\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x07\0\0\0\x01\0\0\0\x07" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_I64: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xa4\x97mN\xcb\x1b\x08}\x84\x02o\xa9;4\xf9*\x80\t\xe52\xe4\xe1.\x96\xfaaZ\x15\x1b\x80\x99L", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_u128__spec { @@ -1310,6 +1344,15 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_u128\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\n\0\0\0\x01\0\0\0\n" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_U128: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xb8\xec\xfb\xc6\xf0k\xa6 ie\x91\xe1\x04{q\x94\xf1Q\x1b\xa6\xda\x1a\xae/Co\xcc\x0c\x94\xbe\t\x01", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_i128__spec { @@ -1325,6 +1368,13 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_i128\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0b\0\0\0\x01\0\0\0\x0b" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_I128: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"K\xdf\x89\x8c\xc4\xc7\xb8Fz\xcb\xff\xb7^,C\xfe\xf7\xde\xd3K\xa4Y\x03Xq\xa62X5z&\x1b", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_bool__spec { @@ -1340,6 +1390,15 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_bool\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x01\0\0\0\x01\0\0\0\x01" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_BOOL: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"]\xb8\xa6\xf2A\xb4\x93\xa4\xfa\x06\x11\xf2\x9e;\x02}\xb8\\T\xef\xd3]\"\x7f\xd4A\xbf\x89\xe2~\xaa\xc9", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_address__spec { @@ -1355,6 +1414,13 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x0ctest_address\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x13\0\0\0\x01\0\0\0\x13" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_ADDRESS: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xe1\xa1\xce]Y\n1X\xf5\xa1\xd0A\xf9\xfa\0,\xa9/2.\xfak\x83.\x9d\xf4\xbe-\xdc\xc8\x15Y", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_bytes__spec { @@ -1370,6 +1436,13 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\ntest_bytes\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0e\0\0\0\x01\0\0\0\x0e" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_BYTES: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"5\xdd\x0c4\x83\xcc&m\xd3@{\x1d'\x01\x89b\xc4E\xe0s\x80w\xaa+\xa7ttU\xb8Z\x99|", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_bytes_n__spec { @@ -1385,6 +1458,13 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x0ctest_bytes_n\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xee\0\0\0 \0\0\0\x01\0\0\x03\xee\0\0\0 " } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_BYTES_N: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"e\xc8ovtK?\xb2ixC\x15b\xb8\xfd\xc2\xd4pf\xc2,\xcd\x1b\xb6\xd5\x97\x16 \xbe\xcf\x81\xdd", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_string__spec { @@ -1400,6 +1480,15 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_string\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x10\0\0\0\x01\0\0\0\x10" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_STRING: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"G\xfe^\xa9(|>\x01\xc9\xf4\x9f\xfe\xb8\x88\xde8K\xefn\xb7\xd8\xa8\xbb.\xca'\xa9C\xb9\xe2\x0f\x8d", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_symbol__spec { @@ -1415,6 +1504,13 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_symbol\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x11\0\0\0\x01\0\0\0\x11" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_SYMBOL: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xb3\xbb?\xa3\xe95v]E\x90^\x17\x8dzlte\x02\n%\xe8\x93\xd2f\x16\xec\xc1\x12\x0c}(^", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_vec__spec { @@ -1430,6 +1526,13 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_vec\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xea\0\0\0\x04\0\0\0\x01\0\0\x03\xea\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_VEC: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"il\x1aVT\xad'\\T\xdf\xbeC\x16\xda\xec\xf7\x93t\xea%'l\x06\x0f\xff\xbd9p_\xf3'\xef", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_map__spec { @@ -1445,6 +1548,13 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_map\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xec\0\0\0\x04\0\0\0\x04\0\0\0\x01\0\0\x03\xec\0\0\0\x04\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_MAP: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xe0I\xc0\xec\x08W\xe7\x18\xd3\x81E&\xcc!`\xc9\xf7\x81~p\xdd1j\xbc\x1f<\xc2\xdb&+%t", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_duration__spec { @@ -1460,6 +1570,15 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\rtest_duration\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\t\0\0\0\x01\0\0\0\t" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_DURATION: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\"g\xca\xf3\x95\xc5f\"\x95\xb0\t\"\x12\x01\xf7\xa7\xa7\xe3\x9a\x9a\x90\xdc\x04\xe1\xfft\xd7\xe2\x01\xad\xeb@", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_timepoint__spec { @@ -1475,6 +1594,15 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_timepoint\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x08\0\0\0\x01\0\0\0\x08" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_TIMEPOINT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x98S\x95 \xc6\xb1\xfa*\x0f\r\x0b\x1f\x0fu\xe9C\xdc\xc17\x07\xf5\xe7\xe4\xa3\xdd\xe4\xd2\xe2\x01\x19\x07k", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_i256__spec { @@ -1490,6 +1618,13 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_i256\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\r\0\0\0\x01\0\0\0\r" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_I256: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\x7f\xef\xe5_|\xbb\xc6\xa9\xbd\xf1HP:jO8U\x8a|E\x03C\xc29\xd1c\xe5\xa1\xf8Q)?", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_u256__spec { @@ -1505,6 +1640,13 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_u256\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0c\0\0\0\x01\0\0\0\x0c" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_U256: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xe3\xff\x18\xda\xd9V\x04P.\xc3\x0bX\xbd\x95\xb2\03U_\x9a~\xb82\"t\xff\x90=,o\x11\x89", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_env_param__spec { @@ -1520,6 +1662,13 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_env_param\0\0\0\0\0\0\0\0\0\x01\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_ENV_PARAM: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xf5\xeb\xae\xe9\xa1L\xe56?k \x12\x8eT\xf3\xfd\x0f\xbc2\xd6XL\xed-\xa9Y}\xe5L9\x85\x16", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_struct__spec { @@ -1535,6 +1684,16 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_struct\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\x08MyStruct\0\0\0\x01\0\0\x07\xd0\0\0\0\x08MyStruct" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_STRUCT: [u8; 106usize] = + soroban_sdk::spec_shaking::encode_graph_record::<106usize, 2usize>( + 0, + *b"\xe3J\x02q\xbbS\x01G\xe1\x81W'^@\xb2\x8b8\xb1\xe3\x8c\xce'\xde\x8b\xc8]\xc0\xb7Dcl ", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_enum_unit__spec { @@ -1550,6 +1709,18 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_enum_unit\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\nMyEnumUnit\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\nMyEnumUnit\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_ENUM_UNIT: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"\x12fTH\xb0\xbd\xb3\xfb\x8f\r&\x857\xf4\xbc\x05\x16\xfa\xfc\x0ey\xee\x07\ra\x18\x80\xa1\x1e4\xbe+", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_enum_variants__spec { @@ -1565,6 +1736,18 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x12test_enum_variants\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\x0eMyEnumVariants\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x0eMyEnumVariants\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_ENUM_VARIANTS: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"\xbf\xb8\x9d\xfbU@\x9d_\n\x9b\xb9<`\x90\xda\x14E\x17\xdd{\xd4<\xc2\xadL\xd7f\xaf\x84\xae\xbfe", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); impl<'a> ContractGlobalPathClient<'a> { /// Test u32 values. /// Returns the input unchanged. diff --git a/tests-expanded/test_contracttrait_path_global_wasm32v1-none.rs b/tests-expanded/test_contracttrait_path_global_wasm32v1-none.rs index d70d54997..78b17235f 100644 --- a/tests-expanded/test_contracttrait_path_global_wasm32v1-none.rs +++ b/tests-expanded/test_contracttrait_path_global_wasm32v1-none.rs @@ -727,6 +727,16 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0-Test u32 values.\nReturns the input unchanged.\0\0\0\0\0\0\x08test_u32\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x04\0\0\0\x01\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_U32: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x8dR\xda\x86B-/\xc4kN\x18Z\xecF\xf8\xc8\xb8\xa7!U\x86\x99\x8bv@#\xd2\x92\x02\xd3\x96\x1d", + [], +); #[doc(hidden)] /// Test i32 values. #[allow(non_snake_case)] @@ -746,6 +756,14 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\x10Test i32 values.\0\0\0\x08test_i32\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x05\0\0\0\x01\0\0\0\x05" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_I32: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"RO\xc6\xf8W\x07\xe9\xe3_\xe3J9D\xa5\x87\xc3\x9d`\x04c\xa5\xb3%\xe91\x07#E\xc2\xb3l\xd9", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_u64__spec { @@ -762,6 +780,16 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_u64\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x06\0\0\0\x01\0\0\0\x06" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_U64: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xeaQ\x08\xd6\xb9\xb9\xe62\x87\xb7\x81$\xf6\x8f\x81\x98\xa5\xae\x1c/\xbc\x9c\x8c\xc4\x95\xc15\xbeg\xb4\xc4\t", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_i64__spec { @@ -778,6 +806,16 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_i64\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x07\0\0\0\x01\0\0\0\x07" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_I64: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xa4\x97mN\xcb\x1b\x08}\x84\x02o\xa9;4\xf9*\x80\t\xe52\xe4\xe1.\x96\xfaaZ\x15\x1b\x80\x99L", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_u128__spec { @@ -794,6 +832,16 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_u128\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\n\0\0\0\x01\0\0\0\n" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_U128: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xb8\xec\xfb\xc6\xf0k\xa6 ie\x91\xe1\x04{q\x94\xf1Q\x1b\xa6\xda\x1a\xae/Co\xcc\x0c\x94\xbe\t\x01", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_i128__spec { @@ -810,6 +858,14 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_i128\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0b\0\0\0\x01\0\0\0\x0b" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_I128: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"K\xdf\x89\x8c\xc4\xc7\xb8Fz\xcb\xff\xb7^,C\xfe\xf7\xde\xd3K\xa4Y\x03Xq\xa62X5z&\x1b", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_bool__spec { @@ -826,6 +882,16 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_bool\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x01\0\0\0\x01\0\0\0\x01" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_BOOL: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"]\xb8\xa6\xf2A\xb4\x93\xa4\xfa\x06\x11\xf2\x9e;\x02}\xb8\\T\xef\xd3]\"\x7f\xd4A\xbf\x89\xe2~\xaa\xc9", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_address__spec { @@ -842,6 +908,14 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x0ctest_address\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x13\0\0\0\x01\0\0\0\x13" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_ADDRESS: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xe1\xa1\xce]Y\n1X\xf5\xa1\xd0A\xf9\xfa\0,\xa9/2.\xfak\x83.\x9d\xf4\xbe-\xdc\xc8\x15Y", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_bytes__spec { @@ -858,6 +932,14 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\ntest_bytes\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0e\0\0\0\x01\0\0\0\x0e" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_BYTES: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"5\xdd\x0c4\x83\xcc&m\xd3@{\x1d'\x01\x89b\xc4E\xe0s\x80w\xaa+\xa7ttU\xb8Z\x99|", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_bytes_n__spec { @@ -874,6 +956,14 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x0ctest_bytes_n\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xee\0\0\0 \0\0\0\x01\0\0\x03\xee\0\0\0 " } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_BYTES_N: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"e\xc8ovtK?\xb2ixC\x15b\xb8\xfd\xc2\xd4pf\xc2,\xcd\x1b\xb6\xd5\x97\x16 \xbe\xcf\x81\xdd", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_string__spec { @@ -890,6 +980,16 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_string\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x10\0\0\0\x01\0\0\0\x10" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_STRING: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"G\xfe^\xa9(|>\x01\xc9\xf4\x9f\xfe\xb8\x88\xde8K\xefn\xb7\xd8\xa8\xbb.\xca'\xa9C\xb9\xe2\x0f\x8d", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_symbol__spec { @@ -906,6 +1006,14 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_symbol\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x11\0\0\0\x01\0\0\0\x11" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_SYMBOL: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xb3\xbb?\xa3\xe95v]E\x90^\x17\x8dzlte\x02\n%\xe8\x93\xd2f\x16\xec\xc1\x12\x0c}(^", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_vec__spec { @@ -922,6 +1030,14 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_vec\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xea\0\0\0\x04\0\0\0\x01\0\0\x03\xea\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_VEC: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"il\x1aVT\xad'\\T\xdf\xbeC\x16\xda\xec\xf7\x93t\xea%'l\x06\x0f\xff\xbd9p_\xf3'\xef", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_map__spec { @@ -938,6 +1054,14 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_map\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xec\0\0\0\x04\0\0\0\x04\0\0\0\x01\0\0\x03\xec\0\0\0\x04\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_MAP: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xe0I\xc0\xec\x08W\xe7\x18\xd3\x81E&\xcc!`\xc9\xf7\x81~p\xdd1j\xbc\x1f<\xc2\xdb&+%t", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_duration__spec { @@ -954,6 +1078,16 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\rtest_duration\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\t\0\0\0\x01\0\0\0\t" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_DURATION: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\"g\xca\xf3\x95\xc5f\"\x95\xb0\t\"\x12\x01\xf7\xa7\xa7\xe3\x9a\x9a\x90\xdc\x04\xe1\xfft\xd7\xe2\x01\xad\xeb@", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_timepoint__spec { @@ -970,6 +1104,16 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_timepoint\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x08\0\0\0\x01\0\0\0\x08" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_TIMEPOINT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x98S\x95 \xc6\xb1\xfa*\x0f\r\x0b\x1f\x0fu\xe9C\xdc\xc17\x07\xf5\xe7\xe4\xa3\xdd\xe4\xd2\xe2\x01\x19\x07k", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_i256__spec { @@ -986,6 +1130,14 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_i256\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\r\0\0\0\x01\0\0\0\r" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_I256: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\x7f\xef\xe5_|\xbb\xc6\xa9\xbd\xf1HP:jO8U\x8a|E\x03C\xc29\xd1c\xe5\xa1\xf8Q)?", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_u256__spec { @@ -1002,6 +1154,14 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_u256\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0c\0\0\0\x01\0\0\0\x0c" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_U256: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xe3\xff\x18\xda\xd9V\x04P.\xc3\x0bX\xbd\x95\xb2\03U_\x9a~\xb82\"t\xff\x90=,o\x11\x89", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_env_param__spec { @@ -1018,6 +1178,14 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_env_param\0\0\0\0\0\0\0\0\0\x01\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_ENV_PARAM: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xf5\xeb\xae\xe9\xa1L\xe56?k \x12\x8eT\xf3\xfd\x0f\xbc2\xd6XL\xed-\xa9Y}\xe5L9\x85\x16", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_struct__spec { @@ -1034,6 +1202,17 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_struct\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\x08MyStruct\0\0\0\x01\0\0\x07\xd0\0\0\0\x08MyStruct" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_STRUCT: [u8; 106usize] = + soroban_sdk::spec_shaking::encode_graph_record::<106usize, 2usize>( + 0, + *b"\xe3J\x02q\xbbS\x01G\xe1\x81W'^@\xb2\x8b8\xb1\xe3\x8c\xce'\xde\x8b\xc8]\xc0\xb7Dcl ", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_enum_unit__spec { @@ -1050,6 +1229,19 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_enum_unit\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\nMyEnumUnit\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\nMyEnumUnit\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_ENUM_UNIT: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"\x12fTH\xb0\xbd\xb3\xfb\x8f\r&\x857\xf4\xbc\x05\x16\xfa\xfc\x0ey\xee\x07\ra\x18\x80\xa1\x1e4\xbe+", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __ContractGlobalPath__test_enum_variants__spec { @@ -1066,6 +1258,19 @@ impl ContractGlobalPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x12test_enum_variants\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\x0eMyEnumVariants\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x0eMyEnumVariants\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTGLOBALPATH_TEST_ENUM_VARIANTS: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"\xbf\xb8\x9d\xfbU@\x9d_\n\x9b\xb9<`\x90\xda\x14E\x17\xdd{\xd4<\xc2\xadL\xd7f\xaf\x84\xae\xbfe", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); impl<'a> ContractGlobalPathClient<'a> { /// Test u32 values. /// Returns the input unchanged. diff --git a/tests-expanded/test_contracttrait_path_relative_tests.rs b/tests-expanded/test_contracttrait_path_relative_tests.rs index 4e37dbf50..f93dda082 100644 --- a/tests-expanded/test_contracttrait_path_relative_tests.rs +++ b/tests-expanded/test_contracttrait_path_relative_tests.rs @@ -395,6 +395,15 @@ impl ContractRelativePath { *b"\0\0\0\0\0\0\0\0\0\0\0\x14relative_path_method\0\0\0\0\0\0\0\x01\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTRELATIVEPATH_RELATIVE_PATH_METHOD: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x1fS\x17\x85\xd9qx\x14\0S\xce1\xd8\x05\x93\xa8\xc1\x94\x8f\x9e\x13\x0b\xa9\xdf\xe3\xddG8\xce+\x91!", + [], +); impl<'a> ContractRelativePathClient<'a> { pub fn relative_path_method(&self) -> u32 { use core::ops::Not; diff --git a/tests-expanded/test_contracttrait_path_relative_wasm32v1-none.rs b/tests-expanded/test_contracttrait_path_relative_wasm32v1-none.rs index 3e9229463..35b625fe7 100644 --- a/tests-expanded/test_contracttrait_path_relative_wasm32v1-none.rs +++ b/tests-expanded/test_contracttrait_path_relative_wasm32v1-none.rs @@ -140,6 +140,16 @@ impl ContractRelativePath { *b"\0\0\0\0\0\0\0\0\0\0\0\x14relative_path_method\0\0\0\0\0\0\0\x01\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTRELATIVEPATH_RELATIVE_PATH_METHOD: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x1fS\x17\x85\xd9qx\x14\0S\xce1\xd8\x05\x93\xa8\xc1\x94\x8f\x9e\x13\x0b\xa9\xdf\xe3\xddG8\xce+\x91!", + [], +); impl<'a> ContractRelativePathClient<'a> { pub fn relative_path_method(&self) -> u32 { use core::ops::Not; diff --git a/tests-expanded/test_contracttrait_path_self_tests.rs b/tests-expanded/test_contracttrait_path_self_tests.rs index 16f4f52cd..229808ea1 100644 --- a/tests-expanded/test_contracttrait_path_self_tests.rs +++ b/tests-expanded/test_contracttrait_path_self_tests.rs @@ -386,6 +386,13 @@ impl ContractSelfPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x10self_path_method\0\0\0\0\0\0\0\x01\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTSELFPATH_SELF_PATH_METHOD: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xc3\xcb5,\xd0\r\x1a^JIu\x0b=\xf2\xad\0\x16y\xc5LJm\xba\xfa,\xfd\xbe\xfb\x87\xa4X\xbb", + [], + ); impl<'a> ContractSelfPathClient<'a> { pub fn self_path_method(&self) -> u32 { use core::ops::Not; diff --git a/tests-expanded/test_contracttrait_path_self_wasm32v1-none.rs b/tests-expanded/test_contracttrait_path_self_wasm32v1-none.rs index 53e81cac0..ea9983fb3 100644 --- a/tests-expanded/test_contracttrait_path_self_wasm32v1-none.rs +++ b/tests-expanded/test_contracttrait_path_self_wasm32v1-none.rs @@ -131,6 +131,14 @@ impl ContractSelfPath { *b"\0\0\0\0\0\0\0\0\0\0\0\x10self_path_method\0\0\0\0\0\0\0\x01\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACTSELFPATH_SELF_PATH_METHOD: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xc3\xcb5,\xd0\r\x1a^JIu\x0b=\xf2\xad\0\x16y\xc5LJm\xba\xfa,\xfd\xbe\xfb\x87\xa4X\xbb", + [], + ); impl<'a> ContractSelfPathClient<'a> { pub fn self_path_method(&self) -> u32 { use core::ops::Not; diff --git a/tests-expanded/test_contracttrait_path_super_tests.rs b/tests-expanded/test_contracttrait_path_super_tests.rs index e42054fb0..b47d057d6 100644 --- a/tests-expanded/test_contracttrait_path_super_tests.rs +++ b/tests-expanded/test_contracttrait_path_super_tests.rs @@ -391,6 +391,13 @@ pub mod submodule { *b"\0\0\0\0\0\0\0\0\0\0\0\x11super_path_method\0\0\0\0\0\0\0\0\0\0\x01\0\0\0\x04" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACTSUPERPATH_SUPER_PATH_METHOD: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xb8\x10'J9fl\xe7\x96\x84u\xc89\xa8\xedN6d\xe8F\0\x8ccz\xb00\xe7t\xde\x0b:\xc1", + [], + ); impl<'a> ContractSuperPathClient<'a> { pub fn super_path_method(&self) -> u32 { use core::ops::Not; diff --git a/tests-expanded/test_contracttrait_path_super_wasm32v1-none.rs b/tests-expanded/test_contracttrait_path_super_wasm32v1-none.rs index 712285024..a8495446a 100644 --- a/tests-expanded/test_contracttrait_path_super_wasm32v1-none.rs +++ b/tests-expanded/test_contracttrait_path_super_wasm32v1-none.rs @@ -136,6 +136,14 @@ pub mod submodule { *b"\0\0\0\0\0\0\0\0\0\0\0\x11super_path_method\0\0\0\0\0\0\0\0\0\0\x01\0\0\0\x04" } } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACTSUPERPATH_SUPER_PATH_METHOD: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xb8\x10'J9fl\xe7\x96\x84u\xc89\xa8\xedN6d\xe8F\0\x8ccz\xb00\xe7t\xde\x0b:\xc1", + [], + ); impl<'a> ContractSuperPathClient<'a> { pub fn super_path_method(&self) -> u32 { use core::ops::Not; diff --git a/tests-expanded/test_contracttrait_trait_tests.rs b/tests-expanded/test_contracttrait_trait_tests.rs index 9b6611d36..eae4d64ff 100644 --- a/tests-expanded/test_contracttrait_trait_tests.rs +++ b/tests-expanded/test_contracttrait_trait_tests.rs @@ -55,14 +55,17 @@ impl MyStruct { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x08MyStruct\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x07\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x07" } } -impl soroban_sdk::SpecShakingMarker for MyStruct { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for MyStruct { + const SPEC_TYPE_ID: [u8; 32] = + *b"\x08\xd4\xa7b\xae1|\xdd\xd3\xf5\xf9rU\xe4{\xebN\tY\xa4$\xc2\x93I\x94F*R\xe2\x0cwp"; } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_MYSTRUCT: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\x08\xd4\xa7b\xae1|\xdd\xd3\xf5\xf9rU\xe4{\xebN\tY\xa4$\xc2\x93I\x94F*R\xe2\x0cwp", + [], + ); impl soroban_sdk::TryFromVal for MyStruct { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -473,11 +476,17 @@ impl MyEnumUnit { *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\nMyEnumUnit\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01A\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01B\0\0\0\0\0\0\x02" } } -impl soroban_sdk::SpecShakingMarker for MyEnumUnit { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() {} +impl soroban_sdk::spec_shaking::SpecTypeId for MyEnumUnit { + const SPEC_TYPE_ID: [u8; 32] = + *b"2E\x1b4\x1c\x83\xab\xeb\"\xdf!\x80\x95D/G\xbf\xc6\xcb\x8f_>\xdcR\xf8W\xf5T\x90\xee\xb4m"; } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_MYENUMUNIT: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"2E\x1b4\x1c\x83\xab\xeb\"\xdf!\x80\x95D/G\xbf\xc6\xcb\x8f_>\xdcR\xf8W\xf5T\x90\xee\xb4m", + [], + ); impl soroban_sdk::TryFromVal for MyEnumUnit { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -823,14 +832,20 @@ impl MyEnumVariants { *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x0eMyEnumVariants\0\0\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x04VarA\0\0\0\x01\0\0\0\0\0\0\0\x04VarB\0\0\0\x01\0\0\x07\xd0\0\0\0\x08MyStruct\0\0\0\x01\0\0\0\0\0\0\0\x04VarC\0\0\0\x01\0\0\x07\xd0\0\0\0\nMyEnumUnit\0\0" } } -impl soroban_sdk::SpecShakingMarker for MyEnumVariants { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for MyEnumVariants { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xceHo\xd4mpUm\xc4G\xbc%\xc9j\x1b\xb7\x82R\xb3e\xb5\x10\x9b\xa0\x05\xe2_I:G^B"; } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_MYENUMVARIANTS: [u8; 106usize] = + soroban_sdk::spec_shaking::encode_graph_record::<106usize, 2usize>( + 2, + *b"\xceHo\xd4mpUm\xc4G\xbc%\xc9j\x1b\xb7\x82R\xb3e\xb5\x10\x9b\xa0\x05\xe2_I:G^B", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); impl soroban_sdk::TryFromVal for MyEnumVariants { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -4676,6 +4691,15 @@ mod test { *b"\0\0\0\0\0\0\0-Test u32 values.\nReturns the input unchanged.\0\0\0\0\0\0\x08test_u32\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x04\0\0\0\x01\0\0\0\x04" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U32: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b"\x8dR\xda\x86B-/\xc4kN\x18Z\xecF\xf8\xc8\xb8\xa7!U\x86\x99\x8bv@#\xd2\x92\x02\xd3\x96\x1d", + [], + ); #[doc(hidden)] /// Test i32 values. #[allow(non_snake_case)] @@ -4693,6 +4717,15 @@ mod test { *b"\0\0\0\0\0\0\0\x10Test i32 values.\0\0\0\x08test_i32\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x05\0\0\0\x01\0\0\0\x05" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I32: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b"RO\xc6\xf8W\x07\xe9\xe3_\xe3J9D\xa5\x87\xc3\x9d`\x04c\xa5\xb3%\xe91\x07#E\xc2\xb3l\xd9", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_u64__spec { @@ -4707,6 +4740,15 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_u64\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x06\0\0\0\x01\0\0\0\x06" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U64: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b"\xeaQ\x08\xd6\xb9\xb9\xe62\x87\xb7\x81$\xf6\x8f\x81\x98\xa5\xae\x1c/\xbc\x9c\x8c\xc4\x95\xc15\xbeg\xb4\xc4\t", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_i64__spec { @@ -4721,6 +4763,15 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_i64\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x07\0\0\0\x01\0\0\0\x07" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I64: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b"\xa4\x97mN\xcb\x1b\x08}\x84\x02o\xa9;4\xf9*\x80\t\xe52\xe4\xe1.\x96\xfaaZ\x15\x1b\x80\x99L", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_u128__spec { @@ -4735,6 +4786,15 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_u128\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\n\0\0\0\x01\0\0\0\n" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U128: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b"\xb8\xec\xfb\xc6\xf0k\xa6 ie\x91\xe1\x04{q\x94\xf1Q\x1b\xa6\xda\x1a\xae/Co\xcc\x0c\x94\xbe\t\x01", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_i128__spec { @@ -4749,6 +4809,13 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_i128\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0b\0\0\0\x01\0\0\0\x0b" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I128: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"K\xdf\x89\x8c\xc4\xc7\xb8Fz\xcb\xff\xb7^,C\xfe\xf7\xde\xd3K\xa4Y\x03Xq\xa62X5z&\x1b", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_bool__spec { @@ -4763,6 +4830,15 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_bool\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x01\0\0\0\x01\0\0\0\x01" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_BOOL: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b"]\xb8\xa6\xf2A\xb4\x93\xa4\xfa\x06\x11\xf2\x9e;\x02}\xb8\\T\xef\xd3]\"\x7f\xd4A\xbf\x89\xe2~\xaa\xc9", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_address__spec { @@ -4778,6 +4854,15 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\x0ctest_address\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x13\0\0\0\x01\0\0\0\x13" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ADDRESS: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b"\xe1\xa1\xce]Y\n1X\xf5\xa1\xd0A\xf9\xfa\0,\xa9/2.\xfak\x83.\x9d\xf4\xbe-\xdc\xc8\x15Y", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_bytes__spec { @@ -4792,6 +4877,13 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\ntest_bytes\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0e\0\0\0\x01\0\0\0\x0e" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_BYTES: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"5\xdd\x0c4\x83\xcc&m\xd3@{\x1d'\x01\x89b\xc4E\xe0s\x80w\xaa+\xa7ttU\xb8Z\x99|", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_bytes_n__spec { @@ -4807,6 +4899,15 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\x0ctest_bytes_n\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xee\0\0\0 \0\0\0\x01\0\0\x03\xee\0\0\0 " } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_BYTES_N: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b"e\xc8ovtK?\xb2ixC\x15b\xb8\xfd\xc2\xd4pf\xc2,\xcd\x1b\xb6\xd5\x97\x16 \xbe\xcf\x81\xdd", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_string__spec { @@ -4822,6 +4923,15 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_string\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x10\0\0\0\x01\0\0\0\x10" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_STRING: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b"G\xfe^\xa9(|>\x01\xc9\xf4\x9f\xfe\xb8\x88\xde8K\xefn\xb7\xd8\xa8\xbb.\xca'\xa9C\xb9\xe2\x0f\x8d", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_symbol__spec { @@ -4837,6 +4947,13 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_symbol\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x11\0\0\0\x01\0\0\0\x11" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_SYMBOL: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xb3\xbb?\xa3\xe95v]E\x90^\x17\x8dzlte\x02\n%\xe8\x93\xd2f\x16\xec\xc1\x12\x0c}(^", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_vec__spec { @@ -4851,6 +4968,13 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_vec\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xea\0\0\0\x04\0\0\0\x01\0\0\x03\xea\0\0\0\x04" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_VEC: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"il\x1aVT\xad'\\T\xdf\xbeC\x16\xda\xec\xf7\x93t\xea%'l\x06\x0f\xff\xbd9p_\xf3'\xef", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_map__spec { @@ -4865,6 +4989,13 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\x08test_map\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xec\0\0\0\x04\0\0\0\x04\0\0\0\x01\0\0\x03\xec\0\0\0\x04\0\0\0\x04" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_MAP: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xe0I\xc0\xec\x08W\xe7\x18\xd3\x81E&\xcc!`\xc9\xf7\x81~p\xdd1j\xbc\x1f<\xc2\xdb&+%t", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_duration__spec { @@ -4880,6 +5011,15 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\rtest_duration\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\t\0\0\0\x01\0\0\0\t" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_DURATION: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b"\"g\xca\xf3\x95\xc5f\"\x95\xb0\t\"\x12\x01\xf7\xa7\xa7\xe3\x9a\x9a\x90\xdc\x04\xe1\xfft\xd7\xe2\x01\xad\xeb@", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_timepoint__spec { @@ -4895,6 +5035,15 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_timepoint\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x08\0\0\0\x01\0\0\0\x08" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_TIMEPOINT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b"\x98S\x95 \xc6\xb1\xfa*\x0f\r\x0b\x1f\x0fu\xe9C\xdc\xc17\x07\xf5\xe7\xe4\xa3\xdd\xe4\xd2\xe2\x01\x19\x07k", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_i256__spec { @@ -4909,6 +5058,13 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_i256\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\r\0\0\0\x01\0\0\0\r" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_I256: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\x7f\xef\xe5_|\xbb\xc6\xa9\xbd\xf1HP:jO8U\x8a|E\x03C\xc29\xd1c\xe5\xa1\xf8Q)?", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_u256__spec { @@ -4923,6 +5079,15 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\ttest_u256\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x0c\0\0\0\x01\0\0\0\x0c" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_U256: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b"\xe3\xff\x18\xda\xd9V\x04P.\xc3\x0bX\xbd\x95\xb2\03U_\x9a~\xb82\"t\xff\x90=,o\x11\x89", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_env_param__spec { @@ -4938,6 +5103,15 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_env_param\0\0\0\0\0\0\0\0\0\x01\0\0\0\x04" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ENV_PARAM: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b"\xf5\xeb\xae\xe9\xa1L\xe56?k \x12\x8eT\xf3\xfd\x0f\xbc2\xd6XL\xed-\xa9Y}\xe5L9\x85\x16", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_struct__spec { @@ -4953,6 +5127,16 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\x0btest_struct\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\x08MyStruct\0\0\0\x01\0\0\x07\xd0\0\0\0\x08MyStruct" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_STRUCT: [u8; 106usize] = + soroban_sdk::spec_shaking::encode_graph_record::<106usize, 2usize>( + 0, + *b"\xe3J\x02q\xbbS\x01G\xe1\x81W'^@\xb2\x8b8\xb1\xe3\x8c\xce'\xde\x8b\xc8]\xc0\xb7Dcl ", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_enum_unit__spec { @@ -4968,6 +5152,18 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\x0etest_enum_unit\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\nMyEnumUnit\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\nMyEnumUnit\0\0" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ENUM_UNIT: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, + >( + 0, + *b"\x12fTH\xb0\xbd\xb3\xfb\x8f\r&\x857\xf4\xbc\x05\x16\xfa\xfc\x0ey\xee\x07\ra\x18\x80\xa1\x1e4\xbe+", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__test_enum_variants__spec { @@ -4983,6 +5179,18 @@ mod test { *b"\0\0\0\0\0\0\0\0\0\0\0\x12test_enum_variants\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x07\xd0\0\0\0\x0eMyEnumVariants\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x0eMyEnumVariants\0\0" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_TEST_ENUM_VARIANTS: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, + >( + 0, + *b"\xbf\xb8\x9d\xfbU@\x9d_\n\x9b\xb9<`\x90\xda\x14E\x17\xdd{\xd4<\xc2\xadL\xd7f\xaf\x84\xae\xbfe", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); impl<'a> ContractClient<'a> { /// Test u32 values. /// Returns the input unchanged. diff --git a/tests-expanded/test_contracttrait_trait_wasm32v1-none.rs b/tests-expanded/test_contracttrait_trait_wasm32v1-none.rs index fda68c440..e8d4a5026 100644 --- a/tests-expanded/test_contracttrait_trait_wasm32v1-none.rs +++ b/tests-expanded/test_contracttrait_trait_wasm32v1-none.rs @@ -56,18 +56,18 @@ impl MyStruct { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x08MyStruct\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x07\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x07" } } -impl soroban_sdk::SpecShakingMarker for MyStruct { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\x08\xd4\xa7b\xae1|\xdd"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for MyStruct { + const SPEC_TYPE_ID: [u8; 32] = + *b"\x08\xd4\xa7b\xae1|\xdd\xd3\xf5\xf9rU\xe4{\xebN\tY\xa4$\xc2\x93I\x94F*R\xe2\x0cwp"; } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_MYSTRUCT: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\x08\xd4\xa7b\xae1|\xdd\xd3\xf5\xf9rU\xe4{\xebN\tY\xa4$\xc2\x93I\x94F*R\xe2\x0cwp", + [], + ); impl soroban_sdk::TryFromVal for MyStruct { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -169,16 +169,18 @@ impl MyEnumUnit { *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\nMyEnumUnit\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01A\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01B\0\0\0\0\0\0\x02" } } -impl soroban_sdk::SpecShakingMarker for MyEnumUnit { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - { - static MARKER: [u8; 14usize] = *b"SpEcV12E\x1b4\x1c\x83\xab\xeb"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for MyEnumUnit { + const SPEC_TYPE_ID: [u8; 32] = + *b"2E\x1b4\x1c\x83\xab\xeb\"\xdf!\x80\x95D/G\xbf\xc6\xcb\x8f_>\xdcR\xf8W\xf5T\x90\xee\xb4m"; } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_MYENUMUNIT: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"2E\x1b4\x1c\x83\xab\xeb\"\xdf!\x80\x95D/G\xbf\xc6\xcb\x8f_>\xdcR\xf8W\xf5T\x90\xee\xb4m", + [], + ); impl soroban_sdk::TryFromVal for MyEnumUnit { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -290,18 +292,21 @@ impl MyEnumVariants { *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x0eMyEnumVariants\0\0\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x04VarA\0\0\0\x01\0\0\0\0\0\0\0\x04VarB\0\0\0\x01\0\0\x07\xd0\0\0\0\x08MyStruct\0\0\0\x01\0\0\0\0\0\0\0\x04VarC\0\0\0\x01\0\0\x07\xd0\0\0\0\nMyEnumUnit\0\0" } } -impl soroban_sdk::SpecShakingMarker for MyEnumVariants { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xceHo\xd4mpUm"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for MyEnumVariants { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xceHo\xd4mpUm\xc4G\xbc%\xc9j\x1b\xb7\x82R\xb3e\xb5\x10\x9b\xa0\x05\xe2_I:G^B"; } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_MYENUMVARIANTS: [u8; 106usize] = + soroban_sdk::spec_shaking::encode_graph_record::<106usize, 2usize>( + 2, + *b"\xceHo\xd4mpUm\xc4G\xbc%\xc9j\x1b\xb7\x82R\xb3e\xb5\x10\x9b\xa0\x05\xe2_I:G^B", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); impl soroban_sdk::TryFromVal for MyEnumVariants { type Error = soroban_sdk::ConversionError; #[inline(always)] diff --git a/tests-expanded/test_empty_tests.rs b/tests-expanded/test_empty_tests.rs index e5a416219..b979028e5 100644 --- a/tests-expanded/test_empty_tests.rs +++ b/tests-expanded/test_empty_tests.rs @@ -153,6 +153,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x05empty\0\0\0\0\0\0\0\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EMPTY: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x02\xe7\xd0\x8a\xd9\x1eRo\x96A\x9b\x0b~\x9b\xdd\x94/\xdc\x8ai\xe5:\xd7\x8b\x93(h\x18\x84\xac\x95\x98", + [], +); impl<'a> ContractClient<'a> { pub fn empty(&self) -> () { use core::ops::Not; diff --git a/tests-expanded/test_empty_wasm32v1-none.rs b/tests-expanded/test_empty_wasm32v1-none.rs index 2d08f7afd..ac531ad66 100644 --- a/tests-expanded/test_empty_wasm32v1-none.rs +++ b/tests-expanded/test_empty_wasm32v1-none.rs @@ -42,6 +42,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x05empty\0\0\0\0\0\0\0\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EMPTY: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x02\xe7\xd0\x8a\xd9\x1eRo\x96A\x9b\x0b~\x9b\xdd\x94/\xdc\x8ai\xe5:\xd7\x8b\x93(h\x18\x84\xac\x95\x98", + [], +); impl<'a> ContractClient<'a> { pub fn empty(&self) -> () { use core::ops::Not; diff --git a/tests-expanded/test_errors_tests.rs b/tests-expanded/test_errors_tests.rs index 500770f1c..a2a3485ec 100644 --- a/tests-expanded/test_errors_tests.rs +++ b/tests-expanded/test_errors_tests.rs @@ -163,11 +163,18 @@ impl Flag { *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x04Flag\0\0\0\x05\0\0\0\0\0\0\0\x01A\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01B\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01C\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01D\0\0\0\0\0\0\x03\0\0\0\0\0\0\0\x01E\0\0\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for Flag { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() {} +impl soroban_sdk::spec_shaking::SpecTypeId for Flag { + const SPEC_TYPE_ID: [u8; 32] = *b"g\x19\x8d\xc6\x8aP\xeb\xb7\xf3C>\x01h\xac\xec\xf6x\xa0\xeeq&Ib=\xa2\xe0\xe2P\x9dg\xdd\x85"; } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_FLAG: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"g\x19\x8d\xc6\x8aP\xeb\xb7\xf3C>\x01h\xac\xec\xf6x\xa0\xeeq&Ib=\xa2\xe0\xe2P\x9dg\xdd\x85", + [], +); impl soroban_sdk::TryFromVal for Flag { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -510,11 +517,23 @@ impl Error { *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x05Error\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x07AnError\0\0\0\0\x01" } } -impl soroban_sdk::SpecShakingMarker for Error { +impl soroban_sdk::spec_shaking::SpecTypeId for Error { + const SPEC_TYPE_ID: [u8; 32] = *b"\xbc\x04\x04\xea\xa4\x9e6(]\xfd\x81&\xd9\xf8d+\xb4\x03\x83\x81Df\x88\x9alm\xe1\xbd\xb2\xf4r\xde"; +} +impl soroban_sdk::spec_shaking::SpecShakingMarker for Error { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() {} } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_ERROR: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\xbc\x04\x04\xea\xa4\x9e6(]\xfd\x81&\xd9\xf8d+\xb4\x03\x83\x81Df\x88\x9alm\xe1\xbd\xb2\xf4r\xde", + [], +); impl TryFrom for Error { type Error = soroban_sdk::Error; #[inline(always)] @@ -677,6 +696,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x05hello\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04flag\0\0\x07\xd0\0\0\0\x04Flag\0\0\0\x01\0\0\x03\xe9\0\0\0\x11\0\0\0\x03" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_HELLO: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"=\xdd\xb5\xf0Pk\xc3\x82{\xdf\xd1v\xd2\xe2\xbd\xa5\xb4|\xfc\x18x\x1eY\x18\x88\xf0\xbd\xe1;`\xe7\x14", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__persisted__spec { @@ -691,6 +719,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\tpersisted\0\0\0\0\0\0\0\0\0\0\x01\0\0\0\x01" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_PERSISTED: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"f\xa64\xf3\xb6\xcc/1nKG$KmS\xdc.&g\xe4v\xfeh\xdc\xe7\xf9\xdd\x9d\xd2q$\xa0", + [], + ); impl<'a> ContractClient<'a> { pub fn hello(&self, flag: &Flag) -> Symbol { use core::ops::Not; diff --git a/tests-expanded/test_errors_wasm32v1-none.rs b/tests-expanded/test_errors_wasm32v1-none.rs index 3f73508cc..e3801f25e 100644 --- a/tests-expanded/test_errors_wasm32v1-none.rs +++ b/tests-expanded/test_errors_wasm32v1-none.rs @@ -52,16 +52,19 @@ impl Flag { *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x04Flag\0\0\0\x05\0\0\0\0\0\0\0\x01A\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01B\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01C\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01D\0\0\0\0\0\0\x03\0\0\0\0\0\0\0\x01E\0\0\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for Flag { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - { - static MARKER: [u8; 14usize] = *b"SpEcV1g\x19\x8d\xc6\x8aP\xeb\xb7"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } -} +impl soroban_sdk::spec_shaking::SpecTypeId for Flag { + const SPEC_TYPE_ID: [u8; 32] = *b"g\x19\x8d\xc6\x8aP\xeb\xb7\xf3C>\x01h\xac\xec\xf6x\xa0\xeeq&Ib=\xa2\xe0\xe2P\x9dg\xdd\x85"; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_FLAG: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"g\x19\x8d\xc6\x8aP\xeb\xb7\xf3C>\x01h\xac\xec\xf6x\xa0\xeeq&Ib=\xa2\xe0\xe2P\x9dg\xdd\x85", + [], +); impl soroban_sdk::TryFromVal for Flag { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -140,7 +143,10 @@ impl Error { *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x05Error\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x07AnError\0\0\0\0\x01" } } -impl soroban_sdk::SpecShakingMarker for Error { +impl soroban_sdk::spec_shaking::SpecTypeId for Error { + const SPEC_TYPE_ID: [u8; 32] = *b"\xbc\x04\x04\xea\xa4\x9e6(]\xfd\x81&\xd9\xf8d+\xb4\x03\x83\x81Df\x88\x9alm\xe1\xbd\xb2\xf4r\xde"; +} +impl soroban_sdk::spec_shaking::SpecShakingMarker for Error { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() { @@ -150,6 +156,16 @@ impl soroban_sdk::SpecShakingMarker for Error { } } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_ERROR: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\xbc\x04\x04\xea\xa4\x9e6(]\xfd\x81&\xd9\xf8d+\xb4\x03\x83\x81Df\x88\x9alm\xe1\xbd\xb2\xf4r\xde", + [], +); impl TryFrom for Error { type Error = soroban_sdk::Error; #[inline(always)] @@ -303,7 +319,25 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x05hello\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04flag\0\0\x07\xd0\0\0\0\x04Flag\0\0\0\x01\0\0\x03\xe9\0\0\0\x11\0\0\0\x03" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_HELLO: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"=\xdd\xb5\xf0Pk\xc3\x82{\xdf\xd1v\xd2\xe2\xbd\xa5\xb4|\xfc\x18x\x1eY\x18\x88\xf0\xbd\xe1;`\xe7\x14", + [::SPEC_TYPE_ID], +); impl Contract {} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_PERSISTED: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"f\xa64\xf3\xb6\xcc/1nKG$KmS\xdc.&g\xe4v\xfeh\xdc\xe7\xf9\xdd\x9d\xd2q$\xa0", + [], + ); impl<'a> ContractClient<'a> { pub fn hello(&self, flag: &Flag) -> Symbol { use core::ops::Not; diff --git a/tests-expanded/test_events_ref_tests.rs b/tests-expanded/test_events_ref_tests.rs index 720ec4006..3f41b7a32 100644 --- a/tests-expanded/test_events_ref_tests.rs +++ b/tests-expanded/test_events_ref_tests.rs @@ -148,16 +148,15 @@ impl<'a> Transfer<'a> { *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x08Transfer\0\0\0\x01\0\0\0\x08transfer\0\0\0\x04\0\0\0\0\0\0\0\x04from\0\0\0\x13\0\0\0\x01\0\0\0\0\0\0\0\x02to\0\0\0\0\0\x13\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\0\0\0\0\x0bto_muxed_id\0\0\0\x03\xe8\0\0\0\x06\0\0\0\0\0\0\0\x02" } } -impl<'a> soroban_sdk::SpecShakingMarker for Transfer<'a> { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - <&'a Address as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - <&'a Address as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - <&'a i128 as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - } -} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_EVENT_TRANSFER: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 1, + *b";\xc1i\xa0H>\x8d\xf1\x91\x8e\xbe\xb2\xcb\xba\xd8\xec \xf2\x02G\xf1?\x9b\r\xf3`\x0c0n\xedA\x8b", + [], +); impl<'a> soroban_sdk::Event for Transfer<'a> { fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { use soroban_sdk::IntoVal; @@ -190,7 +189,6 @@ impl<'a> soroban_sdk::Event for Transfer<'a> { } impl<'a> Transfer<'a> { pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); <_ as soroban_sdk::Event>::publish(self, env); } } @@ -231,6 +229,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08transfer\0\0\0\x03\0\0\0\0\0\0\0\x04from\0\0\0\x13\0\0\0\0\0\0\0\x02to\0\0\0\0\0\x14\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TRANSFER: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xafT\x04\xcb\x89\x8d\x07\x1e\xc7q\x8a\xea\xbff?J.\x13\xc0\xe2\xbfx?\x05>Q\x14\x97'X-\xd8", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__failed_transfer__spec { @@ -246,6 +253,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0ffailed_transfer\0\0\0\0\x03\0\0\0\0\0\0\0\x04from\0\0\0\x13\0\0\0\0\0\0\0\x02to\0\0\0\0\0\x13\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_FAILED_TRANSFER: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xba\xaa\xb6\xe3u?\xd0\x07\xc9\xc0\x0fAw\xa3\x7f\xfe[.\xdf\xe2\xe2\xf8+\x8e\xcbE\xe6$\xd1w&\xf8", + [], +); impl<'a> ContractClient<'a> { pub fn transfer(&self, from: &Address, to: impl Into, amount: &i128) -> () { use core::ops::Not; diff --git a/tests-expanded/test_events_ref_wasm32v1-none.rs b/tests-expanded/test_events_ref_wasm32v1-none.rs index 97dafcbd9..4379629c1 100644 --- a/tests-expanded/test_events_ref_wasm32v1-none.rs +++ b/tests-expanded/test_events_ref_wasm32v1-none.rs @@ -37,20 +37,16 @@ impl<'a> Transfer<'a> { *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x08Transfer\0\0\0\x01\0\0\0\x08transfer\0\0\0\x04\0\0\0\0\0\0\0\x04from\0\0\0\x13\0\0\0\x01\0\0\0\0\0\0\0\x02to\0\0\0\0\0\x13\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\0\0\0\0\x0bto_muxed_id\0\0\0\x03\xe8\0\0\0\x06\0\0\0\0\0\0\0\x02" } } -impl<'a> soroban_sdk::SpecShakingMarker for Transfer<'a> { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - <&'a Address as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - <&'a Address as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - <&'a i128 as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1;\xc1i\xa0H>\x8d\xf1"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } -} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_EVENT_TRANSFER: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 1, + *b";\xc1i\xa0H>\x8d\xf1\x91\x8e\xbe\xb2\xcb\xba\xd8\xec \xf2\x02G\xf1?\x9b\r\xf3`\x0c0n\xedA\x8b", + [], +); impl<'a> soroban_sdk::Event for Transfer<'a> { fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { use soroban_sdk::IntoVal; @@ -83,7 +79,10 @@ impl<'a> soroban_sdk::Event for Transfer<'a> { } impl<'a> Transfer<'a> { pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); + { + static MARKER: [u8; 14usize] = *b"SpEcV1;\xc1i\xa0H>\x8d\xf1"; + let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; + } <_ as soroban_sdk::Event>::publish(self, env); } } @@ -125,6 +124,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08transfer\0\0\0\x03\0\0\0\0\0\0\0\x04from\0\0\0\x13\0\0\0\0\0\0\0\x02to\0\0\0\0\0\x14\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TRANSFER: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xafT\x04\xcb\x89\x8d\x07\x1e\xc7q\x8a\xea\xbff?J.\x13\xc0\xe2\xbfx?\x05>Q\x14\x97'X-\xd8", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__failed_transfer__spec { @@ -141,6 +150,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0ffailed_transfer\0\0\0\0\x03\0\0\0\0\0\0\0\x04from\0\0\0\x13\0\0\0\0\0\0\0\x02to\0\0\0\0\0\x13\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_FAILED_TRANSFER: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xba\xaa\xb6\xe3u?\xd0\x07\xc9\xc0\x0fAw\xa3\x7f\xfe[.\xdf\xe2\xe2\xf8+\x8e\xcbE\xe6$\xd1w&\xf8", + [], +); impl<'a> ContractClient<'a> { pub fn transfer(&self, from: &Address, to: impl Into, amount: &i128) -> () { use core::ops::Not; diff --git a/tests-expanded/test_events_tests.rs b/tests-expanded/test_events_tests.rs index f95a79436..07ba2d346 100644 --- a/tests-expanded/test_events_tests.rs +++ b/tests-expanded/test_events_tests.rs @@ -148,16 +148,15 @@ impl Transfer { *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x08Transfer\0\0\0\x01\0\0\0\x08transfer\0\0\0\x04\0\0\0\0\0\0\0\x04from\0\0\0\x13\0\0\0\x01\0\0\0\0\0\0\0\x02to\0\0\0\0\0\x13\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\0\0\0\0\x0bto_muxed_id\0\0\0\x03\xe8\0\0\0\x06\0\0\0\0\0\0\0\x02" } } -impl soroban_sdk::SpecShakingMarker for Transfer { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { -
::spec_shaking_marker(); -
::spec_shaking_marker(); - ::spec_shaking_marker(); - as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - } -} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_EVENT_TRANSFER: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 1, + *b";\xc1i\xa0H>\x8d\xf1\x91\x8e\xbe\xb2\xcb\xba\xd8\xec \xf2\x02G\xf1?\x9b\r\xf3`\x0c0n\xedA\x8b", + [], +); impl soroban_sdk::Event for Transfer { fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { use soroban_sdk::IntoVal; @@ -190,7 +189,6 @@ impl soroban_sdk::Event for Transfer { } impl Transfer { pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); <_ as soroban_sdk::Event>::publish(self, env); } } @@ -231,6 +229,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08transfer\0\0\0\x03\0\0\0\0\0\0\0\x04from\0\0\0\x13\0\0\0\0\0\0\0\x02to\0\0\0\0\0\x14\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TRANSFER: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xafT\x04\xcb\x89\x8d\x07\x1e\xc7q\x8a\xea\xbff?J.\x13\xc0\xe2\xbfx?\x05>Q\x14\x97'X-\xd8", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__failed_transfer__spec { @@ -246,6 +253,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0ffailed_transfer\0\0\0\0\x03\0\0\0\0\0\0\0\x04from\0\0\0\x13\0\0\0\0\0\0\0\x02to\0\0\0\0\0\x13\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_FAILED_TRANSFER: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xba\xaa\xb6\xe3u?\xd0\x07\xc9\xc0\x0fAw\xa3\x7f\xfe[.\xdf\xe2\xe2\xf8+\x8e\xcbE\xe6$\xd1w&\xf8", + [], +); impl<'a> ContractClient<'a> { pub fn transfer(&self, from: &Address, to: impl Into, amount: &i128) -> () { use core::ops::Not; diff --git a/tests-expanded/test_events_wasm32v1-none.rs b/tests-expanded/test_events_wasm32v1-none.rs index c7693da03..81739bdbd 100644 --- a/tests-expanded/test_events_wasm32v1-none.rs +++ b/tests-expanded/test_events_wasm32v1-none.rs @@ -37,20 +37,16 @@ impl Transfer { *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x08Transfer\0\0\0\x01\0\0\0\x08transfer\0\0\0\x04\0\0\0\0\0\0\0\x04from\0\0\0\x13\0\0\0\x01\0\0\0\0\0\0\0\x02to\0\0\0\0\0\x13\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\0\0\0\0\x0bto_muxed_id\0\0\0\x03\xe8\0\0\0\x06\0\0\0\0\0\0\0\x02" } } -impl soroban_sdk::SpecShakingMarker for Transfer { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { -
::spec_shaking_marker(); -
::spec_shaking_marker(); - ::spec_shaking_marker(); - as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1;\xc1i\xa0H>\x8d\xf1"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } -} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_EVENT_TRANSFER: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 1, + *b";\xc1i\xa0H>\x8d\xf1\x91\x8e\xbe\xb2\xcb\xba\xd8\xec \xf2\x02G\xf1?\x9b\r\xf3`\x0c0n\xedA\x8b", + [], +); impl soroban_sdk::Event for Transfer { fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { use soroban_sdk::IntoVal; @@ -83,7 +79,10 @@ impl soroban_sdk::Event for Transfer { } impl Transfer { pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); + { + static MARKER: [u8; 14usize] = *b"SpEcV1;\xc1i\xa0H>\x8d\xf1"; + let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; + } <_ as soroban_sdk::Event>::publish(self, env); } } @@ -125,6 +124,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08transfer\0\0\0\x03\0\0\0\0\0\0\0\x04from\0\0\0\x13\0\0\0\0\0\0\0\x02to\0\0\0\0\0\x14\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TRANSFER: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xafT\x04\xcb\x89\x8d\x07\x1e\xc7q\x8a\xea\xbff?J.\x13\xc0\xe2\xbfx?\x05>Q\x14\x97'X-\xd8", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__failed_transfer__spec { @@ -141,6 +150,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0ffailed_transfer\0\0\0\0\x03\0\0\0\0\0\0\0\x04from\0\0\0\x13\0\0\0\0\0\0\0\x02to\0\0\0\0\0\x13\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_FAILED_TRANSFER: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xba\xaa\xb6\xe3u?\xd0\x07\xc9\xc0\x0fAw\xa3\x7f\xfe[.\xdf\xe2\xe2\xf8+\x8e\xcbE\xe6$\xd1w&\xf8", + [], +); impl<'a> ContractClient<'a> { pub fn transfer(&self, from: &Address, to: impl Into, amount: &i128) -> () { use core::ops::Not; diff --git a/tests-expanded/test_fuzz_tests.rs b/tests-expanded/test_fuzz_tests.rs index f4db42280..78ad6c40f 100644 --- a/tests-expanded/test_fuzz_tests.rs +++ b/tests-expanded/test_fuzz_tests.rs @@ -159,6 +159,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x03run\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x0c\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x0c\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_RUN: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xe6\xf9\xeaJ\x16\xbb\xf8\"\x15\x07A\x9b\xac\xf7)}\x0f\xac\x9c\xcd\x97\xe4\x87\x9fk\xb3\x86\x08C_\x85\x1d", + [], +); impl<'a> ContractClient<'a> { pub fn run(&self, a: &U256, b: &U256) -> () { use core::ops::Not; diff --git a/tests-expanded/test_fuzz_wasm32v1-none.rs b/tests-expanded/test_fuzz_wasm32v1-none.rs index 95d5497bf..fc2481cb4 100644 --- a/tests-expanded/test_fuzz_wasm32v1-none.rs +++ b/tests-expanded/test_fuzz_wasm32v1-none.rs @@ -48,6 +48,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x03run\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x0c\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x0c\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_RUN: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xe6\xf9\xeaJ\x16\xbb\xf8\"\x15\x07A\x9b\xac\xf7)}\x0f\xac\x9c\xcd\x97\xe4\x87\x9fk\xb3\x86\x08C_\x85\x1d", + [], +); impl<'a> ContractClient<'a> { pub fn run(&self, a: &U256, b: &U256) -> () { use core::ops::Not; diff --git a/tests-expanded/test_generics_tests.rs b/tests-expanded/test_generics_tests.rs index a8af22d61..53a6be583 100644 --- a/tests-expanded/test_generics_tests.rs +++ b/tests-expanded/test_generics_tests.rs @@ -158,6 +158,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x04exec\0\0\0\x03\0\0\0\0\0\0\0\x02i1\0\0\0\0\0\x04\0\0\0\0\0\0\0\x02i2\0\0\0\0\0\x04\0\0\0\0\0\0\0\x02i3\0\0\0\0\0\x04\0\0\0\x01\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EXEC: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xfaz&!\x8c\x16\xbb\xac\x1f\x7fx\x9d0\xb2\xd4\x8cj\xc8\xa0\xaf\xb7{\xed\x9fI\xaf\xa7\x86\xea\xe5\xddV", + [], +); impl<'a> ContractClient<'a> { pub fn exec(&self, i1: &u32, i2: &u32, i3: &u32) -> u32 { use core::ops::Not; diff --git a/tests-expanded/test_generics_wasm32v1-none.rs b/tests-expanded/test_generics_wasm32v1-none.rs index 4528fa6c0..8d2fb85cf 100644 --- a/tests-expanded/test_generics_wasm32v1-none.rs +++ b/tests-expanded/test_generics_wasm32v1-none.rs @@ -47,6 +47,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x04exec\0\0\0\x03\0\0\0\0\0\0\0\x02i1\0\0\0\0\0\x04\0\0\0\0\0\0\0\x02i2\0\0\0\0\0\x04\0\0\0\0\0\0\0\x02i3\0\0\0\0\0\x04\0\0\0\x01\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EXEC: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xfaz&!\x8c\x16\xbb\xac\x1f\x7fx\x9d0\xb2\xd4\x8cj\xc8\xa0\xaf\xb7{\xed\x9fI\xaf\xa7\x86\xea\xe5\xddV", + [], +); impl<'a> ContractClient<'a> { pub fn exec(&self, i1: &u32, i2: &u32, i3: &u32) -> u32 { use core::ops::Not; diff --git a/tests-expanded/test_import_contract_tests.rs b/tests-expanded/test_import_contract_tests.rs index cdc1ff099..5248e7c07 100644 --- a/tests-expanded/test_import_contract_tests.rs +++ b/tests-expanded/test_import_contract_tests.rs @@ -6,7 +6,7 @@ extern crate core; use core::prelude::rust_2021::*; use soroban_sdk::{contract, contractimpl, Address, Env}; mod addcontract { - pub const WASM: &[u8] = b"\x00asm\x01\x00\x00\x00\x01\x14\x04`\x01~\x01~`\x02\x7f~\x00`\x02~~\x01~`\x00\x00\x02\r\x02\x01i\x010\x00\x00\x01i\x01_\x00\x00\x03\x05\x04\x01\x02\x03\x03\x05\x03\x01\x00\x10\x06!\x04\x7f\x01A\x80\x80\xc0\x00\x0b\x7f\x00A\x80\x80\xc0\x00\x0b\x7f\x00A\x80\x80\xc0\x00\x0b\x7f\x00A\x80\x80\xc0\x00\x0b\x07/\x05\x06memory\x02\x00\x03add\x00\x03\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n\x8b\x02\x04]\x02\x01\x7f\x01~\x02@\x02@ \x01\xa7A\xff\x01q\"\x02A\xc0\x00F\r\x00\x02@ \x02A\x06F\r\x00B\x01!\x03B\x83\x90\x80\x80\x80\x01!\x01\x0c\x02\x0b \x01B\x08\x88!\x01B\x00!\x03\x0c\x01\x0bB\x00!\x03 \x01\x10\x80\x80\x80\x80\x00!\x01\x0b \x00 \x037\x03\x00 \x00 \x017\x03\x08\x0b\x9c\x01\x01\x01\x7f#\x80\x80\x80\x80\x00A\x10k\"\x02$\x80\x80\x80\x80\x00 \x02 \x00\x10\x82\x80\x80\x80\x00\x02@\x02@ \x02(\x02\x00A\x01F\r\x00 \x02)\x03\x08!\x00 \x02 \x01\x10\x82\x80\x80\x80\x00 \x02(\x02\x00A\x01F\r\x00 \x02)\x03\x08\"\x01 \x00|\"\x00 \x01T\r\x01\x02@\x02@ \x00B\xff\xff\xff\xff\xff\xff\xff\xff\x00V\r\x00 \x00B\x08\x86B\x06\x84!\x00\x0c\x01\x0b \x00\x10\x81\x80\x80\x80\x00!\x00\x0b \x02A\x10j$\x80\x80\x80\x80\x00 \x00\x0f\x0b\x00\x0b\x10\x84\x80\x80\x80\x00\x00\x0b\t\x00\x10\x85\x80\x80\x80\x00\x00\x0b\x03\x00\x00\x0b\x0b\t\x01\x00A\x80\x80\xc0\x00\x0b\x00\x00K\x0econtractspecv0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03add\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01a\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x01b\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x01\x00\x00\x00\x06\x00\x1e\x11contractenvmetav0\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x00\x00O\x0econtractmetav0\x00\x00\x00\x00\x00\x00\x00\x05rsver\x00\x00\x00\x00\x00\x00\x061.91.0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12rssdk_spec_shaking\x00\x00\x00\x00\x00\x012\x00\x00\x00"; + pub const WASM: &[u8] = b"\x00asm\x01\x00\x00\x00\x01\x14\x04`\x01~\x01~`\x02\x7f~\x00`\x02~~\x01~`\x00\x00\x02\r\x02\x01i\x010\x00\x00\x01i\x01_\x00\x00\x03\x05\x04\x01\x02\x03\x03\x05\x03\x01\x00\x10\x06!\x04\x7f\x01A\x80\x80\xc0\x00\x0b\x7f\x00A\x80\x80\xc0\x00\x0b\x7f\x00A\x80\x80\xc0\x00\x0b\x7f\x00A\x80\x80\xc0\x00\x0b\x07/\x05\x06memory\x02\x00\x03add\x00\x03\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n\x8b\x02\x04]\x02\x01\x7f\x01~\x02@\x02@ \x01\xa7A\xff\x01q\"\x02A\xc0\x00F\r\x00\x02@ \x02A\x06F\r\x00B\x01!\x03B\x83\x90\x80\x80\x80\x01!\x01\x0c\x02\x0b \x01B\x08\x88!\x01B\x00!\x03\x0c\x01\x0bB\x00!\x03 \x01\x10\x80\x80\x80\x80\x00!\x01\x0b \x00 \x037\x03\x00 \x00 \x017\x03\x08\x0b\x9c\x01\x01\x01\x7f#\x80\x80\x80\x80\x00A\x10k\"\x02$\x80\x80\x80\x80\x00 \x02 \x00\x10\x82\x80\x80\x80\x00\x02@\x02@ \x02(\x02\x00A\x01F\r\x00 \x02)\x03\x08!\x00 \x02 \x01\x10\x82\x80\x80\x80\x00 \x02(\x02\x00A\x01F\r\x00 \x02)\x03\x08\"\x01 \x00|\"\x00 \x01T\r\x01\x02@\x02@ \x00B\xff\xff\xff\xff\xff\xff\xff\xff\x00V\r\x00 \x00B\x08\x86B\x06\x84!\x00\x0c\x01\x0b \x00\x10\x81\x80\x80\x80\x00!\x00\x0b \x02A\x10j$\x80\x80\x80\x80\x00 \x00\x0f\x0b\x00\x0b\x10\x84\x80\x80\x80\x00\x00\x0b\t\x00\x10\x85\x80\x80\x80\x00\x00\x0b\x03\x00\x00\x0b\x0b\t\x01\x00A\x80\x80\xc0\x00\x0b\x00\x00\xdf\x15\x0econtractspecv0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03add\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01a\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x01b\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x01\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\xe3Context of a single authorized call performed by an address.\n\nCustom account contracts that implement `__check_auth` special function\nreceive a list of `Context` values corresponding to all the calls that\nneed to be authorized.\x00\x00\x00\x00\x00\x00\x00\x00\x07Context\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x14Contract invocation.\x00\x00\x00\x08Contract\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0fContractContext\x00\x00\x00\x00\x01\x00\x00\x00=Contract that has a constructor with no arguments is created.\x00\x00\x00\x00\x00\x00\x14CreateContractHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x1bCreateContractHostFnContext\x00\x00\x00\x00\x01\x00\x00\x00DContract that has a constructor with 1 or more arguments is created.\x00\x00\x00\x1cCreateContractWithCtorHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00*CreateContractWithConstructorHostFnContext\x00\x00\x00\x00\x00\x01\x00\x00\x00\xbdAuthorization context of a single contract call.\n\nThis struct corresponds to a `require_auth_for_args` call for an address\nfrom `contract` function with `fn_name` name and `args` arguments.\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fContractContext\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x04args\x00\x00\x03\xea\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08contract\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x07fn_name\x00\x00\x00\x00\x11\x00\x00\x00\x02\x00\x00\x00_Contract executable used for creating a new contract and used in\n`CreateContractHostFnContext`.\x00\x00\x00\x00\x00\x00\x00\x00\x12ContractExecutable\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Wasm\x00\x00\x00\x01\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x01\x00\x00\x008Value of contract node in InvokerContractAuthEntry tree.\x00\x00\x00\x00\x00\x00\x00\x15SubContractInvocation\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x07context\x00\x00\x00\x07\xd0\x00\x00\x00\x0fContractContext\x00\x00\x00\x00\x00\x00\x00\x00\x0fsub_invocations\x00\x00\x00\x03\xea\x00\x00\x07\xd0\x00\x00\x00\x18InvokerContractAuthEntry\x00\x00\x00\x02\x00\x00\x01/A node in the tree of authorizations performed on behalf of the current\ncontract as invoker of the contracts deeper in the call stack.\n\nThis is used as an argument of `authorize_as_current_contract` host function.\n\nThis tree corresponds `require_auth[_for_args]` calls on behalf of the\ncurrent contract.\x00\x00\x00\x00\x00\x00\x00\x00\x18InvokerContractAuthEntry\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x12Invoke a contract.\x00\x00\x00\x00\x00\x08Contract\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x15SubContractInvocation\x00\x00\x00\x00\x00\x00\x01\x00\x00\x005Create a contract passing 0 arguments to constructor.\x00\x00\x00\x00\x00\x00\x14CreateContractHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x1bCreateContractHostFnContext\x00\x00\x00\x00\x01\x00\x00\x00=Create a contract passing 0 or more arguments to constructor.\x00\x00\x00\x00\x00\x00\x1cCreateContractWithCtorHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00*CreateContractWithConstructorHostFnContext\x00\x00\x00\x00\x00\x01\x00\x00\x00vAuthorization context for `create_contract` host function that creates a\nnew contract on behalf of authorizer address.\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1bCreateContractHostFnContext\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\nexecutable\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12ContractExecutable\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04salt\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x01\x00\x00\x00\xd6Authorization context for `create_contract` host function that creates a\nnew contract on behalf of authorizer address.\nThis is the same as `CreateContractHostFnContext`, but also has\ncontract constructor arguments.\x00\x00\x00\x00\x00\x00\x00\x00\x00*CreateContractWithConstructorHostFnContext\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x10constructor_args\x00\x00\x03\xea\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nexecutable\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12ContractExecutable\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04salt\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nExecutable\x00\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Wasm\x00\x00\x00\x01\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStellarAsset\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07Account\x00\x00\xd7\x05\x1ccontractspecv0.rssdk.graphv0SpGrV\x01\x00\x00\x03\xedX=\x97\x96\x0b\xa5*Y\x95;WYd\xcb\x0fF\x96\xdf>\xba\x07\x0f{\x08\xfb+dY\xb4,\x00\x00SpGrV\x01\x00\x02\xa3J\xcf\xf7D\x93\x0bB]\x95\xeb\xfe\x03y\x83e5\\\x16\xeb\x94Ne\xe6Xw\x1f&\xf7\xc0pT\x00\x03\xf1\xf9\x90\x07E*e\xfd\x08\x8c\xc2\xb1\x10\xfd\xca\xae6T\x9e)[\xdb\xee_\xfa\xed\xcaE\x9bv\x98\xec\x15\xe5\x1a,\xc0\xc7\xef\xd4\xe0\xda\x0e\x16\x87\x1a\xae\xe73X\x1d2\x8a\x8aP\xab\x81\xef\x18\x8e:\xa2\xa9ns\x94\x0c\x1926\x1d\x90\x19\xc8\x8b=\xbe\xaf\xd7n\xcd=z\t\xb27\xa5.\xde:>\x03\xcd7\x12\xafSpGrV\x01\x00\x02\xf1\xf9\x90\x07E*e\xfd\x08\x8c\xc2\xb1\x10\xfd\xca\xae6T\x9e)[\xdb\xee_\xfa\xed\xcaE\x9bv\x98\xec\x00\x00SpGrV\x01\x00\x02\xb6\xb1Hy\xda\xca\xaf\xcc\x1f\x01\x07y\x9a#g}2\x1c.Q0Vf\xc7ze\xacm\x01\xf5Y\xcc\x00\x00SpGrV\x01\x00\x02\x9e)H\x8e\xf0\x01{{\xce\x9fdO\x0eD\xc0,\x0f\xe8\xee\'\x845r\x9f\xeb`\xd0\x12H\x17\x96g\x00\x02\xf1\xf9\x90\x07E*e\xfd\x08\x8c\xc2\xb1\x10\xfd\xca\xae6T\x9e)[\xdb\xee_\xfa\xed\xcaE\x9bv\x98\xecULqD\xd3\xfa:\x1f\x0c\xa5\xb7\x04\xe5H\x8b\x91J\x9e\x0fe\x7f\x9f[\xdbG#\xc7o\xb0\xf4\xcf\xe6SpGrV\x01\x00\x02ULqD\xd3\xfa:\x1f\x0c\xa5\xb7\x04\xe5H\x8b\x91J\x9e\x0fe\x7f\x9f[\xdbG#\xc7o\xb0\xf4\xcf\xe6\x00\x03\x9e)H\x8e\xf0\x01{{\xce\x9fdO\x0eD\xc0,\x0f\xe8\xee\'\x845r\x9f\xeb`\xd0\x12H\x17\x96g\x15\xe5\x1a,\xc0\xc7\xef\xd4\xe0\xda\x0e\x16\x87\x1a\xae\xe73X\x1d2\x8a\x8aP\xab\x81\xef\x18\x8e:\xa2\xa9ns\x94\x0c\x1926\x1d\x90\x19\xc8\x8b=\xbe\xaf\xd7n\xcd=z\t\xb27\xa5.\xde:>\x03\xcd7\x12\xafSpGrV\x01\x00\x02\x15\xe5\x1a,\xc0\xc7\xef\xd4\xe0\xda\x0e\x16\x87\x1a\xae\xe73X\x1d2\x8a\x8aP\xab\x81\xef\x18\x8e:\xa2\xa9n\x00\x01\xb6\xb1Hy\xda\xca\xaf\xcc\x1f\x01\x07y\x9a#g}2\x1c.Q0Vf\xc7ze\xacm\x01\xf5Y\xccSpGrV\x01\x00\x02s\x94\x0c\x1926\x1d\x90\x19\xc8\x8b=\xbe\xaf\xd7n\xcd=z\t\xb27\xa5.\xde:>\x03\xcd7\x12\xaf\x00\x01\xb6\xb1Hy\xda\xca\xaf\xcc\x1f\x01\x07y\x9a#g}2\x1c.Q0Vf\xc7ze\xacm\x01\xf5Y\xccSpGrV\x01\x00\x02L|{\r\xf4\xf2\x1a\xa8\xf6\x981\xe2K\xcb\x824N\xe6\x97\xed\xdf\xc2\x1cck\xd6\xceW\x9cx\x10\x1e\x00\x00\x00\x1e\x11contractenvmetav0\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x00\x00O\x0econtractmetav0\x00\x00\x00\x00\x00\x00\x00\x05rsver\x00\x00\x00\x00\x00\x00\x061.91.0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12rssdk_spec_shaking\x00\x00\x00\x00\x00\x012\x00\x00\x00"; pub trait Contract { fn add(env: soroban_sdk::Env, a: u64, b: u64) -> u64; } @@ -204,6 +204,4663 @@ mod addcontract { (a, b) } } + pub struct ContractContext { + pub args: soroban_sdk::Vec, + pub contract: soroban_sdk::Address, + pub fn_name: soroban_sdk::Symbol, + } + #[automatically_derived] + impl ::core::fmt::Debug for ContractContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "ContractContext", + "args", + &self.args, + "contract", + &self.contract, + "fn_name", + &&self.fn_name, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ContractContext { + #[inline] + fn clone(&self) -> ContractContext { + ContractContext { + args: ::core::clone::Clone::clone(&self.args), + contract: ::core::clone::Clone::clone(&self.contract), + fn_name: ::core::clone::Clone::clone(&self.fn_name), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ContractContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ContractContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ContractContext { + #[inline] + fn eq(&self, other: &ContractContext) -> bool { + self.args == other.args + && self.contract == other.contract + && self.fn_name == other.fn_name + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ContractContext { + #[inline] + fn cmp(&self, other: &ContractContext) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.args, &other.args) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.contract, &other.contract) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.fn_name, &other.fn_name) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ContractContext { + #[inline] + fn partial_cmp( + &self, + other: &ContractContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.args, &other.args) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp(&self.contract, &other.contract) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.fn_name, &other.fn_name) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_CONTRACTCONTEXT: [u8; 96usize] = ContractContext::spec_xdr(); + impl ContractContext { + pub const fn spec_xdr() -> [u8; 96usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fContractContext\0\0\0\0\x03\0\0\0\0\0\0\0\x04args\0\0\x03\xea\0\0\0\0\0\0\0\0\0\0\0\x08contract\0\0\0\x13\0\0\0\0\0\0\0\x07fn_name\0\0\0\0\x11" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for ContractContext { + const SPEC_TYPE_ID: [u8; 32] = *b"\x03\x04uN\xea\xd7[\x13V\x9f\xd4\xbd\xc1\x8a\xd6\x7f\xd8iD\xa5B\x89qT\x0b'\xad(\xb8\x9f\x8f\x19"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CONTRACTCONTEXT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\x03\x04uN\xea\xd7[\x13V\x9f\xd4\xbd\xc1\x8a\xd6\x7f\xd8iD\xa5B\x89qT\x0b'\xad(\xb8\x9f\x8f\x19", + [], + ); + impl soroban_sdk::TryFromVal for ContractContext { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["args", "contract", "fn_name"]; + let mut vals: [Val; 3usize] = [Val::VOID.to_val(); 3usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + args: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + contract: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + fn_name: vals[2] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &ContractContext, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["args", "contract", "fn_name"]; + let vals: [Val; 3usize] = [ + (&val.args).try_into_val(env).map_err(|_| ConversionError)?, + (&val.contract) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.fn_name) + .try_into_val(env) + .map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&ContractContext, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + impl soroban_sdk::TryFromVal for ContractContext { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 3usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + args: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "args" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + contract: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "contract" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + fn_name: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "fn_name" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal for ContractContext { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&ContractContext> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &ContractContext) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "args" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.args) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "contract" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.contract) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "fn_name" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.fn_name) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } + } + impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: ContractContext) -> Result { + (&val).try_into() + } + } + impl TryFrom<&ContractContext> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &ContractContext) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: ContractContext) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryContractContext { + args: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + contract: ::Prototype, + fn_name: ::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryContractContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "ArbitraryContractContext", + "args", + &self.args, + "contract", + &self.contract, + "fn_name", + &&self.fn_name, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryContractContext { + #[inline] + fn clone(&self) -> ArbitraryContractContext { + ArbitraryContractContext { + args: ::core::clone::Clone::clone(&self.args), + contract: ::core::clone::Clone::clone(&self.contract), + fn_name: ::core::clone::Clone::clone(&self.fn_name), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryContractContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryContractContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryContractContext { + #[inline] + fn eq(&self, other: &ArbitraryContractContext) -> bool { + self.args == other.args + && self.contract == other.contract + && self.fn_name == other.fn_name + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryContractContext { + #[inline] + fn cmp(&self, other: &ArbitraryContractContext) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.args, &other.args) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.contract, &other.contract) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.fn_name, &other.fn_name) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryContractContext { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryContractContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.args, &other.args) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp(&self.contract, &other.contract) + { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.fn_name, &other.fn_name) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryContractContext: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryContractContext { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryContractContext { + args: arbitrary::Arbitrary::arbitrary(u)?, + contract: arbitrary::Arbitrary::arbitrary(u)?, + fn_name: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryContractContext { + args: arbitrary::Arbitrary::arbitrary(&mut u)?, + contract: arbitrary::Arbitrary::arbitrary(&mut u)?, + fn_name: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for ContractContext { + type Prototype = ArbitraryContractContext; + } + impl soroban_sdk::TryFromVal for ContractContext { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryContractContext, + ) -> std::result::Result { + Ok(ContractContext { + args: soroban_sdk::IntoVal::into_val(&v.args, env), + contract: soroban_sdk::IntoVal::into_val(&v.contract, env), + fn_name: soroban_sdk::IntoVal::into_val(&v.fn_name, env), + }) + } + } + }; + pub struct SubContractInvocation { + pub context: ContractContext, + pub sub_invocations: soroban_sdk::Vec, + } + #[automatically_derived] + impl ::core::fmt::Debug for SubContractInvocation { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "SubContractInvocation", + "context", + &self.context, + "sub_invocations", + &&self.sub_invocations, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for SubContractInvocation { + #[inline] + fn clone(&self) -> SubContractInvocation { + SubContractInvocation { + context: ::core::clone::Clone::clone(&self.context), + sub_invocations: ::core::clone::Clone::clone(&self.sub_invocations), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for SubContractInvocation { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for SubContractInvocation {} + #[automatically_derived] + impl ::core::cmp::PartialEq for SubContractInvocation { + #[inline] + fn eq(&self, other: &SubContractInvocation) -> bool { + self.context == other.context && self.sub_invocations == other.sub_invocations + } + } + #[automatically_derived] + impl ::core::cmp::Ord for SubContractInvocation { + #[inline] + fn cmp(&self, other: &SubContractInvocation) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.context, &other.context) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.sub_invocations, &other.sub_invocations) + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for SubContractInvocation { + #[inline] + fn partial_cmp( + &self, + other: &SubContractInvocation, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.context, &other.context) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp( + &self.sub_invocations, + &other.sub_invocations, + ) + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_SUBCONTRACTINVOCATION: [u8; 144usize] = + SubContractInvocation::spec_xdr(); + impl SubContractInvocation { + pub const fn spec_xdr() -> [u8; 144usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x15SubContractInvocation\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x07context\0\0\0\x07\xd0\0\0\0\x0fContractContext\0\0\0\0\0\0\0\0\x0fsub_invocations\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x18InvokerContractAuthEntry" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for SubContractInvocation { + const SPEC_TYPE_ID: [u8; 32] = *b" \x9d\xc5_\xba\x8fv\x18\x95\x02\xbdJ}\x97\x01KN\xd6\0\xf8\xb6\xefq\xa8j\x11\\\xc7\xd7\xd4\xcf\xf0"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_SUBCONTRACTINVOCATION: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, + >( + 2, + *b" \x9d\xc5_\xba\x8fv\x18\x95\x02\xbdJ}\x97\x01KN\xd6\0\xf8\xb6\xefq\xa8j\x11\\\xc7\xd7\xd4\xcf\xf0", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); + impl soroban_sdk::TryFromVal for SubContractInvocation { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["context", "sub_invocations"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + context: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + sub_invocations: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &SubContractInvocation, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["context", "sub_invocations"]; + let vals: [Val; 2usize] = [ + (&val.context) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.sub_invocations) + .try_into_val(env) + .map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&SubContractInvocation, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + impl soroban_sdk::TryFromVal for SubContractInvocation { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 2usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + context: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "context" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + sub_invocations: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "sub_invocations" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal for SubContractInvocation { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&SubContractInvocation> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &SubContractInvocation) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "context" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.context) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "sub_invocations" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.sub_invocations) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } + } + impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: SubContractInvocation) -> Result { + (&val).try_into() + } + } + impl TryFrom<&SubContractInvocation> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &SubContractInvocation) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: SubContractInvocation) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitrarySubContractInvocation { + context: ::Prototype, + sub_invocations: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitrarySubContractInvocation { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "ArbitrarySubContractInvocation", + "context", + &self.context, + "sub_invocations", + &&self.sub_invocations, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitrarySubContractInvocation { + #[inline] + fn clone(&self) -> ArbitrarySubContractInvocation { + ArbitrarySubContractInvocation { + context: ::core::clone::Clone::clone(&self.context), + sub_invocations: ::core::clone::Clone::clone(&self.sub_invocations), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitrarySubContractInvocation { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitrarySubContractInvocation {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitrarySubContractInvocation { + #[inline] + fn eq(&self, other: &ArbitrarySubContractInvocation) -> bool { + self.context == other.context && self.sub_invocations == other.sub_invocations + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitrarySubContractInvocation { + #[inline] + fn cmp(&self, other: &ArbitrarySubContractInvocation) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.context, &other.context) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.sub_invocations, &other.sub_invocations) + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitrarySubContractInvocation { + #[inline] + fn partial_cmp( + &self, + other: &ArbitrarySubContractInvocation, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.context, &other.context) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp( + &self.sub_invocations, + &other.sub_invocations, + ) + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitrarySubContractInvocation: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitrarySubContractInvocation { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitrarySubContractInvocation.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitrarySubContractInvocation { + context: arbitrary::Arbitrary::arbitrary(u)?, + sub_invocations: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitrarySubContractInvocation.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitrarySubContractInvocation.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitrarySubContractInvocation { + context: arbitrary::Arbitrary::arbitrary(&mut u)?, + sub_invocations: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitrarySubContractInvocation.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for SubContractInvocation { + type Prototype = ArbitrarySubContractInvocation; + } + impl soroban_sdk::TryFromVal + for SubContractInvocation + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitrarySubContractInvocation, + ) -> std::result::Result { + Ok(SubContractInvocation { + context: soroban_sdk::IntoVal::into_val(&v.context, env), + sub_invocations: soroban_sdk::IntoVal::into_val(&v.sub_invocations, env), + }) + } + } + }; + pub struct CreateContractHostFnContext { + pub executable: ContractExecutable, + pub salt: soroban_sdk::BytesN<32>, + } + #[automatically_derived] + impl ::core::fmt::Debug for CreateContractHostFnContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "CreateContractHostFnContext", + "executable", + &self.executable, + "salt", + &&self.salt, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for CreateContractHostFnContext { + #[inline] + fn clone(&self) -> CreateContractHostFnContext { + CreateContractHostFnContext { + executable: ::core::clone::Clone::clone(&self.executable), + salt: ::core::clone::Clone::clone(&self.salt), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for CreateContractHostFnContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for CreateContractHostFnContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for CreateContractHostFnContext { + #[inline] + fn eq(&self, other: &CreateContractHostFnContext) -> bool { + self.executable == other.executable && self.salt == other.salt + } + } + #[automatically_derived] + impl ::core::cmp::Ord for CreateContractHostFnContext { + #[inline] + fn cmp(&self, other: &CreateContractHostFnContext) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.executable, &other.executable) { + ::core::cmp::Ordering::Equal => ::core::cmp::Ord::cmp(&self.salt, &other.salt), + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for CreateContractHostFnContext { + #[inline] + fn partial_cmp( + &self, + other: &CreateContractHostFnContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.executable, &other.executable) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_CREATECONTRACTHOSTFNCONTEXT: [u8; 116usize] = + CreateContractHostFnContext::spec_xdr(); + impl CreateContractHostFnContext { + pub const fn spec_xdr() -> [u8; 116usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x1bCreateContractHostFnContext\0\0\0\0\x02\0\0\0\0\0\0\0\nexecutable\0\0\0\0\x07\xd0\0\0\0\x12ContractExecutable\0\0\0\0\0\0\0\0\0\x04salt\0\0\x03\xee\0\0\0 " + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for CreateContractHostFnContext { + const SPEC_TYPE_ID: [u8; 32] = *b"\xe1\"T\xf0&\x19?P\xad\xa3\xa0\xd2\xf1\xea\xf8~\xde\xe7\x12\xe5_&\xb62Cl\xc8x\xcc.\xd4\xcd"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CREATECONTRACTHOSTFNCONTEXT: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, + >( + 2, + *b"\xe1\"T\xf0&\x19?P\xad\xa3\xa0\xd2\xf1\xea\xf8~\xde\xe7\x12\xe5_&\xb62Cl\xc8x\xcc.\xd4\xcd", + [::SPEC_TYPE_ID], + ); + impl soroban_sdk::TryFromVal for CreateContractHostFnContext { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["executable", "salt"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + executable: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + salt: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &CreateContractHostFnContext, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["executable", "salt"]; + let vals: [Val; 2usize] = [ + (&val.executable) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.salt).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&CreateContractHostFnContext, + ) -> Result { + <_ as soroban_sdk::TryFromVal< + soroban_sdk::Env, + CreateContractHostFnContext, + >>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal + for CreateContractHostFnContext + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 2usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + executable: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "executable" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + salt: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "salt" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal + for CreateContractHostFnContext + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&CreateContractHostFnContext> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &CreateContractHostFnContext) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "executable" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.executable) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "salt" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.salt) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } + } + impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: CreateContractHostFnContext) -> Result { + (&val).try_into() + } + } + impl TryFrom<&CreateContractHostFnContext> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &CreateContractHostFnContext) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: CreateContractHostFnContext) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryCreateContractHostFnContext { + executable: ::Prototype, + salt: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryCreateContractHostFnContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "ArbitraryCreateContractHostFnContext", + "executable", + &self.executable, + "salt", + &&self.salt, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryCreateContractHostFnContext { + #[inline] + fn clone(&self) -> ArbitraryCreateContractHostFnContext { + ArbitraryCreateContractHostFnContext { + executable: ::core::clone::Clone::clone(&self.executable), + salt: ::core::clone::Clone::clone(&self.salt), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryCreateContractHostFnContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryCreateContractHostFnContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryCreateContractHostFnContext { + #[inline] + fn eq(&self, other: &ArbitraryCreateContractHostFnContext) -> bool { + self.executable == other.executable && self.salt == other.salt + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryCreateContractHostFnContext { + #[inline] + fn cmp(&self, other: &ArbitraryCreateContractHostFnContext) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.executable, &other.executable) { + ::core::cmp::Ordering::Equal => ::core::cmp::Ord::cmp(&self.salt, &other.salt), + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryCreateContractHostFnContext { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryCreateContractHostFnContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.executable, &other.executable) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryCreateContractHostFnContext { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryCreateContractHostFnContext { + executable: arbitrary::Arbitrary::arbitrary(u)?, + salt: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryCreateContractHostFnContext { + executable: arbitrary::Arbitrary::arbitrary(&mut u)?, + salt: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for CreateContractHostFnContext { + type Prototype = ArbitraryCreateContractHostFnContext; + } + impl soroban_sdk::TryFromVal + for CreateContractHostFnContext + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryCreateContractHostFnContext, + ) -> std::result::Result { + Ok(CreateContractHostFnContext { + executable: soroban_sdk::IntoVal::into_val(&v.executable, env), + salt: soroban_sdk::IntoVal::into_val(&v.salt, env), + }) + } + } + }; + pub struct CreateContractWithConstructorHostFnContext { + pub constructor_args: soroban_sdk::Vec, + pub executable: ContractExecutable, + pub salt: soroban_sdk::BytesN<32>, + } + #[automatically_derived] + impl ::core::fmt::Debug for CreateContractWithConstructorHostFnContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "CreateContractWithConstructorHostFnContext", + "constructor_args", + &self.constructor_args, + "executable", + &self.executable, + "salt", + &&self.salt, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for CreateContractWithConstructorHostFnContext { + #[inline] + fn clone(&self) -> CreateContractWithConstructorHostFnContext { + CreateContractWithConstructorHostFnContext { + constructor_args: ::core::clone::Clone::clone(&self.constructor_args), + executable: ::core::clone::Clone::clone(&self.executable), + salt: ::core::clone::Clone::clone(&self.salt), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for CreateContractWithConstructorHostFnContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for CreateContractWithConstructorHostFnContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for CreateContractWithConstructorHostFnContext { + #[inline] + fn eq(&self, other: &CreateContractWithConstructorHostFnContext) -> bool { + self.constructor_args == other.constructor_args + && self.executable == other.executable + && self.salt == other.salt + } + } + #[automatically_derived] + impl ::core::cmp::Ord for CreateContractWithConstructorHostFnContext { + #[inline] + fn cmp(&self, other: &CreateContractWithConstructorHostFnContext) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.constructor_args, &other.constructor_args) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.executable, &other.executable) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for CreateContractWithConstructorHostFnContext { + #[inline] + fn partial_cmp( + &self, + other: &CreateContractWithConstructorHostFnContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp( + &self.constructor_args, + &other.constructor_args, + ) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp(&self.executable, &other.executable) + { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_CREATECONTRACTWITHCONSTRUCTORHOSTFNCONTEXT: [u8; 164usize] = + CreateContractWithConstructorHostFnContext::spec_xdr(); + impl CreateContractWithConstructorHostFnContext { + pub const fn spec_xdr() -> [u8; 164usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0*CreateContractWithConstructorHostFnContext\0\0\0\0\0\x03\0\0\0\0\0\0\0\x10constructor_args\0\0\x03\xea\0\0\0\0\0\0\0\0\0\0\0\nexecutable\0\0\0\0\x07\xd0\0\0\0\x12ContractExecutable\0\0\0\0\0\0\0\0\0\x04salt\0\0\x03\xee\0\0\0 " + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for CreateContractWithConstructorHostFnContext { + const SPEC_TYPE_ID: [u8; 32] = *b"\xd2;\xff\xe6\x97\xda;\x83c$F\x15Z\xf1r\xf4\xc18\xfda!\x0b\r\x87\x88\xa0\x9a\x08Yu\xccS"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CREATECONTRACTWITHCONSTRUCTORHOSTFNCONTEXT: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, + >( + 2, + *b"\xd2;\xff\xe6\x97\xda;\x83c$F\x15Z\xf1r\xf4\xc18\xfda!\x0b\r\x87\x88\xa0\x9a\x08Yu\xccS", + [::SPEC_TYPE_ID], + ); + impl soroban_sdk::TryFromVal + for CreateContractWithConstructorHostFnContext + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["constructor_args", "executable", "salt"]; + let mut vals: [Val; 3usize] = [Val::VOID.to_val(); 3usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + constructor_args: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + executable: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + salt: vals[2] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal + for soroban_sdk::Val + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &CreateContractWithConstructorHostFnContext, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["constructor_args", "executable", "salt"]; + let vals: [Val; 3usize] = [ + (&val.constructor_args) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.executable) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.salt).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal + for soroban_sdk::Val + { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&CreateContractWithConstructorHostFnContext, + ) -> Result { + <_ as soroban_sdk::TryFromVal< + soroban_sdk::Env, + CreateContractWithConstructorHostFnContext, + >>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal + for CreateContractWithConstructorHostFnContext + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 3usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + constructor_args: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "constructor_args" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + executable: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "executable" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + salt: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "salt" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal + for CreateContractWithConstructorHostFnContext + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&CreateContractWithConstructorHostFnContext> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: &CreateContractWithConstructorHostFnContext, + ) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "constructor_args" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.constructor_args) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "executable" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.executable) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "salt" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.salt) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } + } + impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: CreateContractWithConstructorHostFnContext, + ) -> Result { + (&val).try_into() + } + } + impl TryFrom<&CreateContractWithConstructorHostFnContext> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: &CreateContractWithConstructorHostFnContext, + ) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: CreateContractWithConstructorHostFnContext, + ) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryCreateContractWithConstructorHostFnContext { + constructor_args: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + executable: ::Prototype, + salt: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "ArbitraryCreateContractWithConstructorHostFnContext", + "constructor_args", + &self.constructor_args, + "executable", + &self.executable, + "salt", + &&self.salt, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn clone(&self) -> ArbitraryCreateContractWithConstructorHostFnContext { + ArbitraryCreateContractWithConstructorHostFnContext { + constructor_args: ::core::clone::Clone::clone(&self.constructor_args), + executable: ::core::clone::Clone::clone(&self.executable), + salt: ::core::clone::Clone::clone(&self.salt), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryCreateContractWithConstructorHostFnContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn eq(&self, other: &ArbitraryCreateContractWithConstructorHostFnContext) -> bool { + self.constructor_args == other.constructor_args + && self.executable == other.executable + && self.salt == other.salt + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn cmp( + &self, + other: &ArbitraryCreateContractWithConstructorHostFnContext, + ) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.constructor_args, &other.constructor_args) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.executable, &other.executable) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryCreateContractWithConstructorHostFnContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp( + &self.constructor_args, + &other.constructor_args, + ) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp( + &self.executable, + &other.executable, + ) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext: + ::std::thread::LocalKey> = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> + for ArbitraryCreateContractWithConstructorHostFnContext + { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext.with( + |count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + }, + )?; + } + let result = (|| { + Ok(ArbitraryCreateContractWithConstructorHostFnContext { + constructor_args: arbitrary::Arbitrary::arbitrary(u)?, + executable: arbitrary::Arbitrary::arbitrary(u)?, + salt: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext.with( + |count| { + count.set(count.get() - 1); + }, + ); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext.with( + |count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + }, + )?; + } + let result = (|| { + Ok(ArbitraryCreateContractWithConstructorHostFnContext { + constructor_args: arbitrary::Arbitrary::arbitrary(&mut u)?, + executable: arbitrary::Arbitrary::arbitrary(&mut u)?, + salt: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext.with( + |count| { + count.set(count.get() - 1); + }, + ); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary + for CreateContractWithConstructorHostFnContext + { + type Prototype = ArbitraryCreateContractWithConstructorHostFnContext; + } + impl + soroban_sdk::TryFromVal< + soroban_sdk::Env, + ArbitraryCreateContractWithConstructorHostFnContext, + > for CreateContractWithConstructorHostFnContext + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryCreateContractWithConstructorHostFnContext, + ) -> std::result::Result { + Ok(CreateContractWithConstructorHostFnContext { + constructor_args: soroban_sdk::IntoVal::into_val(&v.constructor_args, env), + executable: soroban_sdk::IntoVal::into_val(&v.executable, env), + salt: soroban_sdk::IntoVal::into_val(&v.salt, env), + }) + } + } + }; + pub enum Context { + Contract(ContractContext), + CreateContractHostFn(CreateContractHostFnContext), + CreateContractWithCtorHostFn(CreateContractWithConstructorHostFnContext), + } + #[automatically_derived] + impl ::core::fmt::Debug for Context { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + Context::Contract(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Contract", &__self_0) + } + Context::CreateContractHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractHostFn", + &__self_0, + ) + } + Context::CreateContractWithCtorHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractWithCtorHostFn", + &__self_0, + ) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for Context { + #[inline] + fn clone(&self) -> Context { + match self { + Context::Contract(__self_0) => { + Context::Contract(::core::clone::Clone::clone(__self_0)) + } + Context::CreateContractHostFn(__self_0) => { + Context::CreateContractHostFn(::core::clone::Clone::clone(__self_0)) + } + Context::CreateContractWithCtorHostFn(__self_0) => { + Context::CreateContractWithCtorHostFn(::core::clone::Clone::clone(__self_0)) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for Context { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for Context {} + #[automatically_derived] + impl ::core::cmp::PartialEq for Context { + #[inline] + fn eq(&self, other: &Context) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + (Context::Contract(__self_0), Context::Contract(__arg1_0)) => { + __self_0 == __arg1_0 + } + ( + Context::CreateContractHostFn(__self_0), + Context::CreateContractHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + ( + Context::CreateContractWithCtorHostFn(__self_0), + Context::CreateContractWithCtorHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for Context { + #[inline] + fn cmp(&self, other: &Context) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + (Context::Contract(__self_0), Context::Contract(__arg1_0)) => { + ::core::cmp::Ord::cmp(__self_0, __arg1_0) + } + ( + Context::CreateContractHostFn(__self_0), + Context::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + Context::CreateContractWithCtorHostFn(__self_0), + Context::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for Context { + #[inline] + fn partial_cmp(&self, other: &Context) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + (Context::Contract(__self_0), Context::Contract(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + ( + Context::CreateContractHostFn(__self_0), + Context::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + Context::CreateContractWithCtorHostFn(__self_0), + Context::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + pub static __SPEC_XDR_TYPE_CONTEXT: [u8; 244usize] = Context::spec_xdr(); + impl Context { + pub const fn spec_xdr() -> [u8; 244usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x07Context\0\0\0\0\x03\0\0\0\x01\0\0\0\0\0\0\0\x08Contract\0\0\0\x01\0\0\x07\xd0\0\0\0\x0fContractContext\0\0\0\0\x01\0\0\0\0\0\0\0\x14CreateContractHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0\x1bCreateContractHostFnContext\0\0\0\0\x01\0\0\0\0\0\0\0\x1cCreateContractWithCtorHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0*CreateContractWithConstructorHostFnContext\0\0" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for Context { + const SPEC_TYPE_ID: [u8; 32] = *b"\r\xb6\x0b\xec\x8f\xd04l1\xb3-\xa0{\x90\xa3\xc2\xab\x93\xd4\x82x\xe1_\x8a\xa8N?.\xcd\xc1\xfc\x08"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CONTEXT: [u8; 138usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 138usize, + 3usize, + >( + 2, + *b"\r\xb6\x0b\xec\x8f\xd04l1\xb3-\xa0{\x90\xa3\xc2\xab\x93\xd4\x82x\xe1_\x8a\xa8N?.\xcd\xc1\xfc\x08", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); + impl soroban_sdk::TryFromVal for Context { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &[ + "Contract", + "CreateContractHostFn", + "CreateContractWithCtorHostFn", + ]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Contract( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 2 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractWithCtorHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &Context, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + Context::Contract(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Contract")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + Context::CreateContractHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"CreateContractHostFn")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + Context::CreateContractWithCtorHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"CreateContractWithCtorHostFn")? + .to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&Context, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal for Context { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "Contract" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::Contract( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "CreateContractHostFn" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::CreateContractHostFn( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "CreateContractWithCtorHostFn" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::CreateContractWithCtorHostFn( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl soroban_sdk::TryFromVal for Context { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&Context> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &Context) -> Result { + extern crate alloc; + Ok(match val { + Context::Contract(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Contract" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + Context::CreateContractHostFn(value0) => ( + soroban_sdk::xdr::ScSymbol( + "CreateContractHostFn" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + Context::CreateContractWithCtorHostFn(value0) => ( + soroban_sdk::xdr::ScSymbol( + "CreateContractWithCtorHostFn" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Context) -> Result { + (&val).try_into() + } + } + impl TryFrom<&Context> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &Context) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Context) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryContext { + Contract( + ::Prototype, + ), + CreateContractHostFn( + ::Prototype, + ), + CreateContractWithCtorHostFn( + ::Prototype, + ), + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryContext::Contract(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Contract", &__self_0) + } + ArbitraryContext::CreateContractHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractHostFn", + &__self_0, + ) + } + ArbitraryContext::CreateContractWithCtorHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractWithCtorHostFn", + &__self_0, + ) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryContext { + #[inline] + fn clone(&self) -> ArbitraryContext { + match self { + ArbitraryContext::Contract(__self_0) => { + ArbitraryContext::Contract(::core::clone::Clone::clone(__self_0)) + } + ArbitraryContext::CreateContractHostFn(__self_0) => { + ArbitraryContext::CreateContractHostFn(::core::clone::Clone::clone( + __self_0, + )) + } + ArbitraryContext::CreateContractWithCtorHostFn(__self_0) => { + ArbitraryContext::CreateContractWithCtorHostFn(::core::clone::Clone::clone( + __self_0, + )) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryContext { + #[inline] + fn eq(&self, other: &ArbitraryContext) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + ArbitraryContext::Contract(__self_0), + ArbitraryContext::Contract(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryContext::CreateContractHostFn(__self_0), + ArbitraryContext::CreateContractHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryContext::CreateContractWithCtorHostFn(__self_0), + ArbitraryContext::CreateContractWithCtorHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryContext { + #[inline] + fn cmp(&self, other: &ArbitraryContext) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + ArbitraryContext::Contract(__self_0), + ArbitraryContext::Contract(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryContext::CreateContractHostFn(__self_0), + ArbitraryContext::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryContext::CreateContractWithCtorHostFn(__self_0), + ArbitraryContext::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryContext { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + ArbitraryContext::Contract(__self_0), + ArbitraryContext::Contract(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + ArbitraryContext::CreateContractHostFn(__self_0), + ArbitraryContext::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + ArbitraryContext::CreateContractWithCtorHostFn(__self_0), + ArbitraryContext::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryContext: ::std::thread::LocalKey> = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryContext { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) * 3u64) + >> 32 + { + 0u64 => { + ArbitraryContext::Contract(arbitrary::Arbitrary::arbitrary(u)?) + } + 1u64 => ArbitraryContext::CreateContractHostFn( + arbitrary::Arbitrary::arbitrary(u)?, + ), + 2u64 => ArbitraryContext::CreateContractWithCtorHostFn( + arbitrary::Arbitrary::arbitrary(u)?, + ), + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) + * 3u64) + >> 32 + { + 0u64 => ArbitraryContext::Contract( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 1u64 => ArbitraryContext::CreateContractHostFn( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 2u64 => ArbitraryContext::CreateContractWithCtorHostFn( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for Context { + type Prototype = ArbitraryContext; + } + impl soroban_sdk::TryFromVal for Context { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryContext, + ) -> std::result::Result { + Ok(match v { + ArbitraryContext::Contract(field_0) => { + Context::Contract(soroban_sdk::IntoVal::into_val(field_0, env)) + } + ArbitraryContext::CreateContractHostFn(field_0) => { + Context::CreateContractHostFn(soroban_sdk::IntoVal::into_val(field_0, env)) + } + ArbitraryContext::CreateContractWithCtorHostFn(field_0) => { + Context::CreateContractWithCtorHostFn(soroban_sdk::IntoVal::into_val( + field_0, env, + )) + } + }) + } + } + }; + pub enum ContractExecutable { + Wasm(soroban_sdk::BytesN<32>), + } + #[automatically_derived] + impl ::core::fmt::Debug for ContractExecutable { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ContractExecutable::Wasm(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm", &__self_0) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ContractExecutable { + #[inline] + fn clone(&self) -> ContractExecutable { + match self { + ContractExecutable::Wasm(__self_0) => { + ContractExecutable::Wasm(::core::clone::Clone::clone(__self_0)) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ContractExecutable { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ContractExecutable {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ContractExecutable { + #[inline] + fn eq(&self, other: &ContractExecutable) -> bool { + match (self, other) { + (ContractExecutable::Wasm(__self_0), ContractExecutable::Wasm(__arg1_0)) => { + __self_0 == __arg1_0 + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ContractExecutable { + #[inline] + fn cmp(&self, other: &ContractExecutable) -> ::core::cmp::Ordering { + match (self, other) { + (ContractExecutable::Wasm(__self_0), ContractExecutable::Wasm(__arg1_0)) => { + ::core::cmp::Ord::cmp(__self_0, __arg1_0) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ContractExecutable { + #[inline] + fn partial_cmp( + &self, + other: &ContractExecutable, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match (self, other) { + (ContractExecutable::Wasm(__self_0), ContractExecutable::Wasm(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + } + } + } + pub static __SPEC_XDR_TYPE_CONTRACTEXECUTABLE: [u8; 68usize] = ContractExecutable::spec_xdr(); + impl ContractExecutable { + pub const fn spec_xdr() -> [u8; 68usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x12ContractExecutable\0\0\0\0\0\x01\0\0\0\x01\0\0\0\0\0\0\0\x04Wasm\0\0\0\x01\0\0\x03\xee\0\0\0 " + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for ContractExecutable { + const SPEC_TYPE_ID: [u8; 32] = *b"^\xbe34\xd8\x99\x84\x91\x81\x9fu\x9fu\x05\xb8\xb4\x14\x95\xb7\x9d|\x06$\x04y\xe9\"\xb9\x14\xfc\xf9\x85"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CONTRACTEXECUTABLE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"^\xbe34\xd8\x99\x84\x91\x81\x9fu\x9fu\x05\xb8\xb4\x14\x95\xb7\x9d|\x06$\x04y\xe9\"\xb9\x14\xfc\xf9\x85", + [], + ); + impl soroban_sdk::TryFromVal for ContractExecutable { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["Wasm"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Wasm( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &ContractExecutable, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + ContractExecutable::Wasm(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Wasm")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&ContractExecutable, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + impl soroban_sdk::TryFromVal for ContractExecutable { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "Wasm" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::Wasm( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl soroban_sdk::TryFromVal for ContractExecutable { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&ContractExecutable> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &ContractExecutable) -> Result { + extern crate alloc; + Ok(match val { + ContractExecutable::Wasm(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Wasm" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: ContractExecutable) -> Result { + (&val).try_into() + } + } + impl TryFrom<&ContractExecutable> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &ContractExecutable) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: ContractExecutable) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryContractExecutable { + Wasm( + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + ), + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryContractExecutable { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryContractExecutable::Wasm(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm", &__self_0) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryContractExecutable { + #[inline] + fn clone(&self) -> ArbitraryContractExecutable { + match self { + ArbitraryContractExecutable::Wasm(__self_0) => { + ArbitraryContractExecutable::Wasm(::core::clone::Clone::clone(__self_0)) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryContractExecutable { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryContractExecutable {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryContractExecutable { + #[inline] + fn eq(&self, other: &ArbitraryContractExecutable) -> bool { + match (self, other) { + ( + ArbitraryContractExecutable::Wasm(__self_0), + ArbitraryContractExecutable::Wasm(__arg1_0), + ) => __self_0 == __arg1_0, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryContractExecutable { + #[inline] + fn cmp(&self, other: &ArbitraryContractExecutable) -> ::core::cmp::Ordering { + match (self, other) { + ( + ArbitraryContractExecutable::Wasm(__self_0), + ArbitraryContractExecutable::Wasm(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryContractExecutable { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryContractExecutable, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match (self, other) { + ( + ArbitraryContractExecutable::Wasm(__self_0), + ArbitraryContractExecutable::Wasm(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryContractExecutable: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryContractExecutable { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractExecutable.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) * 1u64) + >> 32 + { + 0u64 => ArbitraryContractExecutable::Wasm( + arbitrary::Arbitrary::arbitrary(u)?, + ), + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractExecutable.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractExecutable.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) + * 1u64) + >> 32 + { + 0u64 => ArbitraryContractExecutable::Wasm( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractExecutable.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for ContractExecutable { + type Prototype = ArbitraryContractExecutable; + } + impl soroban_sdk::TryFromVal for ContractExecutable { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryContractExecutable, + ) -> std::result::Result { + Ok(match v { + ArbitraryContractExecutable::Wasm(field_0) => { + ContractExecutable::Wasm(soroban_sdk::IntoVal::into_val(field_0, env)) + } + }) + } + } + }; + pub enum InvokerContractAuthEntry { + Contract(SubContractInvocation), + CreateContractHostFn(CreateContractHostFnContext), + CreateContractWithCtorHostFn(CreateContractWithConstructorHostFnContext), + } + #[automatically_derived] + impl ::core::fmt::Debug for InvokerContractAuthEntry { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + InvokerContractAuthEntry::Contract(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Contract", &__self_0) + } + InvokerContractAuthEntry::CreateContractHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractHostFn", + &__self_0, + ) + } + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractWithCtorHostFn", + &__self_0, + ) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for InvokerContractAuthEntry { + #[inline] + fn clone(&self) -> InvokerContractAuthEntry { + match self { + InvokerContractAuthEntry::Contract(__self_0) => { + InvokerContractAuthEntry::Contract(::core::clone::Clone::clone(__self_0)) + } + InvokerContractAuthEntry::CreateContractHostFn(__self_0) => { + InvokerContractAuthEntry::CreateContractHostFn(::core::clone::Clone::clone( + __self_0, + )) + } + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0) => { + InvokerContractAuthEntry::CreateContractWithCtorHostFn( + ::core::clone::Clone::clone(__self_0), + ) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for InvokerContractAuthEntry { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for InvokerContractAuthEntry {} + #[automatically_derived] + impl ::core::cmp::PartialEq for InvokerContractAuthEntry { + #[inline] + fn eq(&self, other: &InvokerContractAuthEntry) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + InvokerContractAuthEntry::Contract(__self_0), + InvokerContractAuthEntry::Contract(__arg1_0), + ) => __self_0 == __arg1_0, + ( + InvokerContractAuthEntry::CreateContractHostFn(__self_0), + InvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + ( + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0), + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for InvokerContractAuthEntry { + #[inline] + fn cmp(&self, other: &InvokerContractAuthEntry) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + InvokerContractAuthEntry::Contract(__self_0), + InvokerContractAuthEntry::Contract(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractHostFn(__self_0), + InvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0), + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for InvokerContractAuthEntry { + #[inline] + fn partial_cmp( + &self, + other: &InvokerContractAuthEntry, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + InvokerContractAuthEntry::Contract(__self_0), + InvokerContractAuthEntry::Contract(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractHostFn(__self_0), + InvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0), + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + pub static __SPEC_XDR_TYPE_INVOKERCONTRACTAUTHENTRY: [u8; 268usize] = + InvokerContractAuthEntry::spec_xdr(); + impl InvokerContractAuthEntry { + pub const fn spec_xdr() -> [u8; 268usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x18InvokerContractAuthEntry\0\0\0\x03\0\0\0\x01\0\0\0\0\0\0\0\x08Contract\0\0\0\x01\0\0\x07\xd0\0\0\0\x15SubContractInvocation\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x14CreateContractHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0\x1bCreateContractHostFnContext\0\0\0\0\x01\0\0\0\0\0\0\0\x1cCreateContractWithCtorHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0*CreateContractWithConstructorHostFnContext\0\0" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for InvokerContractAuthEntry { + const SPEC_TYPE_ID: [u8; 32] = *b"\xf0{\xa6\xe9r\xf3\x10\xf6\x0b)\xdb\x8e\r\xea\xe0\xa0\x89\xca\x1a\x1c\x12\xf8\x8f'K\xda\x9b\x87\xab\xaa\xf8="; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_INVOKERCONTRACTAUTHENTRY: [u8; 138usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 138usize, + 3usize, + >( + 2, + *b"\xf0{\xa6\xe9r\xf3\x10\xf6\x0b)\xdb\x8e\r\xea\xe0\xa0\x89\xca\x1a\x1c\x12\xf8\x8f'K\xda\x9b\x87\xab\xaa\xf8=", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); + impl soroban_sdk::TryFromVal for InvokerContractAuthEntry { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &[ + "Contract", + "CreateContractHostFn", + "CreateContractWithCtorHostFn", + ]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Contract( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 2 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractWithCtorHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &InvokerContractAuthEntry, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + InvokerContractAuthEntry::Contract(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Contract")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + InvokerContractAuthEntry::CreateContractHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"CreateContractHostFn")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + InvokerContractAuthEntry::CreateContractWithCtorHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"CreateContractWithCtorHostFn")? + .to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&InvokerContractAuthEntry, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + impl soroban_sdk::TryFromVal + for InvokerContractAuthEntry + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "Contract" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::Contract( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "CreateContractHostFn" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::CreateContractHostFn( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "CreateContractWithCtorHostFn" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::CreateContractWithCtorHostFn( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl soroban_sdk::TryFromVal + for InvokerContractAuthEntry + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&InvokerContractAuthEntry> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &InvokerContractAuthEntry) -> Result { + extern crate alloc; + Ok(match val { + InvokerContractAuthEntry::Contract(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Contract" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + InvokerContractAuthEntry::CreateContractHostFn(value0) => ( + soroban_sdk::xdr::ScSymbol( + "CreateContractHostFn" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + InvokerContractAuthEntry::CreateContractWithCtorHostFn(value0) => ( + soroban_sdk::xdr::ScSymbol( + "CreateContractWithCtorHostFn" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: InvokerContractAuthEntry) -> Result { + (&val).try_into() + } + } + impl TryFrom<&InvokerContractAuthEntry> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &InvokerContractAuthEntry) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: InvokerContractAuthEntry) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryInvokerContractAuthEntry { + Contract( + ::Prototype, + ), + CreateContractHostFn( + ::Prototype, + ), + CreateContractWithCtorHostFn( + ::Prototype, + ), + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryInvokerContractAuthEntry { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryInvokerContractAuthEntry::Contract(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Contract", &__self_0) + } + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractHostFn", + &__self_0, + ) + } + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractWithCtorHostFn", + &__self_0, + ) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryInvokerContractAuthEntry { + #[inline] + fn clone(&self) -> ArbitraryInvokerContractAuthEntry { + match self { + ArbitraryInvokerContractAuthEntry::Contract(__self_0) => { + ArbitraryInvokerContractAuthEntry::Contract(::core::clone::Clone::clone( + __self_0, + )) + } + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0) => { + ArbitraryInvokerContractAuthEntry::CreateContractHostFn( + ::core::clone::Clone::clone(__self_0), + ) + } + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0) => { + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + ::core::clone::Clone::clone(__self_0), + ) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryInvokerContractAuthEntry { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryInvokerContractAuthEntry {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryInvokerContractAuthEntry { + #[inline] + fn eq(&self, other: &ArbitraryInvokerContractAuthEntry) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + ArbitraryInvokerContractAuthEntry::Contract(__self_0), + ArbitraryInvokerContractAuthEntry::Contract(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0), + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __self_0, + ), + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __arg1_0, + ), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryInvokerContractAuthEntry { + #[inline] + fn cmp(&self, other: &ArbitraryInvokerContractAuthEntry) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + ArbitraryInvokerContractAuthEntry::Contract(__self_0), + ArbitraryInvokerContractAuthEntry::Contract(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0), + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __self_0, + ), + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __arg1_0, + ), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryInvokerContractAuthEntry { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryInvokerContractAuthEntry, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + ArbitraryInvokerContractAuthEntry::Contract(__self_0), + ArbitraryInvokerContractAuthEntry::Contract(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0), + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0), + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryInvokerContractAuthEntry { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) * 3u64) + >> 32 + { + 0u64 => ArbitraryInvokerContractAuthEntry::Contract( + arbitrary::Arbitrary::arbitrary(u)?, + ), + 1u64 => ArbitraryInvokerContractAuthEntry::CreateContractHostFn( + arbitrary::Arbitrary::arbitrary(u)?, + ), + 2u64 => { + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + arbitrary::Arbitrary::arbitrary(u)?, + ) + } + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) + * 3u64) + >> 32 + { + 0u64 => ArbitraryInvokerContractAuthEntry::Contract( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 1u64 => ArbitraryInvokerContractAuthEntry::CreateContractHostFn( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 2u64 => { + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ) + } + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for InvokerContractAuthEntry { + type Prototype = ArbitraryInvokerContractAuthEntry; + } + impl soroban_sdk::TryFromVal + for InvokerContractAuthEntry + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryInvokerContractAuthEntry, + ) -> std::result::Result { + Ok(match v { + ArbitraryInvokerContractAuthEntry::Contract(field_0) => { + InvokerContractAuthEntry::Contract(soroban_sdk::IntoVal::into_val( + field_0, env, + )) + } + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(field_0) => { + InvokerContractAuthEntry::CreateContractHostFn( + soroban_sdk::IntoVal::into_val(field_0, env), + ) + } + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn(field_0) => { + InvokerContractAuthEntry::CreateContractWithCtorHostFn( + soroban_sdk::IntoVal::into_val(field_0, env), + ) + } + }) + } + } + }; + pub enum Executable { + Wasm(soroban_sdk::BytesN<32>), + StellarAsset, + Account, + } + #[automatically_derived] + impl ::core::fmt::Debug for Executable { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + Executable::Wasm(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm", &__self_0) + } + Executable::StellarAsset => ::core::fmt::Formatter::write_str(f, "StellarAsset"), + Executable::Account => ::core::fmt::Formatter::write_str(f, "Account"), + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for Executable { + #[inline] + fn clone(&self) -> Executable { + match self { + Executable::Wasm(__self_0) => { + Executable::Wasm(::core::clone::Clone::clone(__self_0)) + } + Executable::StellarAsset => Executable::StellarAsset, + Executable::Account => Executable::Account, + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for Executable { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for Executable {} + #[automatically_derived] + impl ::core::cmp::PartialEq for Executable { + #[inline] + fn eq(&self, other: &Executable) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + (Executable::Wasm(__self_0), Executable::Wasm(__arg1_0)) => { + __self_0 == __arg1_0 + } + _ => true, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for Executable { + #[inline] + fn cmp(&self, other: &Executable) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + (Executable::Wasm(__self_0), Executable::Wasm(__arg1_0)) => { + ::core::cmp::Ord::cmp(__self_0, __arg1_0) + } + _ => ::core::cmp::Ordering::Equal, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for Executable { + #[inline] + fn partial_cmp(&self, other: &Executable) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + (Executable::Wasm(__self_0), Executable::Wasm(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + pub static __SPEC_XDR_TYPE_EXECUTABLE: [u8; 104usize] = Executable::spec_xdr(); + impl Executable { + pub const fn spec_xdr() -> [u8; 104usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\nExecutable\0\0\0\0\0\x03\0\0\0\x01\0\0\0\0\0\0\0\x04Wasm\0\0\0\x01\0\0\x03\xee\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\x0cStellarAsset\0\0\0\0\0\0\0\0\0\0\0\x07Account\0" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for Executable { + const SPEC_TYPE_ID: [u8; 32] = *b"L|{\r\xf4\xf2\x1a\xa8\xf6\x981\xe2K\xcb\x824N\xe6\x97\xed\xdf\xc2\x1cck\xd6\xceW\x9cx\x10\x1e"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_EXECUTABLE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"L|{\r\xf4\xf2\x1a\xa8\xf6\x981\xe2K\xcb\x824N\xe6\x97\xed\xdf\xc2\x1cck\xd6\xceW\x9cx\x10\x1e", + [], + ); + impl soroban_sdk::TryFromVal for Executable { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["Wasm", "StellarAsset", "Account"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Wasm( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 0 { + return Err(soroban_sdk::ConversionError); + } + Self::StellarAsset + } + 2 => { + if iter.len() > 0 { + return Err(soroban_sdk::ConversionError); + } + Self::Account + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &Executable, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + Executable::Wasm(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Wasm")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + Executable::StellarAsset => { + let tup: (soroban_sdk::Val,) = + (soroban_sdk::Symbol::try_from_val(env, &"StellarAsset")?.to_val(),); + tup.try_into_val(env).map_err(Into::into) + } + Executable::Account => { + let tup: (soroban_sdk::Val,) = + (soroban_sdk::Symbol::try_from_val(env, &"Account")?.to_val(),); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&Executable, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal for Executable { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "Wasm" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::Wasm( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "StellarAsset" => { + if iter.len() > 0 { + return Err(soroban_sdk::xdr::Error::Invalid); + } + Self::StellarAsset + } + "Account" => { + if iter.len() > 0 { + return Err(soroban_sdk::xdr::Error::Invalid); + } + Self::Account + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl soroban_sdk::TryFromVal for Executable { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&Executable> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &Executable) -> Result { + extern crate alloc; + Ok(match val { + Executable::Wasm(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Wasm" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + Executable::StellarAsset => { + let symbol = soroban_sdk::xdr::ScSymbol( + "StellarAsset" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ); + let val = soroban_sdk::xdr::ScVal::Symbol(symbol); + (val,) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + } + Executable::Account => { + let symbol = soroban_sdk::xdr::ScSymbol( + "Account" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ); + let val = soroban_sdk::xdr::ScVal::Symbol(symbol); + (val,) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + } + }) + } + } + impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Executable) -> Result { + (&val).try_into() + } + } + impl TryFrom<&Executable> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &Executable) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Executable) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryExecutable { + Wasm( + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + ), + StellarAsset, + Account, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryExecutable { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryExecutable::Wasm(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm", &__self_0) + } + ArbitraryExecutable::StellarAsset => { + ::core::fmt::Formatter::write_str(f, "StellarAsset") + } + ArbitraryExecutable::Account => ::core::fmt::Formatter::write_str(f, "Account"), + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryExecutable { + #[inline] + fn clone(&self) -> ArbitraryExecutable { + match self { + ArbitraryExecutable::Wasm(__self_0) => { + ArbitraryExecutable::Wasm(::core::clone::Clone::clone(__self_0)) + } + ArbitraryExecutable::StellarAsset => ArbitraryExecutable::StellarAsset, + ArbitraryExecutable::Account => ArbitraryExecutable::Account, + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryExecutable { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryExecutable {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryExecutable { + #[inline] + fn eq(&self, other: &ArbitraryExecutable) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + ArbitraryExecutable::Wasm(__self_0), + ArbitraryExecutable::Wasm(__arg1_0), + ) => __self_0 == __arg1_0, + _ => true, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryExecutable { + #[inline] + fn cmp(&self, other: &ArbitraryExecutable) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + ArbitraryExecutable::Wasm(__self_0), + ArbitraryExecutable::Wasm(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => ::core::cmp::Ordering::Equal, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryExecutable { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryExecutable, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + (ArbitraryExecutable::Wasm(__self_0), ArbitraryExecutable::Wasm(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryExecutable: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryExecutable { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryExecutable.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) * 3u64) + >> 32 + { + 0u64 => { + ArbitraryExecutable::Wasm(arbitrary::Arbitrary::arbitrary(u)?) + } + 1u64 => ArbitraryExecutable::StellarAsset, + 2u64 => ArbitraryExecutable::Account, + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryExecutable.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryExecutable.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) + * 3u64) + >> 32 + { + 0u64 => ArbitraryExecutable::Wasm( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 1u64 => ArbitraryExecutable::StellarAsset, + 2u64 => ArbitraryExecutable::Account, + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryExecutable.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all(&[]), + arbitrary::size_hint::and_all(&[]), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for Executable { + type Prototype = ArbitraryExecutable; + } + impl soroban_sdk::TryFromVal for Executable { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryExecutable, + ) -> std::result::Result { + Ok(match v { + ArbitraryExecutable::Wasm(field_0) => { + Executable::Wasm(soroban_sdk::IntoVal::into_val(field_0, env)) + } + ArbitraryExecutable::StellarAsset => Executable::StellarAsset, + ArbitraryExecutable::Account => Executable::Account, + }) + } + } + }; } pub struct Contract; ///ContractArgs is a type for building arg lists for functions defined in "Contract". @@ -355,6 +5012,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08add_with\0\0\0\x03\0\0\0\0\0\0\0\x0bcontract_id\0\0\0\0\x13\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x06\0\0\0\0\0\0\0\x01y\0\0\0\0\0\0\x06\0\0\0\x01\0\0\0\x06" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_ADD_WITH: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x01\x85\x97Gi\xe3\x86f\xe3\"\xb0+Y\xbf$\x98lN\x03\x1dk\x99\x17\xc6\x9a1\xfer\xafF\xa7\x0b", + [], +); impl<'a> ContractClient<'a> { pub fn add_with(&self, contract_id: &Address, x: &u64, y: &u64) -> u64 { use core::ops::Not; diff --git a/tests-expanded/test_import_contract_wasm32v1-none.rs b/tests-expanded/test_import_contract_wasm32v1-none.rs index 7cf04ad08..aa38a6f97 100644 --- a/tests-expanded/test_import_contract_wasm32v1-none.rs +++ b/tests-expanded/test_import_contract_wasm32v1-none.rs @@ -6,7 +6,7 @@ extern crate core; use core::prelude::rust_2021::*; use soroban_sdk::{contract, contractimpl, Address, Env}; mod addcontract { - pub const WASM: &[u8] = b"\x00asm\x01\x00\x00\x00\x01\x14\x04`\x01~\x01~`\x02\x7f~\x00`\x02~~\x01~`\x00\x00\x02\r\x02\x01i\x010\x00\x00\x01i\x01_\x00\x00\x03\x05\x04\x01\x02\x03\x03\x05\x03\x01\x00\x10\x06!\x04\x7f\x01A\x80\x80\xc0\x00\x0b\x7f\x00A\x80\x80\xc0\x00\x0b\x7f\x00A\x80\x80\xc0\x00\x0b\x7f\x00A\x80\x80\xc0\x00\x0b\x07/\x05\x06memory\x02\x00\x03add\x00\x03\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n\x8b\x02\x04]\x02\x01\x7f\x01~\x02@\x02@ \x01\xa7A\xff\x01q\"\x02A\xc0\x00F\r\x00\x02@ \x02A\x06F\r\x00B\x01!\x03B\x83\x90\x80\x80\x80\x01!\x01\x0c\x02\x0b \x01B\x08\x88!\x01B\x00!\x03\x0c\x01\x0bB\x00!\x03 \x01\x10\x80\x80\x80\x80\x00!\x01\x0b \x00 \x037\x03\x00 \x00 \x017\x03\x08\x0b\x9c\x01\x01\x01\x7f#\x80\x80\x80\x80\x00A\x10k\"\x02$\x80\x80\x80\x80\x00 \x02 \x00\x10\x82\x80\x80\x80\x00\x02@\x02@ \x02(\x02\x00A\x01F\r\x00 \x02)\x03\x08!\x00 \x02 \x01\x10\x82\x80\x80\x80\x00 \x02(\x02\x00A\x01F\r\x00 \x02)\x03\x08\"\x01 \x00|\"\x00 \x01T\r\x01\x02@\x02@ \x00B\xff\xff\xff\xff\xff\xff\xff\xff\x00V\r\x00 \x00B\x08\x86B\x06\x84!\x00\x0c\x01\x0b \x00\x10\x81\x80\x80\x80\x00!\x00\x0b \x02A\x10j$\x80\x80\x80\x80\x00 \x00\x0f\x0b\x00\x0b\x10\x84\x80\x80\x80\x00\x00\x0b\t\x00\x10\x85\x80\x80\x80\x00\x00\x0b\x03\x00\x00\x0b\x0b\t\x01\x00A\x80\x80\xc0\x00\x0b\x00\x00K\x0econtractspecv0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03add\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01a\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x01b\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x01\x00\x00\x00\x06\x00\x1e\x11contractenvmetav0\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x00\x00O\x0econtractmetav0\x00\x00\x00\x00\x00\x00\x00\x05rsver\x00\x00\x00\x00\x00\x00\x061.91.0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12rssdk_spec_shaking\x00\x00\x00\x00\x00\x012\x00\x00\x00"; + pub const WASM: &[u8] = b"\x00asm\x01\x00\x00\x00\x01\x14\x04`\x01~\x01~`\x02\x7f~\x00`\x02~~\x01~`\x00\x00\x02\r\x02\x01i\x010\x00\x00\x01i\x01_\x00\x00\x03\x05\x04\x01\x02\x03\x03\x05\x03\x01\x00\x10\x06!\x04\x7f\x01A\x80\x80\xc0\x00\x0b\x7f\x00A\x80\x80\xc0\x00\x0b\x7f\x00A\x80\x80\xc0\x00\x0b\x7f\x00A\x80\x80\xc0\x00\x0b\x07/\x05\x06memory\x02\x00\x03add\x00\x03\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n\x8b\x02\x04]\x02\x01\x7f\x01~\x02@\x02@ \x01\xa7A\xff\x01q\"\x02A\xc0\x00F\r\x00\x02@ \x02A\x06F\r\x00B\x01!\x03B\x83\x90\x80\x80\x80\x01!\x01\x0c\x02\x0b \x01B\x08\x88!\x01B\x00!\x03\x0c\x01\x0bB\x00!\x03 \x01\x10\x80\x80\x80\x80\x00!\x01\x0b \x00 \x037\x03\x00 \x00 \x017\x03\x08\x0b\x9c\x01\x01\x01\x7f#\x80\x80\x80\x80\x00A\x10k\"\x02$\x80\x80\x80\x80\x00 \x02 \x00\x10\x82\x80\x80\x80\x00\x02@\x02@ \x02(\x02\x00A\x01F\r\x00 \x02)\x03\x08!\x00 \x02 \x01\x10\x82\x80\x80\x80\x00 \x02(\x02\x00A\x01F\r\x00 \x02)\x03\x08\"\x01 \x00|\"\x00 \x01T\r\x01\x02@\x02@ \x00B\xff\xff\xff\xff\xff\xff\xff\xff\x00V\r\x00 \x00B\x08\x86B\x06\x84!\x00\x0c\x01\x0b \x00\x10\x81\x80\x80\x80\x00!\x00\x0b \x02A\x10j$\x80\x80\x80\x80\x00 \x00\x0f\x0b\x00\x0b\x10\x84\x80\x80\x80\x00\x00\x0b\t\x00\x10\x85\x80\x80\x80\x00\x00\x0b\x03\x00\x00\x0b\x0b\t\x01\x00A\x80\x80\xc0\x00\x0b\x00\x00\xdf\x15\x0econtractspecv0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03add\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01a\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x01b\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x01\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\xe3Context of a single authorized call performed by an address.\n\nCustom account contracts that implement `__check_auth` special function\nreceive a list of `Context` values corresponding to all the calls that\nneed to be authorized.\x00\x00\x00\x00\x00\x00\x00\x00\x07Context\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x14Contract invocation.\x00\x00\x00\x08Contract\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0fContractContext\x00\x00\x00\x00\x01\x00\x00\x00=Contract that has a constructor with no arguments is created.\x00\x00\x00\x00\x00\x00\x14CreateContractHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x1bCreateContractHostFnContext\x00\x00\x00\x00\x01\x00\x00\x00DContract that has a constructor with 1 or more arguments is created.\x00\x00\x00\x1cCreateContractWithCtorHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00*CreateContractWithConstructorHostFnContext\x00\x00\x00\x00\x00\x01\x00\x00\x00\xbdAuthorization context of a single contract call.\n\nThis struct corresponds to a `require_auth_for_args` call for an address\nfrom `contract` function with `fn_name` name and `args` arguments.\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fContractContext\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x04args\x00\x00\x03\xea\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08contract\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x07fn_name\x00\x00\x00\x00\x11\x00\x00\x00\x02\x00\x00\x00_Contract executable used for creating a new contract and used in\n`CreateContractHostFnContext`.\x00\x00\x00\x00\x00\x00\x00\x00\x12ContractExecutable\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Wasm\x00\x00\x00\x01\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x01\x00\x00\x008Value of contract node in InvokerContractAuthEntry tree.\x00\x00\x00\x00\x00\x00\x00\x15SubContractInvocation\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x07context\x00\x00\x00\x07\xd0\x00\x00\x00\x0fContractContext\x00\x00\x00\x00\x00\x00\x00\x00\x0fsub_invocations\x00\x00\x00\x03\xea\x00\x00\x07\xd0\x00\x00\x00\x18InvokerContractAuthEntry\x00\x00\x00\x02\x00\x00\x01/A node in the tree of authorizations performed on behalf of the current\ncontract as invoker of the contracts deeper in the call stack.\n\nThis is used as an argument of `authorize_as_current_contract` host function.\n\nThis tree corresponds `require_auth[_for_args]` calls on behalf of the\ncurrent contract.\x00\x00\x00\x00\x00\x00\x00\x00\x18InvokerContractAuthEntry\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x12Invoke a contract.\x00\x00\x00\x00\x00\x08Contract\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x15SubContractInvocation\x00\x00\x00\x00\x00\x00\x01\x00\x00\x005Create a contract passing 0 arguments to constructor.\x00\x00\x00\x00\x00\x00\x14CreateContractHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x1bCreateContractHostFnContext\x00\x00\x00\x00\x01\x00\x00\x00=Create a contract passing 0 or more arguments to constructor.\x00\x00\x00\x00\x00\x00\x1cCreateContractWithCtorHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00*CreateContractWithConstructorHostFnContext\x00\x00\x00\x00\x00\x01\x00\x00\x00vAuthorization context for `create_contract` host function that creates a\nnew contract on behalf of authorizer address.\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1bCreateContractHostFnContext\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\nexecutable\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12ContractExecutable\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04salt\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x01\x00\x00\x00\xd6Authorization context for `create_contract` host function that creates a\nnew contract on behalf of authorizer address.\nThis is the same as `CreateContractHostFnContext`, but also has\ncontract constructor arguments.\x00\x00\x00\x00\x00\x00\x00\x00\x00*CreateContractWithConstructorHostFnContext\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x10constructor_args\x00\x00\x03\xea\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nexecutable\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12ContractExecutable\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04salt\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nExecutable\x00\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Wasm\x00\x00\x00\x01\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStellarAsset\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07Account\x00\x00\xd7\x05\x1ccontractspecv0.rssdk.graphv0SpGrV\x01\x00\x00\x03\xedX=\x97\x96\x0b\xa5*Y\x95;WYd\xcb\x0fF\x96\xdf>\xba\x07\x0f{\x08\xfb+dY\xb4,\x00\x00SpGrV\x01\x00\x02\xa3J\xcf\xf7D\x93\x0bB]\x95\xeb\xfe\x03y\x83e5\\\x16\xeb\x94Ne\xe6Xw\x1f&\xf7\xc0pT\x00\x03\xf1\xf9\x90\x07E*e\xfd\x08\x8c\xc2\xb1\x10\xfd\xca\xae6T\x9e)[\xdb\xee_\xfa\xed\xcaE\x9bv\x98\xec\x15\xe5\x1a,\xc0\xc7\xef\xd4\xe0\xda\x0e\x16\x87\x1a\xae\xe73X\x1d2\x8a\x8aP\xab\x81\xef\x18\x8e:\xa2\xa9ns\x94\x0c\x1926\x1d\x90\x19\xc8\x8b=\xbe\xaf\xd7n\xcd=z\t\xb27\xa5.\xde:>\x03\xcd7\x12\xafSpGrV\x01\x00\x02\xf1\xf9\x90\x07E*e\xfd\x08\x8c\xc2\xb1\x10\xfd\xca\xae6T\x9e)[\xdb\xee_\xfa\xed\xcaE\x9bv\x98\xec\x00\x00SpGrV\x01\x00\x02\xb6\xb1Hy\xda\xca\xaf\xcc\x1f\x01\x07y\x9a#g}2\x1c.Q0Vf\xc7ze\xacm\x01\xf5Y\xcc\x00\x00SpGrV\x01\x00\x02\x9e)H\x8e\xf0\x01{{\xce\x9fdO\x0eD\xc0,\x0f\xe8\xee\'\x845r\x9f\xeb`\xd0\x12H\x17\x96g\x00\x02\xf1\xf9\x90\x07E*e\xfd\x08\x8c\xc2\xb1\x10\xfd\xca\xae6T\x9e)[\xdb\xee_\xfa\xed\xcaE\x9bv\x98\xecULqD\xd3\xfa:\x1f\x0c\xa5\xb7\x04\xe5H\x8b\x91J\x9e\x0fe\x7f\x9f[\xdbG#\xc7o\xb0\xf4\xcf\xe6SpGrV\x01\x00\x02ULqD\xd3\xfa:\x1f\x0c\xa5\xb7\x04\xe5H\x8b\x91J\x9e\x0fe\x7f\x9f[\xdbG#\xc7o\xb0\xf4\xcf\xe6\x00\x03\x9e)H\x8e\xf0\x01{{\xce\x9fdO\x0eD\xc0,\x0f\xe8\xee\'\x845r\x9f\xeb`\xd0\x12H\x17\x96g\x15\xe5\x1a,\xc0\xc7\xef\xd4\xe0\xda\x0e\x16\x87\x1a\xae\xe73X\x1d2\x8a\x8aP\xab\x81\xef\x18\x8e:\xa2\xa9ns\x94\x0c\x1926\x1d\x90\x19\xc8\x8b=\xbe\xaf\xd7n\xcd=z\t\xb27\xa5.\xde:>\x03\xcd7\x12\xafSpGrV\x01\x00\x02\x15\xe5\x1a,\xc0\xc7\xef\xd4\xe0\xda\x0e\x16\x87\x1a\xae\xe73X\x1d2\x8a\x8aP\xab\x81\xef\x18\x8e:\xa2\xa9n\x00\x01\xb6\xb1Hy\xda\xca\xaf\xcc\x1f\x01\x07y\x9a#g}2\x1c.Q0Vf\xc7ze\xacm\x01\xf5Y\xccSpGrV\x01\x00\x02s\x94\x0c\x1926\x1d\x90\x19\xc8\x8b=\xbe\xaf\xd7n\xcd=z\t\xb27\xa5.\xde:>\x03\xcd7\x12\xaf\x00\x01\xb6\xb1Hy\xda\xca\xaf\xcc\x1f\x01\x07y\x9a#g}2\x1c.Q0Vf\xc7ze\xacm\x01\xf5Y\xccSpGrV\x01\x00\x02L|{\r\xf4\xf2\x1a\xa8\xf6\x981\xe2K\xcb\x824N\xe6\x97\xed\xdf\xc2\x1cck\xd6\xceW\x9cx\x10\x1e\x00\x00\x00\x1e\x11contractenvmetav0\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x00\x00O\x0econtractmetav0\x00\x00\x00\x00\x00\x00\x00\x05rsver\x00\x00\x00\x00\x00\x00\x061.91.0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12rssdk_spec_shaking\x00\x00\x00\x00\x00\x012\x00\x00\x00"; pub trait Contract { fn add(env: soroban_sdk::Env, a: u64, b: u64) -> u64; } @@ -80,6 +80,1544 @@ mod addcontract { (a, b) } } + pub struct ContractContext { + pub args: soroban_sdk::Vec, + pub contract: soroban_sdk::Address, + pub fn_name: soroban_sdk::Symbol, + } + #[automatically_derived] + impl ::core::fmt::Debug for ContractContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "ContractContext", + "args", + &self.args, + "contract", + &self.contract, + "fn_name", + &&self.fn_name, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ContractContext { + #[inline] + fn clone(&self) -> ContractContext { + ContractContext { + args: ::core::clone::Clone::clone(&self.args), + contract: ::core::clone::Clone::clone(&self.contract), + fn_name: ::core::clone::Clone::clone(&self.fn_name), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ContractContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ContractContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ContractContext { + #[inline] + fn eq(&self, other: &ContractContext) -> bool { + self.args == other.args + && self.contract == other.contract + && self.fn_name == other.fn_name + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ContractContext { + #[inline] + fn cmp(&self, other: &ContractContext) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.args, &other.args) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.contract, &other.contract) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.fn_name, &other.fn_name) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ContractContext { + #[inline] + fn partial_cmp( + &self, + other: &ContractContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.args, &other.args) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp(&self.contract, &other.contract) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.fn_name, &other.fn_name) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_TYPE_CONTRACTCONTEXT: [u8; 96usize] = ContractContext::spec_xdr(); + impl ContractContext { + pub const fn spec_xdr() -> [u8; 96usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fContractContext\0\0\0\0\x03\0\0\0\0\0\0\0\x04args\0\0\x03\xea\0\0\0\0\0\0\0\0\0\0\0\x08contract\0\0\0\x13\0\0\0\0\0\0\0\x07fn_name\0\0\0\0\x11" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for ContractContext { + const SPEC_TYPE_ID: [u8; 32] = *b"\x03\x04uN\xea\xd7[\x13V\x9f\xd4\xbd\xc1\x8a\xd6\x7f\xd8iD\xa5B\x89qT\x0b'\xad(\xb8\x9f\x8f\x19"; + } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CONTRACTCONTEXT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\x03\x04uN\xea\xd7[\x13V\x9f\xd4\xbd\xc1\x8a\xd6\x7f\xd8iD\xa5B\x89qT\x0b'\xad(\xb8\x9f\x8f\x19", + [], + ); + impl soroban_sdk::TryFromVal for ContractContext { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["args", "contract", "fn_name"]; + let mut vals: [Val; 3usize] = [Val::VOID.to_val(); 3usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + args: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + contract: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + fn_name: vals[2] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &ContractContext, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["args", "contract", "fn_name"]; + let vals: [Val; 3usize] = [ + (&val.args).try_into_val(env).map_err(|_| ConversionError)?, + (&val.contract) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.fn_name) + .try_into_val(env) + .map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&ContractContext, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + pub struct SubContractInvocation { + pub context: ContractContext, + pub sub_invocations: soroban_sdk::Vec, + } + #[automatically_derived] + impl ::core::fmt::Debug for SubContractInvocation { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "SubContractInvocation", + "context", + &self.context, + "sub_invocations", + &&self.sub_invocations, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for SubContractInvocation { + #[inline] + fn clone(&self) -> SubContractInvocation { + SubContractInvocation { + context: ::core::clone::Clone::clone(&self.context), + sub_invocations: ::core::clone::Clone::clone(&self.sub_invocations), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for SubContractInvocation { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for SubContractInvocation {} + #[automatically_derived] + impl ::core::cmp::PartialEq for SubContractInvocation { + #[inline] + fn eq(&self, other: &SubContractInvocation) -> bool { + self.context == other.context && self.sub_invocations == other.sub_invocations + } + } + #[automatically_derived] + impl ::core::cmp::Ord for SubContractInvocation { + #[inline] + fn cmp(&self, other: &SubContractInvocation) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.context, &other.context) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.sub_invocations, &other.sub_invocations) + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for SubContractInvocation { + #[inline] + fn partial_cmp( + &self, + other: &SubContractInvocation, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.context, &other.context) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp( + &self.sub_invocations, + &other.sub_invocations, + ) + } + cmp => cmp, + } + } + } + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_TYPE_SUBCONTRACTINVOCATION: [u8; 144usize] = + SubContractInvocation::spec_xdr(); + impl SubContractInvocation { + pub const fn spec_xdr() -> [u8; 144usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x15SubContractInvocation\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x07context\0\0\0\x07\xd0\0\0\0\x0fContractContext\0\0\0\0\0\0\0\0\x0fsub_invocations\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x18InvokerContractAuthEntry" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for SubContractInvocation { + const SPEC_TYPE_ID: [u8; 32] = *b" \x9d\xc5_\xba\x8fv\x18\x95\x02\xbdJ}\x97\x01KN\xd6\0\xf8\xb6\xefq\xa8j\x11\\\xc7\xd7\xd4\xcf\xf0"; + } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_SUBCONTRACTINVOCATION: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, + >( + 2, + *b" \x9d\xc5_\xba\x8fv\x18\x95\x02\xbdJ}\x97\x01KN\xd6\0\xf8\xb6\xefq\xa8j\x11\\\xc7\xd7\xd4\xcf\xf0", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); + impl soroban_sdk::TryFromVal for SubContractInvocation { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["context", "sub_invocations"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + context: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + sub_invocations: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &SubContractInvocation, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["context", "sub_invocations"]; + let vals: [Val; 2usize] = [ + (&val.context) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.sub_invocations) + .try_into_val(env) + .map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&SubContractInvocation, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + pub struct CreateContractHostFnContext { + pub executable: ContractExecutable, + pub salt: soroban_sdk::BytesN<32>, + } + #[automatically_derived] + impl ::core::fmt::Debug for CreateContractHostFnContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "CreateContractHostFnContext", + "executable", + &self.executable, + "salt", + &&self.salt, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for CreateContractHostFnContext { + #[inline] + fn clone(&self) -> CreateContractHostFnContext { + CreateContractHostFnContext { + executable: ::core::clone::Clone::clone(&self.executable), + salt: ::core::clone::Clone::clone(&self.salt), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for CreateContractHostFnContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for CreateContractHostFnContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for CreateContractHostFnContext { + #[inline] + fn eq(&self, other: &CreateContractHostFnContext) -> bool { + self.executable == other.executable && self.salt == other.salt + } + } + #[automatically_derived] + impl ::core::cmp::Ord for CreateContractHostFnContext { + #[inline] + fn cmp(&self, other: &CreateContractHostFnContext) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.executable, &other.executable) { + ::core::cmp::Ordering::Equal => ::core::cmp::Ord::cmp(&self.salt, &other.salt), + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for CreateContractHostFnContext { + #[inline] + fn partial_cmp( + &self, + other: &CreateContractHostFnContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.executable, &other.executable) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + } + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_TYPE_CREATECONTRACTHOSTFNCONTEXT: [u8; 116usize] = + CreateContractHostFnContext::spec_xdr(); + impl CreateContractHostFnContext { + pub const fn spec_xdr() -> [u8; 116usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x1bCreateContractHostFnContext\0\0\0\0\x02\0\0\0\0\0\0\0\nexecutable\0\0\0\0\x07\xd0\0\0\0\x12ContractExecutable\0\0\0\0\0\0\0\0\0\x04salt\0\0\x03\xee\0\0\0 " + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for CreateContractHostFnContext { + const SPEC_TYPE_ID: [u8; 32] = *b"\xe1\"T\xf0&\x19?P\xad\xa3\xa0\xd2\xf1\xea\xf8~\xde\xe7\x12\xe5_&\xb62Cl\xc8x\xcc.\xd4\xcd"; + } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CREATECONTRACTHOSTFNCONTEXT: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, + >( + 2, + *b"\xe1\"T\xf0&\x19?P\xad\xa3\xa0\xd2\xf1\xea\xf8~\xde\xe7\x12\xe5_&\xb62Cl\xc8x\xcc.\xd4\xcd", + [::SPEC_TYPE_ID], + ); + impl soroban_sdk::TryFromVal for CreateContractHostFnContext { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["executable", "salt"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + executable: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + salt: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &CreateContractHostFnContext, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["executable", "salt"]; + let vals: [Val; 2usize] = [ + (&val.executable) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.salt).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&CreateContractHostFnContext, + ) -> Result { + <_ as soroban_sdk::TryFromVal< + soroban_sdk::Env, + CreateContractHostFnContext, + >>::try_from_val(env, *val) + } + } + pub struct CreateContractWithConstructorHostFnContext { + pub constructor_args: soroban_sdk::Vec, + pub executable: ContractExecutable, + pub salt: soroban_sdk::BytesN<32>, + } + #[automatically_derived] + impl ::core::fmt::Debug for CreateContractWithConstructorHostFnContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "CreateContractWithConstructorHostFnContext", + "constructor_args", + &self.constructor_args, + "executable", + &self.executable, + "salt", + &&self.salt, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for CreateContractWithConstructorHostFnContext { + #[inline] + fn clone(&self) -> CreateContractWithConstructorHostFnContext { + CreateContractWithConstructorHostFnContext { + constructor_args: ::core::clone::Clone::clone(&self.constructor_args), + executable: ::core::clone::Clone::clone(&self.executable), + salt: ::core::clone::Clone::clone(&self.salt), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for CreateContractWithConstructorHostFnContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for CreateContractWithConstructorHostFnContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for CreateContractWithConstructorHostFnContext { + #[inline] + fn eq(&self, other: &CreateContractWithConstructorHostFnContext) -> bool { + self.constructor_args == other.constructor_args + && self.executable == other.executable + && self.salt == other.salt + } + } + #[automatically_derived] + impl ::core::cmp::Ord for CreateContractWithConstructorHostFnContext { + #[inline] + fn cmp(&self, other: &CreateContractWithConstructorHostFnContext) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.constructor_args, &other.constructor_args) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.executable, &other.executable) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for CreateContractWithConstructorHostFnContext { + #[inline] + fn partial_cmp( + &self, + other: &CreateContractWithConstructorHostFnContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp( + &self.constructor_args, + &other.constructor_args, + ) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp(&self.executable, &other.executable) + { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_TYPE_CREATECONTRACTWITHCONSTRUCTORHOSTFNCONTEXT: [u8; 164usize] = + CreateContractWithConstructorHostFnContext::spec_xdr(); + impl CreateContractWithConstructorHostFnContext { + pub const fn spec_xdr() -> [u8; 164usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0*CreateContractWithConstructorHostFnContext\0\0\0\0\0\x03\0\0\0\0\0\0\0\x10constructor_args\0\0\x03\xea\0\0\0\0\0\0\0\0\0\0\0\nexecutable\0\0\0\0\x07\xd0\0\0\0\x12ContractExecutable\0\0\0\0\0\0\0\0\0\x04salt\0\0\x03\xee\0\0\0 " + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for CreateContractWithConstructorHostFnContext { + const SPEC_TYPE_ID: [u8; 32] = *b"\xd2;\xff\xe6\x97\xda;\x83c$F\x15Z\xf1r\xf4\xc18\xfda!\x0b\r\x87\x88\xa0\x9a\x08Yu\xccS"; + } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CREATECONTRACTWITHCONSTRUCTORHOSTFNCONTEXT: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, + >( + 2, + *b"\xd2;\xff\xe6\x97\xda;\x83c$F\x15Z\xf1r\xf4\xc18\xfda!\x0b\r\x87\x88\xa0\x9a\x08Yu\xccS", + [::SPEC_TYPE_ID], + ); + impl soroban_sdk::TryFromVal + for CreateContractWithConstructorHostFnContext + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["constructor_args", "executable", "salt"]; + let mut vals: [Val; 3usize] = [Val::VOID.to_val(); 3usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + constructor_args: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + executable: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + salt: vals[2] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal + for soroban_sdk::Val + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &CreateContractWithConstructorHostFnContext, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["constructor_args", "executable", "salt"]; + let vals: [Val; 3usize] = [ + (&val.constructor_args) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.executable) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.salt).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal + for soroban_sdk::Val + { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&CreateContractWithConstructorHostFnContext, + ) -> Result { + <_ as soroban_sdk::TryFromVal< + soroban_sdk::Env, + CreateContractWithConstructorHostFnContext, + >>::try_from_val(env, *val) + } + } + pub enum Context { + Contract(ContractContext), + CreateContractHostFn(CreateContractHostFnContext), + CreateContractWithCtorHostFn(CreateContractWithConstructorHostFnContext), + } + #[automatically_derived] + impl ::core::fmt::Debug for Context { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + Context::Contract(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Contract", &__self_0) + } + Context::CreateContractHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractHostFn", + &__self_0, + ) + } + Context::CreateContractWithCtorHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractWithCtorHostFn", + &__self_0, + ) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for Context { + #[inline] + fn clone(&self) -> Context { + match self { + Context::Contract(__self_0) => { + Context::Contract(::core::clone::Clone::clone(__self_0)) + } + Context::CreateContractHostFn(__self_0) => { + Context::CreateContractHostFn(::core::clone::Clone::clone(__self_0)) + } + Context::CreateContractWithCtorHostFn(__self_0) => { + Context::CreateContractWithCtorHostFn(::core::clone::Clone::clone(__self_0)) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for Context { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for Context {} + #[automatically_derived] + impl ::core::cmp::PartialEq for Context { + #[inline] + fn eq(&self, other: &Context) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + (Context::Contract(__self_0), Context::Contract(__arg1_0)) => { + __self_0 == __arg1_0 + } + ( + Context::CreateContractHostFn(__self_0), + Context::CreateContractHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + ( + Context::CreateContractWithCtorHostFn(__self_0), + Context::CreateContractWithCtorHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for Context { + #[inline] + fn cmp(&self, other: &Context) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + (Context::Contract(__self_0), Context::Contract(__arg1_0)) => { + ::core::cmp::Ord::cmp(__self_0, __arg1_0) + } + ( + Context::CreateContractHostFn(__self_0), + Context::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + Context::CreateContractWithCtorHostFn(__self_0), + Context::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for Context { + #[inline] + fn partial_cmp(&self, other: &Context) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + (Context::Contract(__self_0), Context::Contract(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + ( + Context::CreateContractHostFn(__self_0), + Context::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + Context::CreateContractWithCtorHostFn(__self_0), + Context::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_TYPE_CONTEXT: [u8; 244usize] = Context::spec_xdr(); + impl Context { + pub const fn spec_xdr() -> [u8; 244usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x07Context\0\0\0\0\x03\0\0\0\x01\0\0\0\0\0\0\0\x08Contract\0\0\0\x01\0\0\x07\xd0\0\0\0\x0fContractContext\0\0\0\0\x01\0\0\0\0\0\0\0\x14CreateContractHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0\x1bCreateContractHostFnContext\0\0\0\0\x01\0\0\0\0\0\0\0\x1cCreateContractWithCtorHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0*CreateContractWithConstructorHostFnContext\0\0" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for Context { + const SPEC_TYPE_ID: [u8; 32] = *b"\r\xb6\x0b\xec\x8f\xd04l1\xb3-\xa0{\x90\xa3\xc2\xab\x93\xd4\x82x\xe1_\x8a\xa8N?.\xcd\xc1\xfc\x08"; + } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CONTEXT: [u8; 138usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 138usize, + 3usize, + >( + 2, + *b"\r\xb6\x0b\xec\x8f\xd04l1\xb3-\xa0{\x90\xa3\xc2\xab\x93\xd4\x82x\xe1_\x8a\xa8N?.\xcd\xc1\xfc\x08", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); + impl soroban_sdk::TryFromVal for Context { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &[ + "Contract", + "CreateContractHostFn", + "CreateContractWithCtorHostFn", + ]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Contract( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 2 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractWithCtorHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &Context, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + Context::Contract(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Contract")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + Context::CreateContractHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"CreateContractHostFn")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + Context::CreateContractWithCtorHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"CreateContractWithCtorHostFn")? + .to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&Context, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } + } + pub enum ContractExecutable { + Wasm(soroban_sdk::BytesN<32>), + } + #[automatically_derived] + impl ::core::fmt::Debug for ContractExecutable { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ContractExecutable::Wasm(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm", &__self_0) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ContractExecutable { + #[inline] + fn clone(&self) -> ContractExecutable { + match self { + ContractExecutable::Wasm(__self_0) => { + ContractExecutable::Wasm(::core::clone::Clone::clone(__self_0)) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ContractExecutable { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ContractExecutable {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ContractExecutable { + #[inline] + fn eq(&self, other: &ContractExecutable) -> bool { + match (self, other) { + (ContractExecutable::Wasm(__self_0), ContractExecutable::Wasm(__arg1_0)) => { + __self_0 == __arg1_0 + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ContractExecutable { + #[inline] + fn cmp(&self, other: &ContractExecutable) -> ::core::cmp::Ordering { + match (self, other) { + (ContractExecutable::Wasm(__self_0), ContractExecutable::Wasm(__arg1_0)) => { + ::core::cmp::Ord::cmp(__self_0, __arg1_0) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ContractExecutable { + #[inline] + fn partial_cmp( + &self, + other: &ContractExecutable, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match (self, other) { + (ContractExecutable::Wasm(__self_0), ContractExecutable::Wasm(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + } + } + } + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_TYPE_CONTRACTEXECUTABLE: [u8; 68usize] = ContractExecutable::spec_xdr(); + impl ContractExecutable { + pub const fn spec_xdr() -> [u8; 68usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x12ContractExecutable\0\0\0\0\0\x01\0\0\0\x01\0\0\0\0\0\0\0\x04Wasm\0\0\0\x01\0\0\x03\xee\0\0\0 " + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for ContractExecutable { + const SPEC_TYPE_ID: [u8; 32] = *b"^\xbe34\xd8\x99\x84\x91\x81\x9fu\x9fu\x05\xb8\xb4\x14\x95\xb7\x9d|\x06$\x04y\xe9\"\xb9\x14\xfc\xf9\x85"; + } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CONTRACTEXECUTABLE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"^\xbe34\xd8\x99\x84\x91\x81\x9fu\x9fu\x05\xb8\xb4\x14\x95\xb7\x9d|\x06$\x04y\xe9\"\xb9\x14\xfc\xf9\x85", + [], + ); + impl soroban_sdk::TryFromVal for ContractExecutable { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["Wasm"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Wasm( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &ContractExecutable, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + ContractExecutable::Wasm(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Wasm")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&ContractExecutable, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + pub enum InvokerContractAuthEntry { + Contract(SubContractInvocation), + CreateContractHostFn(CreateContractHostFnContext), + CreateContractWithCtorHostFn(CreateContractWithConstructorHostFnContext), + } + #[automatically_derived] + impl ::core::fmt::Debug for InvokerContractAuthEntry { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + InvokerContractAuthEntry::Contract(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Contract", &__self_0) + } + InvokerContractAuthEntry::CreateContractHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractHostFn", + &__self_0, + ) + } + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractWithCtorHostFn", + &__self_0, + ) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for InvokerContractAuthEntry { + #[inline] + fn clone(&self) -> InvokerContractAuthEntry { + match self { + InvokerContractAuthEntry::Contract(__self_0) => { + InvokerContractAuthEntry::Contract(::core::clone::Clone::clone(__self_0)) + } + InvokerContractAuthEntry::CreateContractHostFn(__self_0) => { + InvokerContractAuthEntry::CreateContractHostFn(::core::clone::Clone::clone( + __self_0, + )) + } + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0) => { + InvokerContractAuthEntry::CreateContractWithCtorHostFn( + ::core::clone::Clone::clone(__self_0), + ) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for InvokerContractAuthEntry { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for InvokerContractAuthEntry {} + #[automatically_derived] + impl ::core::cmp::PartialEq for InvokerContractAuthEntry { + #[inline] + fn eq(&self, other: &InvokerContractAuthEntry) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + InvokerContractAuthEntry::Contract(__self_0), + InvokerContractAuthEntry::Contract(__arg1_0), + ) => __self_0 == __arg1_0, + ( + InvokerContractAuthEntry::CreateContractHostFn(__self_0), + InvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + ( + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0), + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for InvokerContractAuthEntry { + #[inline] + fn cmp(&self, other: &InvokerContractAuthEntry) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + InvokerContractAuthEntry::Contract(__self_0), + InvokerContractAuthEntry::Contract(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractHostFn(__self_0), + InvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0), + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for InvokerContractAuthEntry { + #[inline] + fn partial_cmp( + &self, + other: &InvokerContractAuthEntry, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + InvokerContractAuthEntry::Contract(__self_0), + InvokerContractAuthEntry::Contract(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractHostFn(__self_0), + InvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0), + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_TYPE_INVOKERCONTRACTAUTHENTRY: [u8; 268usize] = + InvokerContractAuthEntry::spec_xdr(); + impl InvokerContractAuthEntry { + pub const fn spec_xdr() -> [u8; 268usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x18InvokerContractAuthEntry\0\0\0\x03\0\0\0\x01\0\0\0\0\0\0\0\x08Contract\0\0\0\x01\0\0\x07\xd0\0\0\0\x15SubContractInvocation\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x14CreateContractHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0\x1bCreateContractHostFnContext\0\0\0\0\x01\0\0\0\0\0\0\0\x1cCreateContractWithCtorHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0*CreateContractWithConstructorHostFnContext\0\0" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for InvokerContractAuthEntry { + const SPEC_TYPE_ID: [u8; 32] = *b"\xf0{\xa6\xe9r\xf3\x10\xf6\x0b)\xdb\x8e\r\xea\xe0\xa0\x89\xca\x1a\x1c\x12\xf8\x8f'K\xda\x9b\x87\xab\xaa\xf8="; + } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_INVOKERCONTRACTAUTHENTRY: [u8; 138usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 138usize, + 3usize, + >( + 2, + *b"\xf0{\xa6\xe9r\xf3\x10\xf6\x0b)\xdb\x8e\r\xea\xe0\xa0\x89\xca\x1a\x1c\x12\xf8\x8f'K\xda\x9b\x87\xab\xaa\xf8=", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); + impl soroban_sdk::TryFromVal for InvokerContractAuthEntry { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &[ + "Contract", + "CreateContractHostFn", + "CreateContractWithCtorHostFn", + ]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Contract( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 2 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractWithCtorHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &InvokerContractAuthEntry, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + InvokerContractAuthEntry::Contract(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Contract")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + InvokerContractAuthEntry::CreateContractHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"CreateContractHostFn")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + InvokerContractAuthEntry::CreateContractWithCtorHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"CreateContractWithCtorHostFn")? + .to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&InvokerContractAuthEntry, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + pub enum Executable { + Wasm(soroban_sdk::BytesN<32>), + StellarAsset, + Account, + } + #[automatically_derived] + impl ::core::fmt::Debug for Executable { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + Executable::Wasm(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm", &__self_0) + } + Executable::StellarAsset => ::core::fmt::Formatter::write_str(f, "StellarAsset"), + Executable::Account => ::core::fmt::Formatter::write_str(f, "Account"), + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for Executable { + #[inline] + fn clone(&self) -> Executable { + match self { + Executable::Wasm(__self_0) => { + Executable::Wasm(::core::clone::Clone::clone(__self_0)) + } + Executable::StellarAsset => Executable::StellarAsset, + Executable::Account => Executable::Account, + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for Executable { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for Executable {} + #[automatically_derived] + impl ::core::cmp::PartialEq for Executable { + #[inline] + fn eq(&self, other: &Executable) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + (Executable::Wasm(__self_0), Executable::Wasm(__arg1_0)) => { + __self_0 == __arg1_0 + } + _ => true, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for Executable { + #[inline] + fn cmp(&self, other: &Executable) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + (Executable::Wasm(__self_0), Executable::Wasm(__arg1_0)) => { + ::core::cmp::Ord::cmp(__self_0, __arg1_0) + } + _ => ::core::cmp::Ordering::Equal, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for Executable { + #[inline] + fn partial_cmp(&self, other: &Executable) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + (Executable::Wasm(__self_0), Executable::Wasm(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_TYPE_EXECUTABLE: [u8; 104usize] = Executable::spec_xdr(); + impl Executable { + pub const fn spec_xdr() -> [u8; 104usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\nExecutable\0\0\0\0\0\x03\0\0\0\x01\0\0\0\0\0\0\0\x04Wasm\0\0\0\x01\0\0\x03\xee\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\x0cStellarAsset\0\0\0\0\0\0\0\0\0\0\0\x07Account\0" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for Executable { + const SPEC_TYPE_ID: [u8; 32] = *b"L|{\r\xf4\xf2\x1a\xa8\xf6\x981\xe2K\xcb\x824N\xe6\x97\xed\xdf\xc2\x1cck\xd6\xceW\x9cx\x10\x1e"; + } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_EXECUTABLE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"L|{\r\xf4\xf2\x1a\xa8\xf6\x981\xe2K\xcb\x824N\xe6\x97\xed\xdf\xc2\x1cck\xd6\xceW\x9cx\x10\x1e", + [], + ); + impl soroban_sdk::TryFromVal for Executable { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["Wasm", "StellarAsset", "Account"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Wasm( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 0 { + return Err(soroban_sdk::ConversionError); + } + Self::StellarAsset + } + 2 => { + if iter.len() > 0 { + return Err(soroban_sdk::ConversionError); + } + Self::Account + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &Executable, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + Executable::Wasm(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Wasm")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + Executable::StellarAsset => { + let tup: (soroban_sdk::Val,) = + (soroban_sdk::Symbol::try_from_val(env, &"StellarAsset")?.to_val(),); + tup.try_into_val(env).map_err(Into::into) + } + Executable::Account => { + let tup: (soroban_sdk::Val,) = + (soroban_sdk::Symbol::try_from_val(env, &"Account")?.to_val(),); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&Executable, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } + } } pub struct Contract; ///ContractArgs is a type for building arg lists for functions defined in "Contract". @@ -120,6 +1658,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08add_with\0\0\0\x03\0\0\0\0\0\0\0\x0bcontract_id\0\0\0\0\x13\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x06\0\0\0\0\0\0\0\x01y\0\0\0\0\0\0\x06\0\0\0\x01\0\0\0\x06" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_ADD_WITH: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x01\x85\x97Gi\xe3\x86f\xe3\"\xb0+Y\xbf$\x98lN\x03\x1dk\x99\x17\xc6\x9a1\xfer\xafF\xa7\x0b", + [], +); impl<'a> ContractClient<'a> { pub fn add_with(&self, contract_id: &Address, x: &u64, y: &u64) -> u64 { use core::ops::Not; diff --git a/tests-expanded/test_invoke_contract_tests.rs b/tests-expanded/test_invoke_contract_tests.rs index e8d2f3e1f..dac91ef4a 100644 --- a/tests-expanded/test_invoke_contract_tests.rs +++ b/tests-expanded/test_invoke_contract_tests.rs @@ -163,6 +163,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08add_with\0\0\0\x03\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x05\0\0\0\0\0\0\0\x01y\0\0\0\0\0\0\x05\0\0\0\0\0\0\0\x0bcontract_id\0\0\0\0\x13\0\0\0\x01\0\0\0\x05" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_ADD_WITH: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xa2\0%\xfe\xd2\xa1\xa3\x9b\x17\x14\xe0Z\x92\xfbz\x18,\xa67P\xe7\xccc\x08:\x18\x10\\IA \x11", + [], +); impl<'a> ContractClient<'a> { pub fn add_with(&self, x: &i32, y: &i32, contract_id: &Address) -> i32 { use core::ops::Not; @@ -517,6 +526,15 @@ impl AddContract { *b"\0\0\0\0\0\0\0\0\0\0\0\x03add\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x05\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x05\0\0\0\x01\0\0\0\x05" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_ADDCONTRACT_ADD: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"8\xdb\x90\x03q[#*\x9c\xe0\xb6&\xc3\xd6\xb6\xe7h\xdf\x81\xbfG\x1a\x05dRg\x18\xd7\x93b\xa2F", + [], +); impl<'a> AddContractClient<'a> { pub fn add(&self, a: &i32, b: &i32) -> i32 { use core::ops::Not; diff --git a/tests-expanded/test_invoke_contract_wasm32v1-none.rs b/tests-expanded/test_invoke_contract_wasm32v1-none.rs index 1d567a845..980bb774d 100644 --- a/tests-expanded/test_invoke_contract_wasm32v1-none.rs +++ b/tests-expanded/test_invoke_contract_wasm32v1-none.rs @@ -52,6 +52,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08add_with\0\0\0\x03\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x05\0\0\0\0\0\0\0\x01y\0\0\0\0\0\0\x05\0\0\0\0\0\0\0\x0bcontract_id\0\0\0\0\x13\0\0\0\x01\0\0\0\x05" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_ADD_WITH: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xa2\0%\xfe\xd2\xa1\xa3\x9b\x17\x14\xe0Z\x92\xfbz\x18,\xa67P\xe7\xccc\x08:\x18\x10\\IA \x11", + [], +); impl<'a> ContractClient<'a> { pub fn add_with(&self, x: &i32, y: &i32, contract_id: &Address) -> i32 { use core::ops::Not; @@ -200,6 +210,16 @@ impl AddContract { *b"\0\0\0\0\0\0\0\0\0\0\0\x03add\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x05\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x05\0\0\0\x01\0\0\0\x05" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_ADDCONTRACT_ADD: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"8\xdb\x90\x03q[#*\x9c\xe0\xb6&\xc3\xd6\xb6\xe7h\xdf\x81\xbfG\x1a\x05dRg\x18\xd7\x93b\xa2F", + [], +); impl<'a> AddContractClient<'a> { pub fn add(&self, a: &i32, b: &i32) -> i32 { use core::ops::Not; diff --git a/tests-expanded/test_logging_tests.rs b/tests-expanded/test_logging_tests.rs index 2dc3d0c63..5b78a5d36 100644 --- a/tests-expanded/test_logging_tests.rs +++ b/tests-expanded/test_logging_tests.rs @@ -236,6 +236,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x05hello\0\0\0\0\0\0\0\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_HELLO: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xbe\xe2\xaaPL<\xb0\x1ft|RR\xd1Y\xd0\xfb\xeb?f\x01\x0c}\x12W\x9e\xb7RQ3O\x85,", + [], + ); impl<'a> ContractClient<'a> { pub fn hello(&self) -> () { use core::ops::Not; diff --git a/tests-expanded/test_logging_wasm32v1-none.rs b/tests-expanded/test_logging_wasm32v1-none.rs index a2bc19fa9..40a721e1c 100644 --- a/tests-expanded/test_logging_wasm32v1-none.rs +++ b/tests-expanded/test_logging_wasm32v1-none.rs @@ -125,6 +125,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x05hello\0\0\0\0\0\0\0\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_HELLO: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xbe\xe2\xaaPL<\xb0\x1ft|RR\xd1Y\xd0\xfb\xeb?f\x01\x0c}\x12W\x9e\xb7RQ3O\x85,", + [], + ); impl<'a> ContractClient<'a> { pub fn hello(&self) -> () { use core::ops::Not; diff --git a/tests-expanded/test_macros_tests.rs b/tests-expanded/test_macros_tests.rs index 0e0290bbf..ce21cd422 100644 --- a/tests-expanded/test_macros_tests.rs +++ b/tests-expanded/test_macros_tests.rs @@ -157,6 +157,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x05empty\0\0\0\0\0\0\0\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EMPTY: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x02\xe7\xd0\x8a\xd9\x1eRo\x96A\x9b\x0b~\x9b\xdd\x94/\xdc\x8ai\xe5:\xd7\x8b\x93(h\x18\x84\xac\x95\x98", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__empty2__spec { @@ -171,6 +180,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06empty2\0\0\0\0\0\0\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EMPTY2: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"s\x9dR\x0b\xe0\xfb\xe3g\x97\xfcu\xe1\xc5\xffE\x93\x96\xed\n~\x18\xea\x85\xd2\xdbC\x8a\x18@\x90\x04\x01", + [], +); impl<'a> ContractClient<'a> { pub fn empty(&self) -> () { use core::ops::Not; diff --git a/tests-expanded/test_macros_wasm32v1-none.rs b/tests-expanded/test_macros_wasm32v1-none.rs index 32cfbd5cf..993245c6b 100644 --- a/tests-expanded/test_macros_wasm32v1-none.rs +++ b/tests-expanded/test_macros_wasm32v1-none.rs @@ -46,6 +46,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x05empty\0\0\0\0\0\0\0\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EMPTY: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x02\xe7\xd0\x8a\xd9\x1eRo\x96A\x9b\x0b~\x9b\xdd\x94/\xdc\x8ai\xe5:\xd7\x8b\x93(h\x18\x84\xac\x95\x98", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__empty2__spec { @@ -61,6 +71,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06empty2\0\0\0\0\0\0\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EMPTY2: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"s\x9dR\x0b\xe0\xfb\xe3g\x97\xfcu\xe1\xc5\xffE\x93\x96\xed\n~\x18\xea\x85\xd2\xdbC\x8a\x18@\x90\x04\x01", + [], +); impl<'a> ContractClient<'a> { pub fn empty(&self) -> () { use core::ops::Not; diff --git a/tests-expanded/test_modular_tests.rs b/tests-expanded/test_modular_tests.rs index 22d3e3070..07879e776 100644 --- a/tests-expanded/test_modular_tests.rs +++ b/tests-expanded/test_modular_tests.rs @@ -29,6 +29,15 @@ mod feat1 { *b"\0\0\0\0\0\0\0\0\0\0\0\x03one\0\0\0\0\0\0\0\0\x01\0\0\0\x04" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_ONE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b"\xb8\xd7L_V@\0\xd6\xb9\xea.\xe1\x0e\x8c\xfa\x84Q\xd0IY6\x9d\xc3\xfe\x9f\x82\xcf\x0fT\xeetP", + [], + ); impl<'a> ContractClient<'a> { pub fn one(&self) -> u32 { use core::ops::Not; @@ -207,6 +216,15 @@ mod feat2 { *b"\0\0\0\0\0\0\0\0\0\0\0\x03two\0\0\0\0\0\0\0\0\x01\0\0\0\x04" } } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_SUPER__CONTRACT_TWO: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b"\x1a\xea\xe7\xc9\x84\x9bIy2\x86\xe7\xad\\\x98\xc8\xd6\xc7\x99\xb94\xe4\xc4n\xcd\xcb9Yj`\xe7c\x94", + [], + ); impl<'a> ContractClient<'a> { pub fn two(&self) -> u32 { use core::ops::Not; @@ -584,6 +602,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x04zero\0\0\0\0\0\0\0\x01\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_ZERO: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xdc&X\xc4\xdd\x8c\xe3\x97v,\xa4t\x07\xb2\x8a>5f\x90\\V2\xa9\xbb4\xee\xd88P\x140\x0f", + [], + ); impl<'a> ContractClient<'a> { pub fn zero(&self) -> u32 { use core::ops::Not; diff --git a/tests-expanded/test_modular_wasm32v1-none.rs b/tests-expanded/test_modular_wasm32v1-none.rs index e1512ca92..308982268 100644 --- a/tests-expanded/test_modular_wasm32v1-none.rs +++ b/tests-expanded/test_modular_wasm32v1-none.rs @@ -30,6 +30,16 @@ mod feat1 { *b"\0\0\0\0\0\0\0\0\0\0\0\x03one\0\0\0\0\0\0\0\0\x01\0\0\0\x04" } } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_CONTRACT_ONE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b"\xb8\xd7L_V@\0\xd6\xb9\xea.\xe1\x0e\x8c\xfa\x84Q\xd0IY6\x9d\xc3\xfe\x9f\x82\xcf\x0fT\xeetP", + [], + ); impl<'a> ContractClient<'a> { pub fn one(&self) -> u32 { use core::ops::Not; @@ -114,6 +124,16 @@ mod feat2 { *b"\0\0\0\0\0\0\0\0\0\0\0\x03two\0\0\0\0\0\0\0\0\x01\0\0\0\x04" } } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_FN_SUPER__CONTRACT_TWO: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 0, + *b"\x1a\xea\xe7\xc9\x84\x9bIy2\x86\xe7\xad\\\x98\xc8\xd6\xc7\x99\xb94\xe4\xc4n\xcd\xcb9Yj`\xe7c\x94", + [], + ); impl<'a> ContractClient<'a> { pub fn two(&self) -> u32 { use core::ops::Not; @@ -213,6 +233,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x04zero\0\0\0\0\0\0\0\x01\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_ZERO: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xdc&X\xc4\xdd\x8c\xe3\x97v,\xa4t\x07\xb2\x8a>5f\x90\\V2\xa9\xbb4\xee\xd88P\x140\x0f", + [], + ); impl<'a> ContractClient<'a> { pub fn zero(&self) -> u32 { use core::ops::Not; diff --git a/tests-expanded/test_multiimpl_tests.rs b/tests-expanded/test_multiimpl_tests.rs index 40caaa291..01bb67535 100644 --- a/tests-expanded/test_multiimpl_tests.rs +++ b/tests-expanded/test_multiimpl_tests.rs @@ -153,6 +153,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x05empty\0\0\0\0\0\0\0\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EMPTY: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x02\xe7\xd0\x8a\xd9\x1eRo\x96A\x9b\x0b~\x9b\xdd\x94/\xdc\x8ai\xe5:\xd7\x8b\x93(h\x18\x84\xac\x95\x98", + [], +); impl<'a> ContractClient<'a> { pub fn empty(&self) -> () { use core::ops::Not; @@ -321,6 +330,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06empty2\0\0\0\0\0\0\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EMPTY2: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"s\x9dR\x0b\xe0\xfb\xe3g\x97\xfcu\xe1\xc5\xffE\x93\x96\xed\n~\x18\xea\x85\xd2\xdbC\x8a\x18@\x90\x04\x01", + [], +); impl<'a> ContractClient<'a> { pub fn empty2(&self) -> () { use core::ops::Not; @@ -492,6 +510,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06empty3\0\0\0\0\0\0\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EMPTY3: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xa8\xe0#\xee\x83;y\n\x92:j8u@\x83\xab1Y\"qCq>\xb8\x9ep\xeb\x81eVx\x12", + [], + ); impl<'a> ContractClient<'a> { pub fn empty3(&self) -> () { use core::ops::Not; diff --git a/tests-expanded/test_multiimpl_wasm32v1-none.rs b/tests-expanded/test_multiimpl_wasm32v1-none.rs index 1d7f4b1b8..d95639c02 100644 --- a/tests-expanded/test_multiimpl_wasm32v1-none.rs +++ b/tests-expanded/test_multiimpl_wasm32v1-none.rs @@ -42,6 +42,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x05empty\0\0\0\0\0\0\0\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EMPTY: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x02\xe7\xd0\x8a\xd9\x1eRo\x96A\x9b\x0b~\x9b\xdd\x94/\xdc\x8ai\xe5:\xd7\x8b\x93(h\x18\x84\xac\x95\x98", + [], +); impl<'a> ContractClient<'a> { pub fn empty(&self) -> () { use core::ops::Not; @@ -116,6 +126,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06empty2\0\0\0\0\0\0\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EMPTY2: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"s\x9dR\x0b\xe0\xfb\xe3g\x97\xfcu\xe1\xc5\xffE\x93\x96\xed\n~\x18\xea\x85\xd2\xdbC\x8a\x18@\x90\x04\x01", + [], +); impl<'a> ContractClient<'a> { pub fn empty2(&self) -> () { use core::ops::Not; @@ -193,6 +213,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06empty3\0\0\0\0\0\0\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_EMPTY3: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xa8\xe0#\xee\x83;y\n\x92:j8u@\x83\xab1Y\"qCq>\xb8\x9ep\xeb\x81eVx\x12", + [], + ); impl<'a> ContractClient<'a> { pub fn empty3(&self) -> () { use core::ops::Not; diff --git a/tests-expanded/test_mutability_tests.rs b/tests-expanded/test_mutability_tests.rs index 5cfe71b3f..714c0bb13 100644 --- a/tests-expanded/test_mutability_tests.rs +++ b/tests-expanded/test_mutability_tests.rs @@ -156,6 +156,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x04calc\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x04\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x04\0\0\0\x01\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_CALC: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xfe\xc0\xa1\x08H>\x93E\xab{\x15{\x12c\xcf\x11\xf4'\xa9\x8du\xdc\x9c\xd1Q.\x0e\xc1\x19ov\x12", + [], +); impl<'a> ContractClient<'a> { pub fn calc(&self, a: &u32, b: &u32) -> u32 { use core::ops::Not; diff --git a/tests-expanded/test_mutability_wasm32v1-none.rs b/tests-expanded/test_mutability_wasm32v1-none.rs index cccd536ef..6184029aa 100644 --- a/tests-expanded/test_mutability_wasm32v1-none.rs +++ b/tests-expanded/test_mutability_wasm32v1-none.rs @@ -45,6 +45,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x04calc\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x04\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x04\0\0\0\x01\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_CALC: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xfe\xc0\xa1\x08H>\x93E\xab{\x15{\x12c\xcf\x11\xf4'\xa9\x8du\xdc\x9c\xd1Q.\x0e\xc1\x19ov\x12", + [], +); impl<'a> ContractClient<'a> { pub fn calc(&self, a: &u32, b: &u32) -> u32 { use core::ops::Not; diff --git a/tests-expanded/test_spec_shaking_v1_tests.rs b/tests-expanded/test_spec_shaking_v1_tests.rs index 9f46100fe..612b1d260 100644 --- a/tests-expanded/test_spec_shaking_v1_tests.rs +++ b/tests-expanded/test_spec_shaking_v1_tests.rs @@ -5,8 +5,8 @@ extern crate core; #[prelude_import] use core::prelude::rust_2021::*; use soroban_sdk::{ - assert_with_error, contract, contracterror, contractevent, contractimpl, contracttype, - panic_with_error, Env, Map, Symbol, Vec, + assert_with_error, auth::CustomAccountInterface, contract, contracterror, contractevent, + contractimpl, contracttype, crypto::Hash, panic_with_error, Env, Map, Symbol, Vec, }; pub struct Contract; ///ContractArgs is a type for building arg lists for functions defined in "Contract". @@ -559,296 +559,219 @@ const _: () = { } } }; -pub enum UsedReturnEnum { - A(u32), - B(i64), +pub struct UsedConstructorMeta { + pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedReturnEnum { +impl ::core::clone::Clone for UsedConstructorMeta { #[inline] - fn clone(&self) -> UsedReturnEnum { - match self { - UsedReturnEnum::A(__self_0) => UsedReturnEnum::A(::core::clone::Clone::clone(__self_0)), - UsedReturnEnum::B(__self_0) => UsedReturnEnum::B(::core::clone::Clone::clone(__self_0)), + fn clone(&self) -> UsedConstructorMeta { + UsedConstructorMeta { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedReturnEnum { +impl ::core::fmt::Debug for UsedConstructorMeta { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - match self { - UsedReturnEnum::A(__self_0) => { - ::core::fmt::Formatter::debug_tuple_field1_finish(f, "A", &__self_0) - } - UsedReturnEnum::B(__self_0) => { - ::core::fmt::Formatter::debug_tuple_field1_finish(f, "B", &__self_0) - } - } + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedConstructorMeta", + "val", + &&self.val, + ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedReturnEnum { +impl ::core::cmp::Eq for UsedConstructorMeta { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedReturnEnum {} +impl ::core::marker::StructuralPartialEq for UsedConstructorMeta {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedReturnEnum { +impl ::core::cmp::PartialEq for UsedConstructorMeta { #[inline] - fn eq(&self, other: &UsedReturnEnum) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr - && match (self, other) { - (UsedReturnEnum::A(__self_0), UsedReturnEnum::A(__arg1_0)) => __self_0 == __arg1_0, - (UsedReturnEnum::B(__self_0), UsedReturnEnum::B(__arg1_0)) => __self_0 == __arg1_0, - _ => unsafe { ::core::intrinsics::unreachable() }, - } + fn eq(&self, other: &UsedConstructorMeta) -> bool { + self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDRETURNENUM: [u8; 84usize] = UsedReturnEnum::spec_xdr(); -impl UsedReturnEnum { - pub const fn spec_xdr() -> [u8; 84usize] { - *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x0eUsedReturnEnum\0\0\0\0\0\x02\0\0\0\x01\0\0\0\0\0\0\0\x01A\0\0\0\0\0\0\x01\0\0\0\x04\0\0\0\x01\0\0\0\0\0\0\0\x01B\0\0\0\0\0\0\x01\0\0\0\x07" +pub static __SPEC_XDR_TYPE_USEDCONSTRUCTORMETA: [u8; 56usize] = UsedConstructorMeta::spec_xdr(); +impl UsedConstructorMeta { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedConstructorMeta\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::TryFromVal for UsedReturnEnum { +impl soroban_sdk::TryFromVal for UsedConstructorMeta { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; - const CASES: &'static [&'static str] = &["A", "B"]; - let vec: soroban_sdk::Vec = val.try_into_val(env)?; - let mut iter = vec.try_iter(); - let discriminant: soroban_sdk::Symbol = iter - .next() - .ok_or(soroban_sdk::ConversionError)?? - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?; - Ok( - match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) as usize - { - 0 => { - if iter.len() > 1usize { - return Err(soroban_sdk::ConversionError); - } - Self::A( - iter.next() - .ok_or(soroban_sdk::ConversionError)?? - .try_into_val(env)?, - ) - } - 1 => { - if iter.len() > 1usize { - return Err(soroban_sdk::ConversionError); - } - Self::B( - iter.next() - .ok_or(soroban_sdk::ConversionError)?? - .try_into_val(env)?, - ) - } - _ => Err(soroban_sdk::ConversionError {})?, - }, - ) + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedReturnEnum, + val: &UsedConstructorMeta, ) -> Result { - use soroban_sdk::{TryFromVal, TryIntoVal}; - match val { - UsedReturnEnum::A(ref value0) => { - let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( - soroban_sdk::Symbol::try_from_val(env, &"A")?.to_val(), - value0.try_into_val(env)?, - ); - tup.try_into_val(env).map_err(Into::into) - } - UsedReturnEnum::B(ref value0) => { - let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( - soroban_sdk::Symbol::try_from_val(env, &"B")?.to_val(), - value0.try_into_val(env)?, - ); - tup.try_into_val(env).map_err(Into::into) - } - } + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedReturnEnum, + val: &&UsedConstructorMeta, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) } } -impl soroban_sdk::TryFromVal for UsedReturnEnum { +impl soroban_sdk::TryFromVal for UsedConstructorMeta { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &soroban_sdk::xdr::ScVec, + val: &soroban_sdk::xdr::ScMap, ) -> Result { use soroban_sdk::xdr::Validate; use soroban_sdk::TryIntoVal; - let vec = val; - let mut iter = vec.iter(); - let discriminant: soroban_sdk::xdr::ScSymbol = iter - .next() - .ok_or(soroban_sdk::xdr::Error::Invalid)? - .clone() - .try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; - let discriminant_name: &str = &discriminant.to_utf8_string()?; - Ok(match discriminant_name { - "A" => { - if iter.len() > 1usize { - return Err(soroban_sdk::xdr::Error::Invalid); - } - let rv0: soroban_sdk::Val = iter - .next() - .ok_or(soroban_sdk::xdr::Error::Invalid)? - .try_into_val(env) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; - Self::A( - rv0.try_into_val(env) + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + val: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "val" + .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) - } - "B" => { - if iter.len() > 1usize { - return Err(soroban_sdk::xdr::Error::Invalid); - } - let rv0: soroban_sdk::Val = iter - .next() - .ok_or(soroban_sdk::xdr::Error::Invalid)? + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) .try_into_val(env) .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; - Self::B( - rv0.try_into_val(env) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - ) - } - _ => Err(soroban_sdk::xdr::Error::Invalid)?, + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, }) } } -impl soroban_sdk::TryFromVal for UsedReturnEnum { +impl soroban_sdk::TryFromVal for UsedConstructorMeta { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::xdr::ScVal, ) -> Result { - if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { - <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) } else { Err(soroban_sdk::xdr::Error::Invalid) } } } -impl TryFrom<&UsedReturnEnum> for soroban_sdk::xdr::ScVec { +impl TryFrom<&UsedConstructorMeta> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedReturnEnum) -> Result { + fn try_from(val: &UsedConstructorMeta) -> Result { extern crate alloc; - Ok(match val { - UsedReturnEnum::A(value0) => ( - soroban_sdk::xdr::ScSymbol( - "A".try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - ), - value0, - ) - .try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - UsedReturnEnum::B(value0) => ( - soroban_sdk::xdr::ScSymbol( - "B".try_into() + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "val" + .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - ), - value0, - ) - .try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - }) + ) + .into(), + val: (&val.val) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) } } -impl TryFrom for soroban_sdk::xdr::ScVec { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedReturnEnum) -> Result { + fn try_from(val: UsedConstructorMeta) -> Result { (&val).try_into() } } -impl TryFrom<&UsedReturnEnum> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedConstructorMeta> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedReturnEnum) -> Result { - Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + fn try_from(val: &UsedConstructorMeta) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedReturnEnum) -> Result { + fn try_from(val: UsedConstructorMeta) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub enum ArbitraryUsedReturnEnum { - A(::Prototype), - B(::Prototype), + pub struct ArbitraryUsedConstructorMeta { + val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedReturnEnum { + impl ::core::fmt::Debug for ArbitraryUsedConstructorMeta { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - match self { - ArbitraryUsedReturnEnum::A(__self_0) => { - ::core::fmt::Formatter::debug_tuple_field1_finish(f, "A", &__self_0) - } - ArbitraryUsedReturnEnum::B(__self_0) => { - ::core::fmt::Formatter::debug_tuple_field1_finish(f, "B", &__self_0) - } - } + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "ArbitraryUsedConstructorMeta", + "val", + &&self.val, + ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedReturnEnum { + impl ::core::clone::Clone for ArbitraryUsedConstructorMeta { #[inline] - fn clone(&self) -> ArbitraryUsedReturnEnum { - match self { - ArbitraryUsedReturnEnum::A(__self_0) => { - ArbitraryUsedReturnEnum::A(::core::clone::Clone::clone(__self_0)) - } - ArbitraryUsedReturnEnum::B(__self_0) => { - ArbitraryUsedReturnEnum::B(::core::clone::Clone::clone(__self_0)) - } + fn clone(&self) -> ArbitraryUsedConstructorMeta { + ArbitraryUsedConstructorMeta { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedReturnEnum { + impl ::core::cmp::Eq for ArbitraryUsedConstructorMeta { #[inline] #[doc(hidden)] #[coverage(off)] @@ -856,78 +779,37 @@ const _: () = { let _: ::core::cmp::AssertParamIsEq< ::Prototype, >; - let _: ::core::cmp::AssertParamIsEq< - ::Prototype, - >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedReturnEnum {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedConstructorMeta {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedReturnEnum { + impl ::core::cmp::PartialEq for ArbitraryUsedConstructorMeta { #[inline] - fn eq(&self, other: &ArbitraryUsedReturnEnum) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr - && match (self, other) { - ( - ArbitraryUsedReturnEnum::A(__self_0), - ArbitraryUsedReturnEnum::A(__arg1_0), - ) => __self_0 == __arg1_0, - ( - ArbitraryUsedReturnEnum::B(__self_0), - ArbitraryUsedReturnEnum::B(__arg1_0), - ) => __self_0 == __arg1_0, - _ => unsafe { ::core::intrinsics::unreachable() }, - } + fn eq(&self, other: &ArbitraryUsedConstructorMeta) -> bool { + self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedReturnEnum { + impl ::core::cmp::Ord for ArbitraryUsedConstructorMeta { #[inline] - fn cmp(&self, other: &ArbitraryUsedReturnEnum) -> ::core::cmp::Ordering { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { - ::core::cmp::Ordering::Equal => match (self, other) { - ( - ArbitraryUsedReturnEnum::A(__self_0), - ArbitraryUsedReturnEnum::A(__arg1_0), - ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), - ( - ArbitraryUsedReturnEnum::B(__self_0), - ArbitraryUsedReturnEnum::B(__arg1_0), - ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), - _ => unsafe { ::core::intrinsics::unreachable() }, - }, - cmp => cmp, - } + fn cmp(&self, other: &ArbitraryUsedConstructorMeta) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedReturnEnum { + impl ::core::cmp::PartialOrd for ArbitraryUsedConstructorMeta { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedReturnEnum, + other: &ArbitraryUsedConstructorMeta, ) -> ::core::option::Option<::core::cmp::Ordering> { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - match (self, other) { - (ArbitraryUsedReturnEnum::A(__self_0), ArbitraryUsedReturnEnum::A(__arg1_0)) => { - ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) - } - (ArbitraryUsedReturnEnum::B(__self_0), ArbitraryUsedReturnEnum::B(__arg1_0)) => { - ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) - } - _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), - } + ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedReturnEnum: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedConstructorMeta: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -961,11 +843,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedReturnEnum { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedConstructorMeta { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedReturnEnum.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedConstructorMeta.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -974,19 +856,12 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(u)?) * 2u64) >> 32 - { - 0u64 => ArbitraryUsedReturnEnum::A(arbitrary::Arbitrary::arbitrary(u)?), - 1u64 => ArbitraryUsedReturnEnum::B(arbitrary::Arbitrary::arbitrary(u)?), - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryUsedConstructorMeta { + val: arbitrary::Arbitrary::arbitrary(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedReturnEnum.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedConstructorMeta.with(|count| { count.set(count.get() - 1); }); } @@ -997,7 +872,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedReturnEnum.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedConstructorMeta.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -1006,24 +881,12 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(&mut u)?) * 2u64) - >> 32 - { - 0u64 => ArbitraryUsedReturnEnum::A( - arbitrary::Arbitrary::arbitrary_take_rest(u)?, - ), - 1u64 => ArbitraryUsedReturnEnum::B( - arbitrary::Arbitrary::arbitrary_take_rest(u)?, - ), - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryUsedConstructorMeta { + val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedReturnEnum.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedConstructorMeta.with(|count| { count.set(count.get() - 1); }); } @@ -1031,253 +894,279 @@ const _: () = { } #[inline] fn size_hint(depth: usize) -> (usize, Option) { - arbitrary::size_hint::and( - ::size_hint(depth), - arbitrary::size_hint::recursion_guard(depth, |depth| { - arbitrary::size_hint::or_all( - &[ - arbitrary::size_hint::and_all( - &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( - depth, - ), - ], - ), - arbitrary::size_hint::and_all( - &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( - depth, - ), - ], - ), - ], - ) - }), - ) + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedReturnEnum { - type Prototype = ArbitraryUsedReturnEnum; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedConstructorMeta { + type Prototype = ArbitraryUsedConstructorMeta; } - impl soroban_sdk::TryFromVal for UsedReturnEnum { + impl soroban_sdk::TryFromVal + for UsedConstructorMeta + { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedReturnEnum, + v: &ArbitraryUsedConstructorMeta, ) -> std::result::Result { - Ok(match v { - ArbitraryUsedReturnEnum::A(field_0) => { - UsedReturnEnum::A(soroban_sdk::IntoVal::into_val(field_0, env)) - } - ArbitraryUsedReturnEnum::B(field_0) => { - UsedReturnEnum::B(soroban_sdk::IntoVal::into_val(field_0, env)) - } + Ok(UsedConstructorMeta { + val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -pub enum UsedParamIntEnum { - X = 1, - Y = 2, +pub struct Context { + pub val: u32, } #[automatically_derived] -impl ::core::marker::Copy for UsedParamIntEnum {} -#[automatically_derived] -impl ::core::clone::Clone for UsedParamIntEnum { +impl ::core::clone::Clone for Context { #[inline] - fn clone(&self) -> UsedParamIntEnum { - *self + fn clone(&self) -> Context { + Context { + val: ::core::clone::Clone::clone(&self.val), + } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedParamIntEnum { +impl ::core::fmt::Debug for Context { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( - f, - match self { - UsedParamIntEnum::X => "X", - UsedParamIntEnum::Y => "Y", - }, - ) + ::core::fmt::Formatter::debug_struct_field1_finish(f, "Context", "val", &&self.val) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedParamIntEnum { +impl ::core::cmp::Eq for Context { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedParamIntEnum {} +impl ::core::marker::StructuralPartialEq for Context {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedParamIntEnum { +impl ::core::cmp::PartialEq for Context { #[inline] - fn eq(&self, other: &UsedParamIntEnum) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr + fn eq(&self, other: &Context) -> bool { + self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDPARAMINTENUM: [u8; 68usize] = UsedParamIntEnum::spec_xdr(); -impl UsedParamIntEnum { - pub const fn spec_xdr() -> [u8; 68usize] { - *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x10UsedParamIntEnum\0\0\0\x02\0\0\0\0\0\0\0\x01X\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01Y\0\0\0\0\0\0\x02" +pub static __SPEC_XDR_TYPE_CONTEXT: [u8; 44usize] = Context::spec_xdr(); +impl Context { + pub const fn spec_xdr() -> [u8; 44usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x07Context\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::TryFromVal for UsedParamIntEnum { +impl soroban_sdk::TryFromVal for Context { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::TryIntoVal; - let discriminant: u32 = val.try_into_val(env)?; - Ok(match discriminant { - 1u32 => Self::X, - 2u32 => Self::Y, - _ => Err(soroban_sdk::ConversionError {})?, + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedParamIntEnum, + val: &Context, ) -> Result { - Ok(match val { - UsedParamIntEnum::X => 1u32.into(), - UsedParamIntEnum::Y => 2u32.into(), - }) + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedParamIntEnum, + val: &&Context, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedParamIntEnum { +impl soroban_sdk::TryFromVal for Context { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &soroban_sdk::xdr::ScVal, + val: &soroban_sdk::xdr::ScMap, ) -> Result { - if let soroban_sdk::xdr::ScVal::U32(discriminant) = val { - Ok(match *discriminant { - 1u32 => Self::X, - 2u32 => Self::Y, - _ => Err(soroban_sdk::xdr::Error::Invalid)?, - }) - } else { - Err(soroban_sdk::xdr::Error::Invalid) + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); } + map.validate()?; + Ok(Self { + val: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "val" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) } } -impl TryInto for &UsedParamIntEnum { +impl soroban_sdk::TryFromVal for Context { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_into(self) -> Result { - Ok(match self { - UsedParamIntEnum::X => 1u32.into(), - UsedParamIntEnum::Y => 2u32.into(), - }) + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } } } -impl TryInto for UsedParamIntEnum { +impl TryFrom<&Context> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_into(self) -> Result { - Ok(match self { - UsedParamIntEnum::X => 1u32.into(), - UsedParamIntEnum::Y => 2u32.into(), - }) + fn try_from(val: &Context) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "val" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.val) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } +} +impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Context) -> Result { + (&val).try_into() + } +} +impl TryFrom<&Context> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &Context) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Context) -> Result { + (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub enum ArbitraryUsedParamIntEnum { - X, - Y, + pub struct ArbitraryContext { + val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedParamIntEnum { + impl ::core::fmt::Debug for ArbitraryContext { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( + ::core::fmt::Formatter::debug_struct_field1_finish( f, - match self { - ArbitraryUsedParamIntEnum::X => "X", - ArbitraryUsedParamIntEnum::Y => "Y", - }, + "ArbitraryContext", + "val", + &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedParamIntEnum { + impl ::core::clone::Clone for ArbitraryContext { #[inline] - fn clone(&self) -> ArbitraryUsedParamIntEnum { - match self { - ArbitraryUsedParamIntEnum::X => ArbitraryUsedParamIntEnum::X, - ArbitraryUsedParamIntEnum::Y => ArbitraryUsedParamIntEnum::Y, + fn clone(&self) -> ArbitraryContext { + ArbitraryContext { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedParamIntEnum { + impl ::core::cmp::Eq for ArbitraryContext { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedParamIntEnum {} + impl ::core::marker::StructuralPartialEq for ArbitraryContext {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedParamIntEnum { + impl ::core::cmp::PartialEq for ArbitraryContext { #[inline] - fn eq(&self, other: &ArbitraryUsedParamIntEnum) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr + fn eq(&self, other: &ArbitraryContext) -> bool { + self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedParamIntEnum { + impl ::core::cmp::Ord for ArbitraryContext { #[inline] - fn cmp(&self, other: &ArbitraryUsedParamIntEnum) -> ::core::cmp::Ordering { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) + fn cmp(&self, other: &ArbitraryContext) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedParamIntEnum { + impl ::core::cmp::PartialOrd for ArbitraryContext { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedParamIntEnum, + other: &ArbitraryContext, ) -> ::core::option::Option<::core::cmp::Ordering> { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr) + ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedParamIntEnum: ::std::thread::LocalKey< - std::cell::Cell, - > = { + const RECURSIVE_COUNT_ArbitraryContext: ::std::thread::LocalKey> = { #[inline] fn __init() -> std::cell::Cell { std::cell::Cell::new(0) @@ -1309,11 +1198,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedParamIntEnum { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryContext { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedParamIntEnum.with(|count| { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -1322,19 +1211,12 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(u)?) * 2u64) >> 32 - { - 0u64 => ArbitraryUsedParamIntEnum::X, - 1u64 => ArbitraryUsedParamIntEnum::Y, - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryContext { + val: arbitrary::Arbitrary::arbitrary(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedParamIntEnum.with(|count| { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { count.set(count.get() - 1); }); } @@ -1345,7 +1227,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedParamIntEnum.with(|count| { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -1354,20 +1236,12 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(&mut u)?) * 2u64) - >> 32 - { - 0u64 => ArbitraryUsedParamIntEnum::X, - 1u64 => ArbitraryUsedParamIntEnum::Y, - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryContext { + val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedParamIntEnum.with(|count| { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { count.set(count.get() - 1); }); } @@ -1375,303 +1249,4223 @@ const _: () = { } #[inline] fn size_hint(depth: usize) -> (usize, Option) { - arbitrary::size_hint::and( - ::size_hint(depth), - arbitrary::size_hint::recursion_guard(depth, |depth| { - arbitrary::size_hint::or_all(&[ - arbitrary::size_hint::and_all(&[]), - arbitrary::size_hint::and_all(&[]), - ]) - }), - ) + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedParamIntEnum { - type Prototype = ArbitraryUsedParamIntEnum; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for Context { + type Prototype = ArbitraryContext; } - impl soroban_sdk::TryFromVal for UsedParamIntEnum { + impl soroban_sdk::TryFromVal for Context { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedParamIntEnum, + v: &ArbitraryContext, ) -> std::result::Result { - Ok(match v { - ArbitraryUsedParamIntEnum::X => UsedParamIntEnum::X, - ArbitraryUsedParamIntEnum::Y => UsedParamIntEnum::Y, + Ok(Context { + val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -pub enum UsedErrorEnum { - NotFound = 1, - Invalid = 2, +pub enum UsedReturnEnum { + A(u32), + B(i64), } #[automatically_derived] -impl ::core::marker::Copy for UsedErrorEnum {} -#[automatically_derived] -impl ::core::clone::Clone for UsedErrorEnum { +impl ::core::clone::Clone for UsedReturnEnum { #[inline] - fn clone(&self) -> UsedErrorEnum { - *self + fn clone(&self) -> UsedReturnEnum { + match self { + UsedReturnEnum::A(__self_0) => UsedReturnEnum::A(::core::clone::Clone::clone(__self_0)), + UsedReturnEnum::B(__self_0) => UsedReturnEnum::B(::core::clone::Clone::clone(__self_0)), + } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedErrorEnum { +impl ::core::fmt::Debug for UsedReturnEnum { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( - f, - match self { - UsedErrorEnum::NotFound => "NotFound", - UsedErrorEnum::Invalid => "Invalid", - }, - ) + match self { + UsedReturnEnum::A(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "A", &__self_0) + } + UsedReturnEnum::B(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "B", &__self_0) + } + } } } #[automatically_derived] -impl ::core::cmp::Eq for UsedErrorEnum { +impl ::core::cmp::Eq for UsedReturnEnum { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedErrorEnum {} +impl ::core::marker::StructuralPartialEq for UsedReturnEnum {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedErrorEnum { +impl ::core::cmp::PartialEq for UsedReturnEnum { #[inline] - fn eq(&self, other: &UsedErrorEnum) -> bool { + fn eq(&self, other: &UsedReturnEnum) -> bool { let __self_discr = ::core::intrinsics::discriminant_value(self); let __arg1_discr = ::core::intrinsics::discriminant_value(other); __self_discr == __arg1_discr + && match (self, other) { + (UsedReturnEnum::A(__self_0), UsedReturnEnum::A(__arg1_0)) => __self_0 == __arg1_0, + (UsedReturnEnum::B(__self_0), UsedReturnEnum::B(__arg1_0)) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } } } -pub static __SPEC_XDR_TYPE_USEDERRORENUM: [u8; 76usize] = UsedErrorEnum::spec_xdr(); -impl UsedErrorEnum { - pub const fn spec_xdr() -> [u8; 76usize] { - *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\rUsedErrorEnum\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x08NotFound\0\0\0\x01\0\0\0\0\0\0\0\x07Invalid\0\0\0\0\x02" +pub static __SPEC_XDR_TYPE_USEDRETURNENUM: [u8; 84usize] = UsedReturnEnum::spec_xdr(); +impl UsedReturnEnum { + pub const fn spec_xdr() -> [u8; 84usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x0eUsedReturnEnum\0\0\0\0\0\x02\0\0\0\x01\0\0\0\0\0\0\0\x01A\0\0\0\0\0\0\x01\0\0\0\x04\0\0\0\x01\0\0\0\0\0\0\0\x01B\0\0\0\0\0\0\x01\0\0\0\x07" } } -impl TryFrom for UsedErrorEnum { - type Error = soroban_sdk::Error; +impl soroban_sdk::TryFromVal for UsedReturnEnum { + type Error = soroban_sdk::ConversionError; #[inline(always)] - fn try_from(error: soroban_sdk::Error) -> Result { - if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { - let discriminant = error.get_code(); - Ok(match discriminant { - 1u32 => Self::NotFound, - 2u32 => Self::Invalid, - _ => return Err(error), - }) - } else { - Err(error) - } + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["A", "B"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::A( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::B( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) } } -impl TryFrom<&soroban_sdk::Error> for UsedErrorEnum { - type Error = soroban_sdk::Error; +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; #[inline(always)] - fn try_from(error: &soroban_sdk::Error) -> Result { - <_ as TryFrom>::try_from(*error) - } -} -impl From for soroban_sdk::Error { - #[inline(always)] - fn from(val: UsedErrorEnum) -> soroban_sdk::Error { - <_ as From<&UsedErrorEnum>>::from(&val) - } -} -impl From<&UsedErrorEnum> for soroban_sdk::Error { - #[inline(always)] - fn from(val: &UsedErrorEnum) -> soroban_sdk::Error { - match val { - UsedErrorEnum::NotFound => soroban_sdk::Error::from_contract_error(1u32), - UsedErrorEnum::Invalid => soroban_sdk::Error::from_contract_error(2u32), - } - } -} -impl TryFrom for UsedErrorEnum { - type Error = soroban_sdk::InvokeError; - #[inline(always)] - fn try_from(error: soroban_sdk::InvokeError) -> Result { - match error { - soroban_sdk::InvokeError::Abort => Err(error), - soroban_sdk::InvokeError::Contract(code) => Ok(match code { - 1u32 => Self::NotFound, - 2u32 => Self::Invalid, - _ => return Err(error), - }), - } - } -} -impl TryFrom<&soroban_sdk::InvokeError> for UsedErrorEnum { - type Error = soroban_sdk::InvokeError; - #[inline(always)] - fn try_from(error: &soroban_sdk::InvokeError) -> Result { - <_ as TryFrom>::try_from(*error) - } -} -impl From for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: UsedErrorEnum) -> soroban_sdk::InvokeError { - <_ as From<&UsedErrorEnum>>::from(&val) - } -} -impl From<&UsedErrorEnum> for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: &UsedErrorEnum) -> soroban_sdk::InvokeError { + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedReturnEnum, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; match val { - UsedErrorEnum::NotFound => soroban_sdk::InvokeError::Contract(1u32), - UsedErrorEnum::Invalid => soroban_sdk::InvokeError::Contract(2u32), + UsedReturnEnum::A(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"A")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + UsedReturnEnum::B(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"B")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } } } } -impl soroban_sdk::TryFromVal for UsedErrorEnum { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &soroban_sdk::Val, + val: &&UsedReturnEnum, ) -> Result { - use soroban_sdk::TryIntoVal; - let error: soroban_sdk::Error = val.try_into_val(env)?; - error.try_into().map_err(|_| soroban_sdk::ConversionError) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; +impl soroban_sdk::TryFromVal for UsedReturnEnum { + type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedErrorEnum, - ) -> Result { - let error: soroban_sdk::Error = val.into(); - Ok(error.into()) + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "A" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::A( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "B" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::B( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; +impl soroban_sdk::TryFromVal for UsedReturnEnum { + type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedErrorEnum, - ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) - } -} -pub enum UsedPanicErrorEnum { - Boom = 1, -} -#[automatically_derived] -impl ::core::marker::Copy for UsedPanicErrorEnum {} -#[automatically_derived] -impl ::core::clone::Clone for UsedPanicErrorEnum { - #[inline] - fn clone(&self) -> UsedPanicErrorEnum { - *self - } -} -#[automatically_derived] -impl ::core::fmt::Debug for UsedPanicErrorEnum { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str(f, "Boom") - } -} -#[automatically_derived] -impl ::core::cmp::Eq for UsedPanicErrorEnum { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} -} -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedPanicErrorEnum {} -#[automatically_derived] -impl ::core::cmp::PartialEq for UsedPanicErrorEnum { - #[inline] - fn eq(&self, other: &UsedPanicErrorEnum) -> bool { - true - } -} -pub static __SPEC_XDR_TYPE_USEDPANICERRORENUM: [u8; 56usize] = UsedPanicErrorEnum::spec_xdr(); -impl UsedPanicErrorEnum { - pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x12UsedPanicErrorEnum\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04Boom\0\0\0\x01" - } -} -impl TryFrom for UsedPanicErrorEnum { - type Error = soroban_sdk::Error; - #[inline(always)] - fn try_from(error: soroban_sdk::Error) -> Result { - if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { - let discriminant = error.get_code(); - Ok(match discriminant { - 1u32 => Self::Boom, - _ => return Err(error), - }) + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) } else { - Err(error) + Err(soroban_sdk::xdr::Error::Invalid) } } } -impl TryFrom<&soroban_sdk::Error> for UsedPanicErrorEnum { - type Error = soroban_sdk::Error; +impl TryFrom<&UsedReturnEnum> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(error: &soroban_sdk::Error) -> Result { - <_ as TryFrom>::try_from(*error) + fn try_from(val: &UsedReturnEnum) -> Result { + extern crate alloc; + Ok(match val { + UsedReturnEnum::A(value0) => ( + soroban_sdk::xdr::ScSymbol( + "A".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + UsedReturnEnum::B(value0) => ( + soroban_sdk::xdr::ScSymbol( + "B".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }) } } -impl From for soroban_sdk::Error { +impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn from(val: UsedPanicErrorEnum) -> soroban_sdk::Error { - <_ as From<&UsedPanicErrorEnum>>::from(&val) + fn try_from(val: UsedReturnEnum) -> Result { + (&val).try_into() } } -impl From<&UsedPanicErrorEnum> for soroban_sdk::Error { +impl TryFrom<&UsedReturnEnum> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn from(val: &UsedPanicErrorEnum) -> soroban_sdk::Error { - match val { - UsedPanicErrorEnum::Boom => soroban_sdk::Error::from_contract_error(1u32), - } + fn try_from(val: &UsedReturnEnum) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) } } -impl TryFrom for UsedPanicErrorEnum { - type Error = soroban_sdk::InvokeError; +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(error: soroban_sdk::InvokeError) -> Result { - match error { - soroban_sdk::InvokeError::Abort => Err(error), - soroban_sdk::InvokeError::Contract(code) => Ok(match code { - 1u32 => Self::Boom, - _ => return Err(error), - }), - } + fn try_from(val: UsedReturnEnum) -> Result { + (&val).try_into() } } -impl TryFrom<&soroban_sdk::InvokeError> for UsedPanicErrorEnum { - type Error = soroban_sdk::InvokeError; - #[inline(always)] +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryUsedReturnEnum { + A(::Prototype), + B(::Prototype), + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUsedReturnEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryUsedReturnEnum::A(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "A", &__self_0) + } + ArbitraryUsedReturnEnum::B(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "B", &__self_0) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUsedReturnEnum { + #[inline] + fn clone(&self) -> ArbitraryUsedReturnEnum { + match self { + ArbitraryUsedReturnEnum::A(__self_0) => { + ArbitraryUsedReturnEnum::A(::core::clone::Clone::clone(__self_0)) + } + ArbitraryUsedReturnEnum::B(__self_0) => { + ArbitraryUsedReturnEnum::B(::core::clone::Clone::clone(__self_0)) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUsedReturnEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUsedReturnEnum {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUsedReturnEnum { + #[inline] + fn eq(&self, other: &ArbitraryUsedReturnEnum) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + ArbitraryUsedReturnEnum::A(__self_0), + ArbitraryUsedReturnEnum::A(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryUsedReturnEnum::B(__self_0), + ArbitraryUsedReturnEnum::B(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUsedReturnEnum { + #[inline] + fn cmp(&self, other: &ArbitraryUsedReturnEnum) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + ArbitraryUsedReturnEnum::A(__self_0), + ArbitraryUsedReturnEnum::A(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryUsedReturnEnum::B(__self_0), + ArbitraryUsedReturnEnum::B(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUsedReturnEnum { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUsedReturnEnum, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + (ArbitraryUsedReturnEnum::A(__self_0), ArbitraryUsedReturnEnum::A(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + (ArbitraryUsedReturnEnum::B(__self_0), ArbitraryUsedReturnEnum::B(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUsedReturnEnum: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedReturnEnum { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedReturnEnum.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) * 2u64) >> 32 + { + 0u64 => ArbitraryUsedReturnEnum::A(arbitrary::Arbitrary::arbitrary(u)?), + 1u64 => ArbitraryUsedReturnEnum::B(arbitrary::Arbitrary::arbitrary(u)?), + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedReturnEnum.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedReturnEnum.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) * 2u64) + >> 32 + { + 0u64 => ArbitraryUsedReturnEnum::A( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 1u64 => ArbitraryUsedReturnEnum::B( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedReturnEnum.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedReturnEnum { + type Prototype = ArbitraryUsedReturnEnum; + } + impl soroban_sdk::TryFromVal for UsedReturnEnum { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedReturnEnum, + ) -> std::result::Result { + Ok(match v { + ArbitraryUsedReturnEnum::A(field_0) => { + UsedReturnEnum::A(soroban_sdk::IntoVal::into_val(field_0, env)) + } + ArbitraryUsedReturnEnum::B(field_0) => { + UsedReturnEnum::B(soroban_sdk::IntoVal::into_val(field_0, env)) + } + }) + } + } +}; +pub enum UsedParamIntEnum { + X = 1, + Y = 2, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedParamIntEnum {} +#[automatically_derived] +impl ::core::clone::Clone for UsedParamIntEnum { + #[inline] + fn clone(&self) -> UsedParamIntEnum { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedParamIntEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + UsedParamIntEnum::X => "X", + UsedParamIntEnum::Y => "Y", + }, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedParamIntEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedParamIntEnum {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedParamIntEnum { + #[inline] + fn eq(&self, other: &UsedParamIntEnum) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } +} +pub static __SPEC_XDR_TYPE_USEDPARAMINTENUM: [u8; 68usize] = UsedParamIntEnum::spec_xdr(); +impl UsedParamIntEnum { + pub const fn spec_xdr() -> [u8; 68usize] { + *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x10UsedParamIntEnum\0\0\0\x02\0\0\0\0\0\0\0\x01X\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01Y\0\0\0\0\0\0\x02" + } +} +impl soroban_sdk::TryFromVal for UsedParamIntEnum { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let discriminant: u32 = val.try_into_val(env)?; + Ok(match discriminant { + 1u32 => Self::X, + 2u32 => Self::Y, + _ => Err(soroban_sdk::ConversionError {})?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedParamIntEnum, + ) -> Result { + Ok(match val { + UsedParamIntEnum::X => 1u32.into(), + UsedParamIntEnum::Y => 2u32.into(), + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedParamIntEnum, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +impl soroban_sdk::TryFromVal for UsedParamIntEnum { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::U32(discriminant) = val { + Ok(match *discriminant { + 1u32 => Self::X, + 2u32 => Self::Y, + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryInto for &UsedParamIntEnum { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_into(self) -> Result { + Ok(match self { + UsedParamIntEnum::X => 1u32.into(), + UsedParamIntEnum::Y => 2u32.into(), + }) + } +} +impl TryInto for UsedParamIntEnum { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_into(self) -> Result { + Ok(match self { + UsedParamIntEnum::X => 1u32.into(), + UsedParamIntEnum::Y => 2u32.into(), + }) + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryUsedParamIntEnum { + X, + Y, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUsedParamIntEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + ArbitraryUsedParamIntEnum::X => "X", + ArbitraryUsedParamIntEnum::Y => "Y", + }, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUsedParamIntEnum { + #[inline] + fn clone(&self) -> ArbitraryUsedParamIntEnum { + match self { + ArbitraryUsedParamIntEnum::X => ArbitraryUsedParamIntEnum::X, + ArbitraryUsedParamIntEnum::Y => ArbitraryUsedParamIntEnum::Y, + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUsedParamIntEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUsedParamIntEnum {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUsedParamIntEnum { + #[inline] + fn eq(&self, other: &ArbitraryUsedParamIntEnum) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUsedParamIntEnum { + #[inline] + fn cmp(&self, other: &ArbitraryUsedParamIntEnum) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUsedParamIntEnum { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUsedParamIntEnum, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr) + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUsedParamIntEnum: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedParamIntEnum { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedParamIntEnum.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) * 2u64) >> 32 + { + 0u64 => ArbitraryUsedParamIntEnum::X, + 1u64 => ArbitraryUsedParamIntEnum::Y, + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedParamIntEnum.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedParamIntEnum.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) * 2u64) + >> 32 + { + 0u64 => ArbitraryUsedParamIntEnum::X, + 1u64 => ArbitraryUsedParamIntEnum::Y, + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedParamIntEnum.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all(&[ + arbitrary::size_hint::and_all(&[]), + arbitrary::size_hint::and_all(&[]), + ]) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedParamIntEnum { + type Prototype = ArbitraryUsedParamIntEnum; + } + impl soroban_sdk::TryFromVal for UsedParamIntEnum { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedParamIntEnum, + ) -> std::result::Result { + Ok(match v { + ArbitraryUsedParamIntEnum::X => UsedParamIntEnum::X, + ArbitraryUsedParamIntEnum::Y => UsedParamIntEnum::Y, + }) + } + } +}; +pub enum UsedErrorEnum { + NotFound = 1, + Invalid = 2, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedErrorEnum {} +#[automatically_derived] +impl ::core::clone::Clone for UsedErrorEnum { + #[inline] + fn clone(&self) -> UsedErrorEnum { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedErrorEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + UsedErrorEnum::NotFound => "NotFound", + UsedErrorEnum::Invalid => "Invalid", + }, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedErrorEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedErrorEnum {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedErrorEnum { + #[inline] + fn eq(&self, other: &UsedErrorEnum) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } +} +pub static __SPEC_XDR_TYPE_USEDERRORENUM: [u8; 76usize] = UsedErrorEnum::spec_xdr(); +impl UsedErrorEnum { + pub const fn spec_xdr() -> [u8; 76usize] { + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\rUsedErrorEnum\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x08NotFound\0\0\0\x01\0\0\0\0\0\0\0\x07Invalid\0\0\0\0\x02" + } +} +impl TryFrom for UsedErrorEnum { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: soroban_sdk::Error) -> Result { + if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { + let discriminant = error.get_code(); + Ok(match discriminant { + 1u32 => Self::NotFound, + 2u32 => Self::Invalid, + _ => return Err(error), + }) + } else { + Err(error) + } + } +} +impl TryFrom<&soroban_sdk::Error> for UsedErrorEnum { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: &soroban_sdk::Error) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::Error { + #[inline(always)] + fn from(val: UsedErrorEnum) -> soroban_sdk::Error { + <_ as From<&UsedErrorEnum>>::from(&val) + } +} +impl From<&UsedErrorEnum> for soroban_sdk::Error { + #[inline(always)] + fn from(val: &UsedErrorEnum) -> soroban_sdk::Error { + match val { + UsedErrorEnum::NotFound => soroban_sdk::Error::from_contract_error(1u32), + UsedErrorEnum::Invalid => soroban_sdk::Error::from_contract_error(2u32), + } + } +} +impl TryFrom for UsedErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: soroban_sdk::InvokeError) -> Result { + match error { + soroban_sdk::InvokeError::Abort => Err(error), + soroban_sdk::InvokeError::Contract(code) => Ok(match code { + 1u32 => Self::NotFound, + 2u32 => Self::Invalid, + _ => return Err(error), + }), + } + } +} +impl TryFrom<&soroban_sdk::InvokeError> for UsedErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: &soroban_sdk::InvokeError) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: UsedErrorEnum) -> soroban_sdk::InvokeError { + <_ as From<&UsedErrorEnum>>::from(&val) + } +} +impl From<&UsedErrorEnum> for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: &UsedErrorEnum) -> soroban_sdk::InvokeError { + match val { + UsedErrorEnum::NotFound => soroban_sdk::InvokeError::Contract(1u32), + UsedErrorEnum::Invalid => soroban_sdk::InvokeError::Contract(2u32), + } + } +} +impl soroban_sdk::TryFromVal for UsedErrorEnum { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let error: soroban_sdk::Error = val.try_into_val(env)?; + error.try_into().map_err(|_| soroban_sdk::ConversionError) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedErrorEnum, + ) -> Result { + let error: soroban_sdk::Error = val.into(); + Ok(error.into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedErrorEnum, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +pub enum UsedAuthErrorEnum { + NotFound = 1, + Invalid = 2, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedAuthErrorEnum {} +#[automatically_derived] +impl ::core::clone::Clone for UsedAuthErrorEnum { + #[inline] + fn clone(&self) -> UsedAuthErrorEnum { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedAuthErrorEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + UsedAuthErrorEnum::NotFound => "NotFound", + UsedAuthErrorEnum::Invalid => "Invalid", + }, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedAuthErrorEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedAuthErrorEnum {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedAuthErrorEnum { + #[inline] + fn eq(&self, other: &UsedAuthErrorEnum) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } +} +pub static __SPEC_XDR_TYPE_USEDAUTHERRORENUM: [u8; 80usize] = UsedAuthErrorEnum::spec_xdr(); +impl UsedAuthErrorEnum { + pub const fn spec_xdr() -> [u8; 80usize] { + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x11UsedAuthErrorEnum\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x08NotFound\0\0\0\x01\0\0\0\0\0\0\0\x07Invalid\0\0\0\0\x02" + } +} +impl TryFrom for UsedAuthErrorEnum { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: soroban_sdk::Error) -> Result { + if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { + let discriminant = error.get_code(); + Ok(match discriminant { + 1u32 => Self::NotFound, + 2u32 => Self::Invalid, + _ => return Err(error), + }) + } else { + Err(error) + } + } +} +impl TryFrom<&soroban_sdk::Error> for UsedAuthErrorEnum { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: &soroban_sdk::Error) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::Error { + #[inline(always)] + fn from(val: UsedAuthErrorEnum) -> soroban_sdk::Error { + <_ as From<&UsedAuthErrorEnum>>::from(&val) + } +} +impl From<&UsedAuthErrorEnum> for soroban_sdk::Error { + #[inline(always)] + fn from(val: &UsedAuthErrorEnum) -> soroban_sdk::Error { + match val { + UsedAuthErrorEnum::NotFound => soroban_sdk::Error::from_contract_error(1u32), + UsedAuthErrorEnum::Invalid => soroban_sdk::Error::from_contract_error(2u32), + } + } +} +impl TryFrom for UsedAuthErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: soroban_sdk::InvokeError) -> Result { + match error { + soroban_sdk::InvokeError::Abort => Err(error), + soroban_sdk::InvokeError::Contract(code) => Ok(match code { + 1u32 => Self::NotFound, + 2u32 => Self::Invalid, + _ => return Err(error), + }), + } + } +} +impl TryFrom<&soroban_sdk::InvokeError> for UsedAuthErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: &soroban_sdk::InvokeError) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: UsedAuthErrorEnum) -> soroban_sdk::InvokeError { + <_ as From<&UsedAuthErrorEnum>>::from(&val) + } +} +impl From<&UsedAuthErrorEnum> for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: &UsedAuthErrorEnum) -> soroban_sdk::InvokeError { + match val { + UsedAuthErrorEnum::NotFound => soroban_sdk::InvokeError::Contract(1u32), + UsedAuthErrorEnum::Invalid => soroban_sdk::InvokeError::Contract(2u32), + } + } +} +impl soroban_sdk::TryFromVal for UsedAuthErrorEnum { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let error: soroban_sdk::Error = val.try_into_val(env)?; + error.try_into().map_err(|_| soroban_sdk::ConversionError) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedAuthErrorEnum, + ) -> Result { + let error: soroban_sdk::Error = val.into(); + Ok(error.into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedAuthErrorEnum, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +pub enum UsedPanicErrorEnum { + Boom = 1, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedPanicErrorEnum {} +#[automatically_derived] +impl ::core::clone::Clone for UsedPanicErrorEnum { + #[inline] + fn clone(&self) -> UsedPanicErrorEnum { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedPanicErrorEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str(f, "Boom") + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedPanicErrorEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedPanicErrorEnum {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedPanicErrorEnum { + #[inline] + fn eq(&self, other: &UsedPanicErrorEnum) -> bool { + true + } +} +pub static __SPEC_XDR_TYPE_USEDPANICERRORENUM: [u8; 56usize] = UsedPanicErrorEnum::spec_xdr(); +impl UsedPanicErrorEnum { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x12UsedPanicErrorEnum\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04Boom\0\0\0\x01" + } +} +impl TryFrom for UsedPanicErrorEnum { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: soroban_sdk::Error) -> Result { + if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { + let discriminant = error.get_code(); + Ok(match discriminant { + 1u32 => Self::Boom, + _ => return Err(error), + }) + } else { + Err(error) + } + } +} +impl TryFrom<&soroban_sdk::Error> for UsedPanicErrorEnum { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: &soroban_sdk::Error) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::Error { + #[inline(always)] + fn from(val: UsedPanicErrorEnum) -> soroban_sdk::Error { + <_ as From<&UsedPanicErrorEnum>>::from(&val) + } +} +impl From<&UsedPanicErrorEnum> for soroban_sdk::Error { + #[inline(always)] + fn from(val: &UsedPanicErrorEnum) -> soroban_sdk::Error { + match val { + UsedPanicErrorEnum::Boom => soroban_sdk::Error::from_contract_error(1u32), + } + } +} +impl TryFrom for UsedPanicErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: soroban_sdk::InvokeError) -> Result { + match error { + soroban_sdk::InvokeError::Abort => Err(error), + soroban_sdk::InvokeError::Contract(code) => Ok(match code { + 1u32 => Self::Boom, + _ => return Err(error), + }), + } + } +} +impl TryFrom<&soroban_sdk::InvokeError> for UsedPanicErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: &soroban_sdk::InvokeError) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: UsedPanicErrorEnum) -> soroban_sdk::InvokeError { + <_ as From<&UsedPanicErrorEnum>>::from(&val) + } +} +impl From<&UsedPanicErrorEnum> for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: &UsedPanicErrorEnum) -> soroban_sdk::InvokeError { + match val { + UsedPanicErrorEnum::Boom => soroban_sdk::InvokeError::Contract(1u32), + } + } +} +impl soroban_sdk::TryFromVal for UsedPanicErrorEnum { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let error: soroban_sdk::Error = val.try_into_val(env)?; + error.try_into().map_err(|_| soroban_sdk::ConversionError) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedPanicErrorEnum, + ) -> Result { + let error: soroban_sdk::Error = val.into(); + Ok(error.into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedPanicErrorEnum, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +pub enum UsedPanicErrorEnumRef { + Boom = 1, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedPanicErrorEnumRef {} +#[automatically_derived] +impl ::core::clone::Clone for UsedPanicErrorEnumRef { + #[inline] + fn clone(&self) -> UsedPanicErrorEnumRef { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedPanicErrorEnumRef { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str(f, "Boom") + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedPanicErrorEnumRef { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedPanicErrorEnumRef {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedPanicErrorEnumRef { + #[inline] + fn eq(&self, other: &UsedPanicErrorEnumRef) -> bool { + true + } +} +pub static __SPEC_XDR_TYPE_USEDPANICERRORENUMREF: [u8; 60usize] = UsedPanicErrorEnumRef::spec_xdr(); +impl UsedPanicErrorEnumRef { + pub const fn spec_xdr() -> [u8; 60usize] { + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x15UsedPanicErrorEnumRef\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04Boom\0\0\0\x01" + } +} +impl TryFrom for UsedPanicErrorEnumRef { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: soroban_sdk::Error) -> Result { + if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { + let discriminant = error.get_code(); + Ok(match discriminant { + 1u32 => Self::Boom, + _ => return Err(error), + }) + } else { + Err(error) + } + } +} +impl TryFrom<&soroban_sdk::Error> for UsedPanicErrorEnumRef { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: &soroban_sdk::Error) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::Error { + #[inline(always)] + fn from(val: UsedPanicErrorEnumRef) -> soroban_sdk::Error { + <_ as From<&UsedPanicErrorEnumRef>>::from(&val) + } +} +impl From<&UsedPanicErrorEnumRef> for soroban_sdk::Error { + #[inline(always)] + fn from(val: &UsedPanicErrorEnumRef) -> soroban_sdk::Error { + match val { + UsedPanicErrorEnumRef::Boom => soroban_sdk::Error::from_contract_error(1u32), + } + } +} +impl TryFrom for UsedPanicErrorEnumRef { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: soroban_sdk::InvokeError) -> Result { + match error { + soroban_sdk::InvokeError::Abort => Err(error), + soroban_sdk::InvokeError::Contract(code) => Ok(match code { + 1u32 => Self::Boom, + _ => return Err(error), + }), + } + } +} +impl TryFrom<&soroban_sdk::InvokeError> for UsedPanicErrorEnumRef { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: &soroban_sdk::InvokeError) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: UsedPanicErrorEnumRef) -> soroban_sdk::InvokeError { + <_ as From<&UsedPanicErrorEnumRef>>::from(&val) + } +} +impl From<&UsedPanicErrorEnumRef> for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: &UsedPanicErrorEnumRef) -> soroban_sdk::InvokeError { + match val { + UsedPanicErrorEnumRef::Boom => soroban_sdk::InvokeError::Contract(1u32), + } + } +} +impl soroban_sdk::TryFromVal for UsedPanicErrorEnumRef { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let error: soroban_sdk::Error = val.try_into_val(env)?; + error.try_into().map_err(|_| soroban_sdk::ConversionError) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedPanicErrorEnumRef, + ) -> Result { + let error: soroban_sdk::Error = val.into(); + Ok(error.into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedPanicErrorEnumRef, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +pub enum UsedAssertErrorEnum { + Bad = 1, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedAssertErrorEnum {} +#[automatically_derived] +impl ::core::clone::Clone for UsedAssertErrorEnum { + #[inline] + fn clone(&self) -> UsedAssertErrorEnum { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedAssertErrorEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str(f, "Bad") + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedAssertErrorEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedAssertErrorEnum {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedAssertErrorEnum { + #[inline] + fn eq(&self, other: &UsedAssertErrorEnum) -> bool { + true + } +} +pub static __SPEC_XDR_TYPE_USEDASSERTERRORENUM: [u8; 56usize] = UsedAssertErrorEnum::spec_xdr(); +impl UsedAssertErrorEnum { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x13UsedAssertErrorEnum\0\0\0\0\x01\0\0\0\0\0\0\0\x03Bad\0\0\0\0\x01" + } +} +impl TryFrom for UsedAssertErrorEnum { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: soroban_sdk::Error) -> Result { + if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { + let discriminant = error.get_code(); + Ok(match discriminant { + 1u32 => Self::Bad, + _ => return Err(error), + }) + } else { + Err(error) + } + } +} +impl TryFrom<&soroban_sdk::Error> for UsedAssertErrorEnum { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: &soroban_sdk::Error) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::Error { + #[inline(always)] + fn from(val: UsedAssertErrorEnum) -> soroban_sdk::Error { + <_ as From<&UsedAssertErrorEnum>>::from(&val) + } +} +impl From<&UsedAssertErrorEnum> for soroban_sdk::Error { + #[inline(always)] + fn from(val: &UsedAssertErrorEnum) -> soroban_sdk::Error { + match val { + UsedAssertErrorEnum::Bad => soroban_sdk::Error::from_contract_error(1u32), + } + } +} +impl TryFrom for UsedAssertErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: soroban_sdk::InvokeError) -> Result { + match error { + soroban_sdk::InvokeError::Abort => Err(error), + soroban_sdk::InvokeError::Contract(code) => Ok(match code { + 1u32 => Self::Bad, + _ => return Err(error), + }), + } + } +} +impl TryFrom<&soroban_sdk::InvokeError> for UsedAssertErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] fn try_from(error: &soroban_sdk::InvokeError) -> Result { <_ as TryFrom>::try_from(*error) } } -impl From for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: UsedPanicErrorEnum) -> soroban_sdk::InvokeError { - <_ as From<&UsedPanicErrorEnum>>::from(&val) +impl From for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: UsedAssertErrorEnum) -> soroban_sdk::InvokeError { + <_ as From<&UsedAssertErrorEnum>>::from(&val) + } +} +impl From<&UsedAssertErrorEnum> for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: &UsedAssertErrorEnum) -> soroban_sdk::InvokeError { + match val { + UsedAssertErrorEnum::Bad => soroban_sdk::InvokeError::Contract(1u32), + } + } +} +impl soroban_sdk::TryFromVal for UsedAssertErrorEnum { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let error: soroban_sdk::Error = val.try_into_val(env)?; + error.try_into().map_err(|_| soroban_sdk::ConversionError) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedAssertErrorEnum, + ) -> Result { + let error: soroban_sdk::Error = val.into(); + Ok(error.into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedAssertErrorEnum, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +pub struct UsedNestedInStruct { + pub val: i64, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedNestedInStruct { + #[inline] + fn clone(&self) -> UsedNestedInStruct { + UsedNestedInStruct { + val: ::core::clone::Clone::clone(&self.val), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedNestedInStruct { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedNestedInStruct", + "val", + &&self.val, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedNestedInStruct { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedNestedInStruct {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedNestedInStruct { + #[inline] + fn eq(&self, other: &UsedNestedInStruct) -> bool { + self.val == other.val + } +} +pub static __SPEC_XDR_TYPE_USEDNESTEDINSTRUCT: [u8; 56usize] = UsedNestedInStruct::spec_xdr(); +impl UsedNestedInStruct { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedNestedInStruct\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x07" + } +} +impl soroban_sdk::TryFromVal for UsedNestedInStruct { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedNestedInStruct, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedNestedInStruct, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +impl soroban_sdk::TryFromVal for UsedNestedInStruct { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + val: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "val" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } +} +impl soroban_sdk::TryFromVal for UsedNestedInStruct { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryFrom<&UsedNestedInStruct> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedNestedInStruct) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "val" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.val) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } +} +impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedNestedInStruct) -> Result { + (&val).try_into() + } +} +impl TryFrom<&UsedNestedInStruct> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedNestedInStruct) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedNestedInStruct) -> Result { + (&val).try_into() + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryUsedNestedInStruct { + val: ::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUsedNestedInStruct { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "ArbitraryUsedNestedInStruct", + "val", + &&self.val, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUsedNestedInStruct { + #[inline] + fn clone(&self) -> ArbitraryUsedNestedInStruct { + ArbitraryUsedNestedInStruct { + val: ::core::clone::Clone::clone(&self.val), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUsedNestedInStruct { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUsedNestedInStruct {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUsedNestedInStruct { + #[inline] + fn eq(&self, other: &ArbitraryUsedNestedInStruct) -> bool { + self.val == other.val + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUsedNestedInStruct { + #[inline] + fn cmp(&self, other: &ArbitraryUsedNestedInStruct) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.val, &other.val) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUsedNestedInStruct { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUsedNestedInStruct, + ) -> ::core::option::Option<::core::cmp::Ordering> { + ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUsedNestedInStruct: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedNestedInStruct { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedNestedInStruct.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedNestedInStruct { + val: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedNestedInStruct.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedNestedInStruct.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedNestedInStruct { + val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedNestedInStruct.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedNestedInStruct { + type Prototype = ArbitraryUsedNestedInStruct; + } + impl soroban_sdk::TryFromVal for UsedNestedInStruct { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedNestedInStruct, + ) -> std::result::Result { + Ok(UsedNestedInStruct { + val: soroban_sdk::IntoVal::into_val(&v.val, env), + }) + } + } +}; +pub struct UsedVecElement { + pub data: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedVecElement { + #[inline] + fn clone(&self) -> UsedVecElement { + UsedVecElement { + data: ::core::clone::Clone::clone(&self.data), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedVecElement { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedVecElement", "data", &&self.data) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedVecElement { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedVecElement {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedVecElement { + #[inline] + fn eq(&self, other: &UsedVecElement) -> bool { + self.data == other.data + } +} +pub static __SPEC_XDR_TYPE_USEDVECELEMENT: [u8; 52usize] = UsedVecElement::spec_xdr(); +impl UsedVecElement { + pub const fn spec_xdr() -> [u8; 52usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0eUsedVecElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" + } +} +impl soroban_sdk::TryFromVal for UsedVecElement { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + data: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedVecElement, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedVecElement, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +impl soroban_sdk::TryFromVal for UsedVecElement { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + data: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "data" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } +} +impl soroban_sdk::TryFromVal for UsedVecElement { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryFrom<&UsedVecElement> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedVecElement) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "data" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.data) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } +} +impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedVecElement) -> Result { + (&val).try_into() + } +} +impl TryFrom<&UsedVecElement> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedVecElement) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedVecElement) -> Result { + (&val).try_into() + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryUsedVecElement { + data: ::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUsedVecElement { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "ArbitraryUsedVecElement", + "data", + &&self.data, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUsedVecElement { + #[inline] + fn clone(&self) -> ArbitraryUsedVecElement { + ArbitraryUsedVecElement { + data: ::core::clone::Clone::clone(&self.data), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUsedVecElement { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUsedVecElement {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUsedVecElement { + #[inline] + fn eq(&self, other: &ArbitraryUsedVecElement) -> bool { + self.data == other.data + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUsedVecElement { + #[inline] + fn cmp(&self, other: &ArbitraryUsedVecElement) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.data, &other.data) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUsedVecElement { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUsedVecElement, + ) -> ::core::option::Option<::core::cmp::Ordering> { + ::core::cmp::PartialOrd::partial_cmp(&self.data, &other.data) + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUsedVecElement: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedVecElement { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedVecElement.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedVecElement { + data: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedVecElement.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedVecElement.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedVecElement { + data: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedVecElement.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedVecElement { + type Prototype = ArbitraryUsedVecElement; + } + impl soroban_sdk::TryFromVal for UsedVecElement { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedVecElement, + ) -> std::result::Result { + Ok(UsedVecElement { + data: soroban_sdk::IntoVal::into_val(&v.data, env), + }) + } + } +}; +pub enum UsedMapKey { + K1 = 1, + K2 = 2, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedMapKey {} +#[automatically_derived] +impl ::core::clone::Clone for UsedMapKey { + #[inline] + fn clone(&self) -> UsedMapKey { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedMapKey { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + UsedMapKey::K1 => "K1", + UsedMapKey::K2 => "K2", + }, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedMapKey { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedMapKey {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedMapKey { + #[inline] + fn eq(&self, other: &UsedMapKey) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } +} +pub static __SPEC_XDR_TYPE_USEDMAPKEY: [u8; 64usize] = UsedMapKey::spec_xdr(); +impl UsedMapKey { + pub const fn spec_xdr() -> [u8; 64usize] { + *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\nUsedMapKey\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02K1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02K2\0\0\0\0\0\x02" + } +} +impl soroban_sdk::TryFromVal for UsedMapKey { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let discriminant: u32 = val.try_into_val(env)?; + Ok(match discriminant { + 1u32 => Self::K1, + 2u32 => Self::K2, + _ => Err(soroban_sdk::ConversionError {})?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedMapKey, + ) -> Result { + Ok(match val { + UsedMapKey::K1 => 1u32.into(), + UsedMapKey::K2 => 2u32.into(), + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedMapKey, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +impl soroban_sdk::TryFromVal for UsedMapKey { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::U32(discriminant) = val { + Ok(match *discriminant { + 1u32 => Self::K1, + 2u32 => Self::K2, + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryInto for &UsedMapKey { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_into(self) -> Result { + Ok(match self { + UsedMapKey::K1 => 1u32.into(), + UsedMapKey::K2 => 2u32.into(), + }) + } +} +impl TryInto for UsedMapKey { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_into(self) -> Result { + Ok(match self { + UsedMapKey::K1 => 1u32.into(), + UsedMapKey::K2 => 2u32.into(), + }) + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryUsedMapKey { + K1, + K2, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUsedMapKey { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + ArbitraryUsedMapKey::K1 => "K1", + ArbitraryUsedMapKey::K2 => "K2", + }, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUsedMapKey { + #[inline] + fn clone(&self) -> ArbitraryUsedMapKey { + match self { + ArbitraryUsedMapKey::K1 => ArbitraryUsedMapKey::K1, + ArbitraryUsedMapKey::K2 => ArbitraryUsedMapKey::K2, + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUsedMapKey { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUsedMapKey {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUsedMapKey { + #[inline] + fn eq(&self, other: &ArbitraryUsedMapKey) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUsedMapKey { + #[inline] + fn cmp(&self, other: &ArbitraryUsedMapKey) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUsedMapKey { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUsedMapKey, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr) + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUsedMapKey: ::std::thread::LocalKey> = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedMapKey { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedMapKey.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) * 2u64) >> 32 + { + 0u64 => ArbitraryUsedMapKey::K1, + 1u64 => ArbitraryUsedMapKey::K2, + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedMapKey.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedMapKey.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) * 2u64) + >> 32 + { + 0u64 => ArbitraryUsedMapKey::K1, + 1u64 => ArbitraryUsedMapKey::K2, + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedMapKey.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all(&[ + arbitrary::size_hint::and_all(&[]), + arbitrary::size_hint::and_all(&[]), + ]) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedMapKey { + type Prototype = ArbitraryUsedMapKey; + } + impl soroban_sdk::TryFromVal for UsedMapKey { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedMapKey, + ) -> std::result::Result { + Ok(match v { + ArbitraryUsedMapKey::K1 => UsedMapKey::K1, + ArbitraryUsedMapKey::K2 => UsedMapKey::K2, + }) + } + } +}; +pub struct UsedMapVal { + pub v: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedMapVal { + #[inline] + fn clone(&self) -> UsedMapVal { + UsedMapVal { + v: ::core::clone::Clone::clone(&self.v), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedMapVal { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedMapVal", "v", &&self.v) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedMapVal { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedMapVal {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedMapVal { + #[inline] + fn eq(&self, other: &UsedMapVal) -> bool { + self.v == other.v + } +} +pub static __SPEC_XDR_TYPE_USEDMAPVAL: [u8; 48usize] = UsedMapVal::spec_xdr(); +impl UsedMapVal { + pub const fn spec_xdr() -> [u8; 48usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\nUsedMapVal\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x04" + } +} +impl soroban_sdk::TryFromVal for UsedMapVal { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["v"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + v: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedMapVal, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["v"]; + let vals: [Val; 1usize] = [(&val.v).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedMapVal, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +impl soroban_sdk::TryFromVal for UsedMapVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + v: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "v".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } +} +impl soroban_sdk::TryFromVal for UsedMapVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryFrom<&UsedMapVal> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedMapVal) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "v".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.v) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } +} +impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedMapVal) -> Result { + (&val).try_into() + } +} +impl TryFrom<&UsedMapVal> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedMapVal) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedMapVal) -> Result { + (&val).try_into() + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryUsedMapVal { + v: ::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUsedMapVal { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "ArbitraryUsedMapVal", + "v", + &&self.v, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUsedMapVal { + #[inline] + fn clone(&self) -> ArbitraryUsedMapVal { + ArbitraryUsedMapVal { + v: ::core::clone::Clone::clone(&self.v), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUsedMapVal { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUsedMapVal {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUsedMapVal { + #[inline] + fn eq(&self, other: &ArbitraryUsedMapVal) -> bool { + self.v == other.v + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUsedMapVal { + #[inline] + fn cmp(&self, other: &ArbitraryUsedMapVal) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.v, &other.v) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUsedMapVal { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUsedMapVal, + ) -> ::core::option::Option<::core::cmp::Ordering> { + ::core::cmp::PartialOrd::partial_cmp(&self.v, &other.v) + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUsedMapVal: ::std::thread::LocalKey> = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedMapVal { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedMapVal.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedMapVal { + v: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedMapVal.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedMapVal.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedMapVal { + v: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedMapVal.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedMapVal { + type Prototype = ArbitraryUsedMapVal; + } + impl soroban_sdk::TryFromVal for UsedMapVal { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedMapVal, + ) -> std::result::Result { + Ok(UsedMapVal { + v: soroban_sdk::IntoVal::into_val(&v.v, env), + }) + } + } +}; +pub struct UsedOptionElement { + pub data: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedOptionElement { + #[inline] + fn clone(&self) -> UsedOptionElement { + UsedOptionElement { + data: ::core::clone::Clone::clone(&self.data), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedOptionElement { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedOptionElement", + "data", + &&self.data, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedOptionElement { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedOptionElement {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedOptionElement { + #[inline] + fn eq(&self, other: &UsedOptionElement) -> bool { + self.data == other.data + } +} +pub static __SPEC_XDR_TYPE_USEDOPTIONELEMENT: [u8; 56usize] = UsedOptionElement::spec_xdr(); +impl UsedOptionElement { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedOptionElement\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" + } +} +impl soroban_sdk::TryFromVal for UsedOptionElement { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + data: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedOptionElement, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedOptionElement, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +impl soroban_sdk::TryFromVal for UsedOptionElement { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + data: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "data" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } +} +impl soroban_sdk::TryFromVal for UsedOptionElement { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryFrom<&UsedOptionElement> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedOptionElement) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "data" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.data) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } +} +impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedOptionElement) -> Result { + (&val).try_into() + } +} +impl TryFrom<&UsedOptionElement> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedOptionElement) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedOptionElement) -> Result { + (&val).try_into() + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryUsedOptionElement { + data: ::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUsedOptionElement { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "ArbitraryUsedOptionElement", + "data", + &&self.data, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUsedOptionElement { + #[inline] + fn clone(&self) -> ArbitraryUsedOptionElement { + ArbitraryUsedOptionElement { + data: ::core::clone::Clone::clone(&self.data), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUsedOptionElement { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUsedOptionElement {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUsedOptionElement { + #[inline] + fn eq(&self, other: &ArbitraryUsedOptionElement) -> bool { + self.data == other.data + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUsedOptionElement { + #[inline] + fn cmp(&self, other: &ArbitraryUsedOptionElement) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.data, &other.data) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUsedOptionElement { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUsedOptionElement, + ) -> ::core::option::Option<::core::cmp::Ordering> { + ::core::cmp::PartialOrd::partial_cmp(&self.data, &other.data) + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUsedOptionElement: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedOptionElement { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedOptionElement.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedOptionElement { + data: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedOptionElement.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedOptionElement.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedOptionElement { + data: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedOptionElement.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedOptionElement { + type Prototype = ArbitraryUsedOptionElement; + } + impl soroban_sdk::TryFromVal for UsedOptionElement { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedOptionElement, + ) -> std::result::Result { + Ok(UsedOptionElement { + data: soroban_sdk::IntoVal::into_val(&v.data, env), + }) + } + } +}; +pub struct UsedResultOk { + pub data: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedResultOk { + #[inline] + fn clone(&self) -> UsedResultOk { + UsedResultOk { + data: ::core::clone::Clone::clone(&self.data), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedResultOk { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedResultOk", "data", &&self.data) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedResultOk { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedResultOk {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedResultOk { + #[inline] + fn eq(&self, other: &UsedResultOk) -> bool { + self.data == other.data + } +} +pub static __SPEC_XDR_TYPE_USEDRESULTOK: [u8; 48usize] = UsedResultOk::spec_xdr(); +impl UsedResultOk { + pub const fn spec_xdr() -> [u8; 48usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0cUsedResultOk\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" + } +} +impl soroban_sdk::TryFromVal for UsedResultOk { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + data: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedResultOk, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedResultOk, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +impl soroban_sdk::TryFromVal for UsedResultOk { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + data: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "data" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } +} +impl soroban_sdk::TryFromVal for UsedResultOk { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryFrom<&UsedResultOk> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedResultOk) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "data" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.data) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } +} +impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedResultOk) -> Result { + (&val).try_into() + } +} +impl TryFrom<&UsedResultOk> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedResultOk) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedResultOk) -> Result { + (&val).try_into() + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryUsedResultOk { + data: ::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUsedResultOk { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "ArbitraryUsedResultOk", + "data", + &&self.data, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUsedResultOk { + #[inline] + fn clone(&self) -> ArbitraryUsedResultOk { + ArbitraryUsedResultOk { + data: ::core::clone::Clone::clone(&self.data), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUsedResultOk { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUsedResultOk {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUsedResultOk { + #[inline] + fn eq(&self, other: &ArbitraryUsedResultOk) -> bool { + self.data == other.data + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUsedResultOk { + #[inline] + fn cmp(&self, other: &ArbitraryUsedResultOk) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.data, &other.data) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUsedResultOk { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUsedResultOk, + ) -> ::core::option::Option<::core::cmp::Ordering> { + ::core::cmp::PartialOrd::partial_cmp(&self.data, &other.data) + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUsedResultOk: ::std::thread::LocalKey> = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedResultOk { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedResultOk.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedResultOk { + data: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedResultOk.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedResultOk.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedResultOk { + data: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedResultOk.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedResultOk { + type Prototype = ArbitraryUsedResultOk; + } + impl soroban_sdk::TryFromVal for UsedResultOk { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedResultOk, + ) -> std::result::Result { + Ok(UsedResultOk { + data: soroban_sdk::IntoVal::into_val(&v.data, env), + }) + } + } +}; +pub struct CustomSignature { + pub nonce: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for CustomSignature { + #[inline] + fn clone(&self) -> CustomSignature { + CustomSignature { + nonce: ::core::clone::Clone::clone(&self.nonce), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for CustomSignature { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "CustomSignature", + "nonce", + &&self.nonce, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for CustomSignature { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for CustomSignature {} +#[automatically_derived] +impl ::core::cmp::PartialEq for CustomSignature { + #[inline] + fn eq(&self, other: &CustomSignature) -> bool { + self.nonce == other.nonce + } +} +pub static __SPEC_XDR_TYPE_CUSTOMSIGNATURE: [u8; 56usize] = CustomSignature::spec_xdr(); +impl CustomSignature { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fCustomSignature\0\0\0\0\x01\0\0\0\0\0\0\0\x05nonce\0\0\0\0\0\0\x04" + } +} +impl soroban_sdk::TryFromVal for CustomSignature { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["nonce"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + nonce: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &CustomSignature, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["nonce"]; + let vals: [Val; 1usize] = [(&val.nonce) + .try_into_val(env) + .map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&CustomSignature, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +impl soroban_sdk::TryFromVal for CustomSignature { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + nonce: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "nonce" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } +} +impl soroban_sdk::TryFromVal for CustomSignature { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryFrom<&CustomSignature> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &CustomSignature) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "nonce" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.nonce) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } +} +impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: CustomSignature) -> Result { + (&val).try_into() + } +} +impl TryFrom<&CustomSignature> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &CustomSignature) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: CustomSignature) -> Result { + (&val).try_into() + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryCustomSignature { + nonce: ::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryCustomSignature { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "ArbitraryCustomSignature", + "nonce", + &&self.nonce, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryCustomSignature { + #[inline] + fn clone(&self) -> ArbitraryCustomSignature { + ArbitraryCustomSignature { + nonce: ::core::clone::Clone::clone(&self.nonce), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryCustomSignature { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryCustomSignature {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryCustomSignature { + #[inline] + fn eq(&self, other: &ArbitraryCustomSignature) -> bool { + self.nonce == other.nonce + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryCustomSignature { + #[inline] + fn cmp(&self, other: &ArbitraryCustomSignature) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.nonce, &other.nonce) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryCustomSignature { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryCustomSignature, + ) -> ::core::option::Option<::core::cmp::Ordering> { + ::core::cmp::PartialOrd::partial_cmp(&self.nonce, &other.nonce) + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryCustomSignature: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryCustomSignature { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCustomSignature.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryCustomSignature { + nonce: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCustomSignature.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCustomSignature.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryCustomSignature { + nonce: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCustomSignature.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for CustomSignature { + type Prototype = ArbitraryCustomSignature; + } + impl soroban_sdk::TryFromVal for CustomSignature { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryCustomSignature, + ) -> std::result::Result { + Ok(CustomSignature { + nonce: soroban_sdk::IntoVal::into_val(&v.nonce, env), + }) + } + } +}; +pub struct UsedEventSimple { + pub kind: Symbol, + pub amount: i128, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventSimple { + #[inline] + fn clone(&self) -> UsedEventSimple { + UsedEventSimple { + kind: ::core::clone::Clone::clone(&self.kind), + amount: ::core::clone::Clone::clone(&self.amount), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventSimple { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UsedEventSimple", + "kind", + &self.kind, + "amount", + &&self.amount, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventSimple { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventSimple {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventSimple { + #[inline] + fn eq(&self, other: &UsedEventSimple) -> bool { + self.amount == other.amount && self.kind == other.kind + } +} +pub static __SPEC_XDR_EVENT_USEDEVENTSIMPLE: [u8; 112usize] = UsedEventSimple::spec_xdr(); +impl UsedEventSimple { + pub const fn spec_xdr() -> [u8; 112usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x0fUsedEventSimple\0\0\0\0\x01\0\0\0\x11used_event_simple\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" + } +} +impl soroban_sdk::Event for UsedEventSimple { + fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { + use soroban_sdk::IntoVal; + (&{ soroban_sdk::Symbol::new(env, "used_event_simple") }, { + let v: soroban_sdk::Val = self.kind.into_val(env); + v + }) + .into_val(env) + } + fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { + use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; + const KEYS: [&'static str; 1usize] = ["amount"]; + let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; + env.map_new_from_slices(&KEYS, &vals) + .unwrap_infallible() + .into() + } +} +impl UsedEventSimple { + pub fn publish(&self, env: &soroban_sdk::Env) { + <_ as soroban_sdk::Event>::publish(self, env); + } +} +pub enum UsedEventTopicType { + Transfer = 1, + Mint = 2, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedEventTopicType {} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventTopicType { + #[inline] + fn clone(&self) -> UsedEventTopicType { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventTopicType { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + UsedEventTopicType::Transfer => "Transfer", + UsedEventTopicType::Mint => "Mint", + }, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventTopicType { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventTopicType {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventTopicType { + #[inline] + fn eq(&self, other: &UsedEventTopicType) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr } } -impl From<&UsedPanicErrorEnum> for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: &UsedPanicErrorEnum) -> soroban_sdk::InvokeError { - match val { - UsedPanicErrorEnum::Boom => soroban_sdk::InvokeError::Contract(1u32), - } +pub static __SPEC_XDR_TYPE_USEDEVENTTOPICTYPE: [u8; 76usize] = UsedEventTopicType::spec_xdr(); +impl UsedEventTopicType { + pub const fn spec_xdr() -> [u8; 76usize] { + *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventTopicType\0\0\0\0\0\x02\0\0\0\0\0\0\0\x08Transfer\0\0\0\x01\0\0\0\0\0\0\0\x04Mint\0\0\0\x02" } } -impl soroban_sdk::TryFromVal for UsedPanicErrorEnum { +impl soroban_sdk::TryFromVal for UsedEventTopicType { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( @@ -1679,274 +5473,459 @@ impl soroban_sdk::TryFromVal for UsedPanicEr val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::TryIntoVal; - let error: soroban_sdk::Error = val.try_into_val(env)?; - error.try_into().map_err(|_| soroban_sdk::ConversionError) + let discriminant: u32 = val.try_into_val(env)?; + Ok(match discriminant { + 1u32 => Self::Transfer, + 2u32 => Self::Mint, + _ => Err(soroban_sdk::ConversionError {})?, + }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedPanicErrorEnum, + val: &UsedEventTopicType, ) -> Result { - let error: soroban_sdk::Error = val.into(); - Ok(error.into()) + Ok(match val { + UsedEventTopicType::Transfer => 1u32.into(), + UsedEventTopicType::Mint => 2u32.into(), + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedEventTopicType, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +impl soroban_sdk::TryFromVal for UsedEventTopicType { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::U32(discriminant) = val { + Ok(match *discriminant { + 1u32 => Self::Transfer, + 2u32 => Self::Mint, + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryInto for &UsedEventTopicType { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_into(self) -> Result { + Ok(match self { + UsedEventTopicType::Transfer => 1u32.into(), + UsedEventTopicType::Mint => 2u32.into(), + }) + } +} +impl TryInto for UsedEventTopicType { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_into(self) -> Result { + Ok(match self { + UsedEventTopicType::Transfer => 1u32.into(), + UsedEventTopicType::Mint => 2u32.into(), + }) + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryUsedEventTopicType { + Transfer, + Mint, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUsedEventTopicType { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + ArbitraryUsedEventTopicType::Transfer => "Transfer", + ArbitraryUsedEventTopicType::Mint => "Mint", + }, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUsedEventTopicType { + #[inline] + fn clone(&self) -> ArbitraryUsedEventTopicType { + match self { + ArbitraryUsedEventTopicType::Transfer => ArbitraryUsedEventTopicType::Transfer, + ArbitraryUsedEventTopicType::Mint => ArbitraryUsedEventTopicType::Mint, + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUsedEventTopicType { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventTopicType {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUsedEventTopicType { + #[inline] + fn eq(&self, other: &ArbitraryUsedEventTopicType) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUsedEventTopicType { + #[inline] + fn cmp(&self, other: &ArbitraryUsedEventTopicType) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUsedEventTopicType { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUsedEventTopicType, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr) + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUsedEventTopicType: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventTopicType { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedEventTopicType.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) * 2u64) >> 32 + { + 0u64 => ArbitraryUsedEventTopicType::Transfer, + 1u64 => ArbitraryUsedEventTopicType::Mint, + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedEventTopicType.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedEventTopicType.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) * 2u64) + >> 32 + { + 0u64 => ArbitraryUsedEventTopicType::Transfer, + 1u64 => ArbitraryUsedEventTopicType::Mint, + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedEventTopicType.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all(&[ + arbitrary::size_hint::and_all(&[]), + arbitrary::size_hint::and_all(&[]), + ]) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventTopicType { + type Prototype = ArbitraryUsedEventTopicType; } -} -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &&UsedPanicErrorEnum, - ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) + impl soroban_sdk::TryFromVal for UsedEventTopicType { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedEventTopicType, + ) -> std::result::Result { + Ok(match v { + ArbitraryUsedEventTopicType::Transfer => UsedEventTopicType::Transfer, + ArbitraryUsedEventTopicType::Mint => UsedEventTopicType::Mint, + }) + } } +}; +pub struct UsedEventWithTopicType { + pub kind: UsedEventTopicType, + pub amount: i128, } -pub enum UsedAssertErrorEnum { - Bad = 1, -} -#[automatically_derived] -impl ::core::marker::Copy for UsedAssertErrorEnum {} #[automatically_derived] -impl ::core::clone::Clone for UsedAssertErrorEnum { +impl ::core::clone::Clone for UsedEventWithTopicType { #[inline] - fn clone(&self) -> UsedAssertErrorEnum { - *self + fn clone(&self) -> UsedEventWithTopicType { + UsedEventWithTopicType { + kind: ::core::clone::Clone::clone(&self.kind), + amount: ::core::clone::Clone::clone(&self.amount), + } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedAssertErrorEnum { +impl ::core::fmt::Debug for UsedEventWithTopicType { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str(f, "Bad") + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UsedEventWithTopicType", + "kind", + &self.kind, + "amount", + &&self.amount, + ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedAssertErrorEnum { +impl ::core::cmp::Eq for UsedEventWithTopicType { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedAssertErrorEnum {} +impl ::core::marker::StructuralPartialEq for UsedEventWithTopicType {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedAssertErrorEnum { +impl ::core::cmp::PartialEq for UsedEventWithTopicType { #[inline] - fn eq(&self, other: &UsedAssertErrorEnum) -> bool { - true - } -} -pub static __SPEC_XDR_TYPE_USEDASSERTERRORENUM: [u8; 56usize] = UsedAssertErrorEnum::spec_xdr(); -impl UsedAssertErrorEnum { - pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x13UsedAssertErrorEnum\0\0\0\0\x01\0\0\0\0\0\0\0\x03Bad\0\0\0\0\x01" - } -} -impl TryFrom for UsedAssertErrorEnum { - type Error = soroban_sdk::Error; - #[inline(always)] - fn try_from(error: soroban_sdk::Error) -> Result { - if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { - let discriminant = error.get_code(); - Ok(match discriminant { - 1u32 => Self::Bad, - _ => return Err(error), - }) - } else { - Err(error) - } - } -} -impl TryFrom<&soroban_sdk::Error> for UsedAssertErrorEnum { - type Error = soroban_sdk::Error; - #[inline(always)] - fn try_from(error: &soroban_sdk::Error) -> Result { - <_ as TryFrom>::try_from(*error) - } -} -impl From for soroban_sdk::Error { - #[inline(always)] - fn from(val: UsedAssertErrorEnum) -> soroban_sdk::Error { - <_ as From<&UsedAssertErrorEnum>>::from(&val) - } -} -impl From<&UsedAssertErrorEnum> for soroban_sdk::Error { - #[inline(always)] - fn from(val: &UsedAssertErrorEnum) -> soroban_sdk::Error { - match val { - UsedAssertErrorEnum::Bad => soroban_sdk::Error::from_contract_error(1u32), - } - } -} -impl TryFrom for UsedAssertErrorEnum { - type Error = soroban_sdk::InvokeError; - #[inline(always)] - fn try_from(error: soroban_sdk::InvokeError) -> Result { - match error { - soroban_sdk::InvokeError::Abort => Err(error), - soroban_sdk::InvokeError::Contract(code) => Ok(match code { - 1u32 => Self::Bad, - _ => return Err(error), - }), - } - } -} -impl TryFrom<&soroban_sdk::InvokeError> for UsedAssertErrorEnum { - type Error = soroban_sdk::InvokeError; - #[inline(always)] - fn try_from(error: &soroban_sdk::InvokeError) -> Result { - <_ as TryFrom>::try_from(*error) - } -} -impl From for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: UsedAssertErrorEnum) -> soroban_sdk::InvokeError { - <_ as From<&UsedAssertErrorEnum>>::from(&val) + fn eq(&self, other: &UsedEventWithTopicType) -> bool { + self.amount == other.amount && self.kind == other.kind } } -impl From<&UsedAssertErrorEnum> for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: &UsedAssertErrorEnum) -> soroban_sdk::InvokeError { - match val { - UsedAssertErrorEnum::Bad => soroban_sdk::InvokeError::Contract(1u32), - } +pub static __SPEC_XDR_EVENT_USEDEVENTWITHTOPICTYPE: [u8; 152usize] = + UsedEventWithTopicType::spec_xdr(); +impl UsedEventWithTopicType { + pub const fn spec_xdr() -> [u8; 152usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x16UsedEventWithTopicType\0\0\0\0\0\x01\0\0\0\x1aused_event_with_topic_type\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\x07\xd0\0\0\0\x12UsedEventTopicType\0\0\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" } } -impl soroban_sdk::TryFromVal for UsedAssertErrorEnum { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &soroban_sdk::Val, - ) -> Result { - use soroban_sdk::TryIntoVal; - let error: soroban_sdk::Error = val.try_into_val(env)?; - error.try_into().map_err(|_| soroban_sdk::ConversionError) +impl soroban_sdk::Event for UsedEventWithTopicType { + fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { + use soroban_sdk::IntoVal; + ( + &{ soroban_sdk::Symbol::new(env, "used_event_with_topic_type") }, + { + let v: soroban_sdk::Val = self.kind.into_val(env); + v + }, + ) + .into_val(env) } -} -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &UsedAssertErrorEnum, - ) -> Result { - let error: soroban_sdk::Error = val.into(); - Ok(error.into()) + fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { + use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; + const KEYS: [&'static str; 1usize] = ["amount"]; + let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; + env.map_new_from_slices(&KEYS, &vals) + .unwrap_infallible() + .into() } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &&UsedAssertErrorEnum, - ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) +impl UsedEventWithTopicType { + pub fn publish(&self, env: &soroban_sdk::Env) { + <_ as soroban_sdk::Event>::publish(self, env); } } -pub struct UsedNestedInStruct { - pub val: i64, +pub struct UsedEventDataType { + pub x: u32, + pub y: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedNestedInStruct { +impl ::core::clone::Clone for UsedEventDataType { #[inline] - fn clone(&self) -> UsedNestedInStruct { - UsedNestedInStruct { - val: ::core::clone::Clone::clone(&self.val), + fn clone(&self) -> UsedEventDataType { + UsedEventDataType { + x: ::core::clone::Clone::clone(&self.x), + y: ::core::clone::Clone::clone(&self.y), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedNestedInStruct { +impl ::core::fmt::Debug for UsedEventDataType { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( + ::core::fmt::Formatter::debug_struct_field2_finish( f, - "UsedNestedInStruct", - "val", - &&self.val, + "UsedEventDataType", + "x", + &self.x, + "y", + &&self.y, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedNestedInStruct { +impl ::core::cmp::Eq for UsedEventDataType { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedNestedInStruct {} +impl ::core::marker::StructuralPartialEq for UsedEventDataType {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedNestedInStruct { +impl ::core::cmp::PartialEq for UsedEventDataType { #[inline] - fn eq(&self, other: &UsedNestedInStruct) -> bool { - self.val == other.val + fn eq(&self, other: &UsedEventDataType) -> bool { + self.x == other.x && self.y == other.y } } -pub static __SPEC_XDR_TYPE_USEDNESTEDINSTRUCT: [u8; 56usize] = UsedNestedInStruct::spec_xdr(); -impl UsedNestedInStruct { - pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedNestedInStruct\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x07" +pub static __SPEC_XDR_TYPE_USEDEVENTDATATYPE: [u8; 72usize] = UsedEventDataType::spec_xdr(); +impl UsedEventDataType { + pub const fn spec_xdr() -> [u8; 72usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedEventDataType\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x04\0\0\0\0\0\0\0\x01y\0\0\0\0\0\0\x04" } } -impl soroban_sdk::TryFromVal for UsedNestedInStruct { +impl soroban_sdk::TryFromVal for UsedEventDataType { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + const KEYS: [&'static str; 2usize] = ["x", "y"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - val: vals[0] + x: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + y: vals[1] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedNestedInStruct, + val: &UsedEventDataType, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + const KEYS: [&'static str; 2usize] = ["x", "y"]; + let vals: [Val; 2usize] = [ + (&val.x).try_into_val(env).map_err(|_| ConversionError)?, + (&val.y).try_into_val(env).map_err(|_| ConversionError)?, + ]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedNestedInStruct, + val: &&UsedEventDataType, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedNestedInStruct { +impl soroban_sdk::TryFromVal for UsedEventDataType { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -1956,15 +5935,29 @@ impl soroban_sdk::TryFromVal for Used use soroban_sdk::xdr::Validate; use soroban_sdk::TryIntoVal; let map = val; - if map.len() != 1usize { + if map.len() != 2usize { return Err(soroban_sdk::xdr::Error::Invalid); } map.validate()?; Ok(Self { - val: { + x: { let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "val" - .try_into() + "x".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + y: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "y".try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(); @@ -1980,7 +5973,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedNestedInStruct { +impl soroban_sdk::TryFromVal for UsedEventDataType { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -1994,115 +5987,139 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedNestedInStruct> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedEventDataType> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedNestedInStruct) -> Result { + fn try_from(val: &UsedEventDataType) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ soroban_sdk::xdr::ScMapEntry { key: soroban_sdk::xdr::ScSymbol( - "val" - .try_into() + "x".try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(), - val: (&val.val) + val: (&val.x) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "y".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.y) .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, }, ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedNestedInStruct) -> Result { + fn try_from(val: UsedEventDataType) -> Result { (&val).try_into() } } -impl TryFrom<&UsedNestedInStruct> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedEventDataType> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedNestedInStruct) -> Result { + fn try_from(val: &UsedEventDataType) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedNestedInStruct) -> Result { + fn try_from(val: UsedEventDataType) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedNestedInStruct { - val: ::Prototype, + pub struct ArbitraryUsedEventDataType { + x: ::Prototype, + y: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedNestedInStruct { + impl ::core::fmt::Debug for ArbitraryUsedEventDataType { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( + ::core::fmt::Formatter::debug_struct_field2_finish( f, - "ArbitraryUsedNestedInStruct", - "val", - &&self.val, + "ArbitraryUsedEventDataType", + "x", + &self.x, + "y", + &&self.y, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedNestedInStruct { + impl ::core::clone::Clone for ArbitraryUsedEventDataType { #[inline] - fn clone(&self) -> ArbitraryUsedNestedInStruct { - ArbitraryUsedNestedInStruct { - val: ::core::clone::Clone::clone(&self.val), + fn clone(&self) -> ArbitraryUsedEventDataType { + ArbitraryUsedEventDataType { + x: ::core::clone::Clone::clone(&self.x), + y: ::core::clone::Clone::clone(&self.y), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedNestedInStruct { + impl ::core::cmp::Eq for ArbitraryUsedEventDataType { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq< - ::Prototype, + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedNestedInStruct {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventDataType {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedNestedInStruct { + impl ::core::cmp::PartialEq for ArbitraryUsedEventDataType { #[inline] - fn eq(&self, other: &ArbitraryUsedNestedInStruct) -> bool { - self.val == other.val + fn eq(&self, other: &ArbitraryUsedEventDataType) -> bool { + self.x == other.x && self.y == other.y } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedNestedInStruct { + impl ::core::cmp::Ord for ArbitraryUsedEventDataType { #[inline] - fn cmp(&self, other: &ArbitraryUsedNestedInStruct) -> ::core::cmp::Ordering { - ::core::cmp::Ord::cmp(&self.val, &other.val) + fn cmp(&self, other: &ArbitraryUsedEventDataType) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.x, &other.x) { + ::core::cmp::Ordering::Equal => ::core::cmp::Ord::cmp(&self.y, &other.y), + cmp => cmp, + } } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedNestedInStruct { + impl ::core::cmp::PartialOrd for ArbitraryUsedEventDataType { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedNestedInStruct, + other: &ArbitraryUsedEventDataType, ) -> ::core::option::Option<::core::cmp::Ordering> { - ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) + match ::core::cmp::PartialOrd::partial_cmp(&self.x, &other.x) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.y, &other.y) + } + cmp => cmp, + } } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedNestedInStruct: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedEventDataType: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -2136,11 +6153,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedNestedInStruct { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventDataType { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedNestedInStruct.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataType.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -2149,12 +6166,13 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedNestedInStruct { - val: arbitrary::Arbitrary::arbitrary(u)?, + Ok(ArbitraryUsedEventDataType { + x: arbitrary::Arbitrary::arbitrary(u)?, + y: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedNestedInStruct.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataType.with(|count| { count.set(count.get() - 1); }); } @@ -2165,7 +6183,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedNestedInStruct.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataType.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -2174,12 +6192,13 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedNestedInStruct { - val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + Ok(ArbitraryUsedEventDataType { + x: arbitrary::Arbitrary::arbitrary(&mut u)?, + y: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedNestedInStruct.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataType.with(|count| { count.set(count.get() - 1); }); } @@ -2190,7 +6209,10 @@ const _: () = { arbitrary::size_hint::recursion_guard(depth, |depth| { arbitrary::size_hint::and_all( &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + <::Prototype as arbitrary::Arbitrary>::size_hint( depth, ), ], @@ -2199,109 +6221,199 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedNestedInStruct { - type Prototype = ArbitraryUsedNestedInStruct; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventDataType { + type Prototype = ArbitraryUsedEventDataType; } - impl soroban_sdk::TryFromVal for UsedNestedInStruct { + impl soroban_sdk::TryFromVal for UsedEventDataType { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedNestedInStruct, + v: &ArbitraryUsedEventDataType, ) -> std::result::Result { - Ok(UsedNestedInStruct { - val: soroban_sdk::IntoVal::into_val(&v.val, env), + Ok(UsedEventDataType { + x: soroban_sdk::IntoVal::into_val(&v.x, env), + y: soroban_sdk::IntoVal::into_val(&v.y, env), }) } } -}; -pub struct UsedVecElement { - pub data: u32, +}; +pub struct UsedEventWithDataType { + pub kind: Symbol, + pub payload: UsedEventDataType, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventWithDataType { + #[inline] + fn clone(&self) -> UsedEventWithDataType { + UsedEventWithDataType { + kind: ::core::clone::Clone::clone(&self.kind), + payload: ::core::clone::Clone::clone(&self.payload), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventWithDataType { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UsedEventWithDataType", + "kind", + &self.kind, + "payload", + &&self.payload, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventWithDataType { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventWithDataType {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventWithDataType { + #[inline] + fn eq(&self, other: &UsedEventWithDataType) -> bool { + self.kind == other.kind && self.payload == other.payload + } +} +pub static __SPEC_XDR_EVENT_USEDEVENTWITHDATATYPE: [u8; 152usize] = + UsedEventWithDataType::spec_xdr(); +impl UsedEventWithDataType { + pub const fn spec_xdr() -> [u8; 152usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x15UsedEventWithDataType\0\0\0\0\0\0\x01\0\0\0\x19used_event_with_data_type\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x11UsedEventDataType\0\0\0\0\0\0\0\0\0\0\x02" + } +} +impl soroban_sdk::Event for UsedEventWithDataType { + fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { + use soroban_sdk::IntoVal; + ( + &{ soroban_sdk::Symbol::new(env, "used_event_with_data_type") }, + { + let v: soroban_sdk::Val = self.kind.into_val(env); + v + }, + ) + .into_val(env) + } + fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { + use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; + const KEYS: [&'static str; 1usize] = ["payload"]; + let vals: [soroban_sdk::Val; 1usize] = [self.payload.into_val(env)]; + env.map_new_from_slices(&KEYS, &vals) + .unwrap_infallible() + .into() + } +} +impl UsedEventWithDataType { + pub fn publish(&self, env: &soroban_sdk::Env) { + <_ as soroban_sdk::Event>::publish(self, env); + } +} +pub struct UsedEventTopicOuter { + pub inner: UsedEventTopicInner, } #[automatically_derived] -impl ::core::clone::Clone for UsedVecElement { +impl ::core::clone::Clone for UsedEventTopicOuter { #[inline] - fn clone(&self) -> UsedVecElement { - UsedVecElement { - data: ::core::clone::Clone::clone(&self.data), + fn clone(&self) -> UsedEventTopicOuter { + UsedEventTopicOuter { + inner: ::core::clone::Clone::clone(&self.inner), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedVecElement { +impl ::core::fmt::Debug for UsedEventTopicOuter { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedVecElement", "data", &&self.data) + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedEventTopicOuter", + "inner", + &&self.inner, + ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedVecElement { +impl ::core::cmp::Eq for UsedEventTopicOuter { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedVecElement {} +impl ::core::marker::StructuralPartialEq for UsedEventTopicOuter {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedVecElement { +impl ::core::cmp::PartialEq for UsedEventTopicOuter { #[inline] - fn eq(&self, other: &UsedVecElement) -> bool { - self.data == other.data + fn eq(&self, other: &UsedEventTopicOuter) -> bool { + self.inner == other.inner } } -pub static __SPEC_XDR_TYPE_USEDVECELEMENT: [u8; 52usize] = UsedVecElement::spec_xdr(); -impl UsedVecElement { - pub const fn spec_xdr() -> [u8; 52usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0eUsedVecElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDEVENTTOPICOUTER: [u8; 84usize] = UsedEventTopicOuter::spec_xdr(); +impl UsedEventTopicOuter { + pub const fn spec_xdr() -> [u8; 84usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedEventTopicOuter\0\0\0\0\x01\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x13UsedEventTopicInner\0" } } -impl soroban_sdk::TryFromVal for UsedVecElement { +impl soroban_sdk::TryFromVal for UsedEventTopicOuter { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; + const KEYS: [&'static str; 1usize] = ["inner"]; let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - data: vals[0] + inner: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedVecElement, + val: &UsedEventTopicOuter, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; - let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; + const KEYS: [&'static str; 1usize] = ["inner"]; + let vals: [Val; 1usize] = [(&val.inner) + .try_into_val(env) + .map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedVecElement, + val: &&UsedEventTopicOuter, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) } } -impl soroban_sdk::TryFromVal for UsedVecElement { +impl soroban_sdk::TryFromVal for UsedEventTopicOuter { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -2316,9 +6428,9 @@ impl soroban_sdk::TryFromVal for Used } map.validate()?; Ok(Self { - data: { + inner: { let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "data" + "inner" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) @@ -2335,7 +6447,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedVecElement { +impl soroban_sdk::TryFromVal for UsedEventTopicOuter { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -2349,115 +6461,116 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedVecElement> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedEventTopicOuter> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedVecElement) -> Result { + fn try_from(val: &UsedEventTopicOuter) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ soroban_sdk::xdr::ScMapEntry { key: soroban_sdk::xdr::ScSymbol( - "data" + "inner" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(), - val: (&val.data) + val: (&val.inner) .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, }, ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedVecElement) -> Result { + fn try_from(val: UsedEventTopicOuter) -> Result { (&val).try_into() } } -impl TryFrom<&UsedVecElement> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedEventTopicOuter> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedVecElement) -> Result { + fn try_from(val: &UsedEventTopicOuter) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedVecElement) -> Result { + fn try_from(val: UsedEventTopicOuter) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedVecElement { - data: ::Prototype, + pub struct ArbitraryUsedEventTopicOuter { + inner: + ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedVecElement { + impl ::core::fmt::Debug for ArbitraryUsedEventTopicOuter { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedVecElement", - "data", - &&self.data, + "ArbitraryUsedEventTopicOuter", + "inner", + &&self.inner, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedVecElement { + impl ::core::clone::Clone for ArbitraryUsedEventTopicOuter { #[inline] - fn clone(&self) -> ArbitraryUsedVecElement { - ArbitraryUsedVecElement { - data: ::core::clone::Clone::clone(&self.data), + fn clone(&self) -> ArbitraryUsedEventTopicOuter { + ArbitraryUsedEventTopicOuter { + inner: ::core::clone::Clone::clone(&self.inner), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedVecElement { + impl ::core::cmp::Eq for ArbitraryUsedEventTopicOuter { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq< - ::Prototype, + ::Prototype, >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedVecElement {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventTopicOuter {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedVecElement { + impl ::core::cmp::PartialEq for ArbitraryUsedEventTopicOuter { #[inline] - fn eq(&self, other: &ArbitraryUsedVecElement) -> bool { - self.data == other.data + fn eq(&self, other: &ArbitraryUsedEventTopicOuter) -> bool { + self.inner == other.inner } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedVecElement { + impl ::core::cmp::Ord for ArbitraryUsedEventTopicOuter { #[inline] - fn cmp(&self, other: &ArbitraryUsedVecElement) -> ::core::cmp::Ordering { - ::core::cmp::Ord::cmp(&self.data, &other.data) + fn cmp(&self, other: &ArbitraryUsedEventTopicOuter) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.inner, &other.inner) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedVecElement { + impl ::core::cmp::PartialOrd for ArbitraryUsedEventTopicOuter { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedVecElement, + other: &ArbitraryUsedEventTopicOuter, ) -> ::core::option::Option<::core::cmp::Ordering> { - ::core::cmp::PartialOrd::partial_cmp(&self.data, &other.data) + ::core::cmp::PartialOrd::partial_cmp(&self.inner, &other.inner) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedVecElement: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -2491,11 +6604,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedVecElement { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventTopicOuter { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedVecElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -2504,12 +6617,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedVecElement { - data: arbitrary::Arbitrary::arbitrary(u)?, + Ok(ArbitraryUsedEventTopicOuter { + inner: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedVecElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter.with(|count| { count.set(count.get() - 1); }); } @@ -2520,7 +6633,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedVecElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -2529,12 +6642,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedVecElement { - data: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + Ok(ArbitraryUsedEventTopicOuter { + inner: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedVecElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter.with(|count| { count.set(count.get() - 1); }); } @@ -2545,7 +6658,7 @@ const _: () = { arbitrary::size_hint::recursion_guard(depth, |depth| { arbitrary::size_hint::and_all( &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( + <::Prototype as arbitrary::Arbitrary>::size_hint( depth, ), ], @@ -2554,220 +6667,276 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedVecElement { - type Prototype = ArbitraryUsedVecElement; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventTopicOuter { + type Prototype = ArbitraryUsedEventTopicOuter; } - impl soroban_sdk::TryFromVal for UsedVecElement { + impl soroban_sdk::TryFromVal + for UsedEventTopicOuter + { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedVecElement, + v: &ArbitraryUsedEventTopicOuter, ) -> std::result::Result { - Ok(UsedVecElement { - data: soroban_sdk::IntoVal::into_val(&v.data, env), + Ok(UsedEventTopicOuter { + inner: soroban_sdk::IntoVal::into_val(&v.inner, env), }) } } }; -pub enum UsedMapKey { - K1 = 1, - K2 = 2, +pub struct UsedEventTopicInner { + pub val: u32, } #[automatically_derived] -impl ::core::marker::Copy for UsedMapKey {} -#[automatically_derived] -impl ::core::clone::Clone for UsedMapKey { +impl ::core::clone::Clone for UsedEventTopicInner { #[inline] - fn clone(&self) -> UsedMapKey { - *self + fn clone(&self) -> UsedEventTopicInner { + UsedEventTopicInner { + val: ::core::clone::Clone::clone(&self.val), + } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedMapKey { +impl ::core::fmt::Debug for UsedEventTopicInner { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( + ::core::fmt::Formatter::debug_struct_field1_finish( f, - match self { - UsedMapKey::K1 => "K1", - UsedMapKey::K2 => "K2", - }, + "UsedEventTopicInner", + "val", + &&self.val, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedMapKey { +impl ::core::cmp::Eq for UsedEventTopicInner { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedMapKey {} +impl ::core::marker::StructuralPartialEq for UsedEventTopicInner {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedMapKey { +impl ::core::cmp::PartialEq for UsedEventTopicInner { #[inline] - fn eq(&self, other: &UsedMapKey) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr + fn eq(&self, other: &UsedEventTopicInner) -> bool { + self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDMAPKEY: [u8; 64usize] = UsedMapKey::spec_xdr(); -impl UsedMapKey { - pub const fn spec_xdr() -> [u8; 64usize] { - *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\nUsedMapKey\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02K1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02K2\0\0\0\0\0\x02" +pub static __SPEC_XDR_TYPE_USEDEVENTTOPICINNER: [u8; 56usize] = UsedEventTopicInner::spec_xdr(); +impl UsedEventTopicInner { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedEventTopicInner\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::TryFromVal for UsedMapKey { +impl soroban_sdk::TryFromVal for UsedEventTopicInner { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &soroban_sdk::Val, + val: &UsedEventTopicInner, ) -> Result { - use soroban_sdk::TryIntoVal; - let discriminant: u32 = val.try_into_val(env)?; - Ok(match discriminant { - 1u32 => Self::K1, - 2u32 => Self::K2, - _ => Err(soroban_sdk::ConversionError {})?, - }) + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedMapKey, + val: &&UsedEventTopicInner, ) -> Result { - Ok(match val { - UsedMapKey::K1 => 1u32.into(), - UsedMapKey::K2 => 2u32.into(), - }) + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; +impl soroban_sdk::TryFromVal for UsedEventTopicInner { + type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedMapKey, - ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + val: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "val" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) } } -impl soroban_sdk::TryFromVal for UsedMapKey { +impl soroban_sdk::TryFromVal for UsedEventTopicInner { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::xdr::ScVal, ) -> Result { - if let soroban_sdk::xdr::ScVal::U32(discriminant) = val { - Ok(match *discriminant { - 1u32 => Self::K1, - 2u32 => Self::K2, - _ => Err(soroban_sdk::xdr::Error::Invalid)?, - }) + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) } else { Err(soroban_sdk::xdr::Error::Invalid) } } } -impl TryInto for &UsedMapKey { +impl TryFrom<&UsedEventTopicInner> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_into(self) -> Result { - Ok(match self { - UsedMapKey::K1 => 1u32.into(), - UsedMapKey::K2 => 2u32.into(), - }) + fn try_from(val: &UsedEventTopicInner) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "val" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.val) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) } } -impl TryInto for UsedMapKey { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_into(self) -> Result { - Ok(match self { - UsedMapKey::K1 => 1u32.into(), - UsedMapKey::K2 => 2u32.into(), - }) + fn try_from(val: UsedEventTopicInner) -> Result { + (&val).try_into() + } +} +impl TryFrom<&UsedEventTopicInner> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedEventTopicInner) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedEventTopicInner) -> Result { + (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub enum ArbitraryUsedMapKey { - K1, - K2, + pub struct ArbitraryUsedEventTopicInner { + val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedMapKey { + impl ::core::fmt::Debug for ArbitraryUsedEventTopicInner { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( + ::core::fmt::Formatter::debug_struct_field1_finish( f, - match self { - ArbitraryUsedMapKey::K1 => "K1", - ArbitraryUsedMapKey::K2 => "K2", - }, + "ArbitraryUsedEventTopicInner", + "val", + &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedMapKey { + impl ::core::clone::Clone for ArbitraryUsedEventTopicInner { #[inline] - fn clone(&self) -> ArbitraryUsedMapKey { - match self { - ArbitraryUsedMapKey::K1 => ArbitraryUsedMapKey::K1, - ArbitraryUsedMapKey::K2 => ArbitraryUsedMapKey::K2, + fn clone(&self) -> ArbitraryUsedEventTopicInner { + ArbitraryUsedEventTopicInner { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedMapKey { + impl ::core::cmp::Eq for ArbitraryUsedEventTopicInner { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedMapKey {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventTopicInner {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedMapKey { + impl ::core::cmp::PartialEq for ArbitraryUsedEventTopicInner { #[inline] - fn eq(&self, other: &ArbitraryUsedMapKey) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr + fn eq(&self, other: &ArbitraryUsedEventTopicInner) -> bool { + self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedMapKey { + impl ::core::cmp::Ord for ArbitraryUsedEventTopicInner { #[inline] - fn cmp(&self, other: &ArbitraryUsedMapKey) -> ::core::cmp::Ordering { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) + fn cmp(&self, other: &ArbitraryUsedEventTopicInner) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedMapKey { + impl ::core::cmp::PartialOrd for ArbitraryUsedEventTopicInner { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedMapKey, + other: &ArbitraryUsedEventTopicInner, ) -> ::core::option::Option<::core::cmp::Ordering> { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr) + ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedMapKey: ::std::thread::LocalKey> = { + const RECURSIVE_COUNT_ArbitraryUsedEventTopicInner: ::std::thread::LocalKey< + std::cell::Cell, + > = { #[inline] fn __init() -> std::cell::Cell { std::cell::Cell::new(0) @@ -2799,11 +6968,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedMapKey { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventTopicInner { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedMapKey.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventTopicInner.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -2812,19 +6981,12 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(u)?) * 2u64) >> 32 - { - 0u64 => ArbitraryUsedMapKey::K1, - 1u64 => ArbitraryUsedMapKey::K2, - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryUsedEventTopicInner { + val: arbitrary::Arbitrary::arbitrary(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedMapKey.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventTopicInner.with(|count| { count.set(count.get() - 1); }); } @@ -2835,7 +6997,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedMapKey.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventTopicInner.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -2844,20 +7006,12 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(&mut u)?) * 2u64) - >> 32 - { - 0u64 => ArbitraryUsedMapKey::K1, - 1u64 => ArbitraryUsedMapKey::K2, - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryUsedEventTopicInner { + val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedMapKey.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventTopicInner.with(|count| { count.set(count.get() - 1); }); } @@ -2865,122 +7019,212 @@ const _: () = { } #[inline] fn size_hint(depth: usize) -> (usize, Option) { - arbitrary::size_hint::and( - ::size_hint(depth), - arbitrary::size_hint::recursion_guard(depth, |depth| { - arbitrary::size_hint::or_all(&[ - arbitrary::size_hint::and_all(&[]), - arbitrary::size_hint::and_all(&[]), - ]) - }), - ) + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedMapKey { - type Prototype = ArbitraryUsedMapKey; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventTopicInner { + type Prototype = ArbitraryUsedEventTopicInner; } - impl soroban_sdk::TryFromVal for UsedMapKey { + impl soroban_sdk::TryFromVal + for UsedEventTopicInner + { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedMapKey, + v: &ArbitraryUsedEventTopicInner, ) -> std::result::Result { - Ok(match v { - ArbitraryUsedMapKey::K1 => UsedMapKey::K1, - ArbitraryUsedMapKey::K2 => UsedMapKey::K2, + Ok(UsedEventTopicInner { + val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } -}; -pub struct UsedMapVal { - pub v: u32, +}; +pub struct UsedEventWithNestedTopic { + pub info: UsedEventTopicOuter, + pub amount: i128, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventWithNestedTopic { + #[inline] + fn clone(&self) -> UsedEventWithNestedTopic { + UsedEventWithNestedTopic { + info: ::core::clone::Clone::clone(&self.info), + amount: ::core::clone::Clone::clone(&self.amount), + } + } } #[automatically_derived] -impl ::core::clone::Clone for UsedMapVal { +impl ::core::fmt::Debug for UsedEventWithNestedTopic { #[inline] - fn clone(&self) -> UsedMapVal { - UsedMapVal { - v: ::core::clone::Clone::clone(&self.v), + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UsedEventWithNestedTopic", + "info", + &self.info, + "amount", + &&self.amount, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventWithNestedTopic { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventWithNestedTopic {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventWithNestedTopic { + #[inline] + fn eq(&self, other: &UsedEventWithNestedTopic) -> bool { + self.amount == other.amount && self.info == other.info + } +} +pub static __SPEC_XDR_EVENT_USEDEVENTWITHNESTEDTOPIC: [u8; 152usize] = + UsedEventWithNestedTopic::spec_xdr(); +impl UsedEventWithNestedTopic { + pub const fn spec_xdr() -> [u8; 152usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x18UsedEventWithNestedTopic\0\0\0\x01\0\0\0\x1cused_event_with_nested_topic\0\0\0\x02\0\0\0\0\0\0\0\x04info\0\0\x07\xd0\0\0\0\x13UsedEventTopicOuter\0\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" + } +} +impl soroban_sdk::Event for UsedEventWithNestedTopic { + fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { + use soroban_sdk::IntoVal; + ( + &{ soroban_sdk::Symbol::new(env, "used_event_with_nested_topic") }, + { + let v: soroban_sdk::Val = self.info.into_val(env); + v + }, + ) + .into_val(env) + } + fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { + use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; + const KEYS: [&'static str; 1usize] = ["amount"]; + let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; + env.map_new_from_slices(&KEYS, &vals) + .unwrap_infallible() + .into() + } +} +impl UsedEventWithNestedTopic { + pub fn publish(&self, env: &soroban_sdk::Env) { + <_ as soroban_sdk::Event>::publish(self, env); + } +} +pub struct UsedEventDataOuter { + pub inner: UsedEventDataInner, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventDataOuter { + #[inline] + fn clone(&self) -> UsedEventDataOuter { + UsedEventDataOuter { + inner: ::core::clone::Clone::clone(&self.inner), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedMapVal { +impl ::core::fmt::Debug for UsedEventDataOuter { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedMapVal", "v", &&self.v) + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedEventDataOuter", + "inner", + &&self.inner, + ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedMapVal { +impl ::core::cmp::Eq for UsedEventDataOuter { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedMapVal {} +impl ::core::marker::StructuralPartialEq for UsedEventDataOuter {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedMapVal { +impl ::core::cmp::PartialEq for UsedEventDataOuter { #[inline] - fn eq(&self, other: &UsedMapVal) -> bool { - self.v == other.v + fn eq(&self, other: &UsedEventDataOuter) -> bool { + self.inner == other.inner } } -pub static __SPEC_XDR_TYPE_USEDMAPVAL: [u8; 48usize] = UsedMapVal::spec_xdr(); -impl UsedMapVal { - pub const fn spec_xdr() -> [u8; 48usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\nUsedMapVal\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDEVENTDATAOUTER: [u8; 84usize] = UsedEventDataOuter::spec_xdr(); +impl UsedEventDataOuter { + pub const fn spec_xdr() -> [u8; 84usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventDataOuter\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x12UsedEventDataInner\0\0" } } -impl soroban_sdk::TryFromVal for UsedMapVal { +impl soroban_sdk::TryFromVal for UsedEventDataOuter { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["v"]; + const KEYS: [&'static str; 1usize] = ["inner"]; let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - v: vals[0] + inner: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedMapVal, + val: &UsedEventDataOuter, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["v"]; - let vals: [Val; 1usize] = [(&val.v).try_into_val(env).map_err(|_| ConversionError)?]; + const KEYS: [&'static str; 1usize] = ["inner"]; + let vals: [Val; 1usize] = [(&val.inner) + .try_into_val(env) + .map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedMapVal, + val: &&UsedEventDataOuter, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) } } -impl soroban_sdk::TryFromVal for UsedMapVal { +impl soroban_sdk::TryFromVal for UsedEventDataOuter { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -2995,9 +7239,10 @@ impl soroban_sdk::TryFromVal for Used } map.validate()?; Ok(Self { - v: { + inner: { let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "v".try_into() + "inner" + .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(); @@ -3013,7 +7258,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedMapVal { +impl soroban_sdk::TryFromVal for UsedEventDataOuter { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -3027,114 +7272,118 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedMapVal> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedEventDataOuter> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedMapVal) -> Result { + fn try_from(val: &UsedEventDataOuter) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ soroban_sdk::xdr::ScMapEntry { key: soroban_sdk::xdr::ScSymbol( - "v".try_into() + "inner" + .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(), - val: (&val.v) + val: (&val.inner) .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, }, ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedMapVal) -> Result { + fn try_from(val: UsedEventDataOuter) -> Result { (&val).try_into() } } -impl TryFrom<&UsedMapVal> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedEventDataOuter> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedMapVal) -> Result { + fn try_from(val: &UsedEventDataOuter) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedMapVal) -> Result { + fn try_from(val: UsedEventDataOuter) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedMapVal { - v: ::Prototype, + pub struct ArbitraryUsedEventDataOuter { + inner: + ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedMapVal { + impl ::core::fmt::Debug for ArbitraryUsedEventDataOuter { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedMapVal", - "v", - &&self.v, + "ArbitraryUsedEventDataOuter", + "inner", + &&self.inner, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedMapVal { + impl ::core::clone::Clone for ArbitraryUsedEventDataOuter { #[inline] - fn clone(&self) -> ArbitraryUsedMapVal { - ArbitraryUsedMapVal { - v: ::core::clone::Clone::clone(&self.v), + fn clone(&self) -> ArbitraryUsedEventDataOuter { + ArbitraryUsedEventDataOuter { + inner: ::core::clone::Clone::clone(&self.inner), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedMapVal { + impl ::core::cmp::Eq for ArbitraryUsedEventDataOuter { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq< - ::Prototype, + ::Prototype, >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedMapVal {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventDataOuter {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedMapVal { + impl ::core::cmp::PartialEq for ArbitraryUsedEventDataOuter { #[inline] - fn eq(&self, other: &ArbitraryUsedMapVal) -> bool { - self.v == other.v + fn eq(&self, other: &ArbitraryUsedEventDataOuter) -> bool { + self.inner == other.inner } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedMapVal { + impl ::core::cmp::Ord for ArbitraryUsedEventDataOuter { #[inline] - fn cmp(&self, other: &ArbitraryUsedMapVal) -> ::core::cmp::Ordering { - ::core::cmp::Ord::cmp(&self.v, &other.v) + fn cmp(&self, other: &ArbitraryUsedEventDataOuter) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.inner, &other.inner) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedMapVal { + impl ::core::cmp::PartialOrd for ArbitraryUsedEventDataOuter { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedMapVal, + other: &ArbitraryUsedEventDataOuter, ) -> ::core::option::Option<::core::cmp::Ordering> { - ::core::cmp::PartialOrd::partial_cmp(&self.v, &other.v) + ::core::cmp::PartialOrd::partial_cmp(&self.inner, &other.inner) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedMapVal: ::std::thread::LocalKey> = { + const RECURSIVE_COUNT_ArbitraryUsedEventDataOuter: ::std::thread::LocalKey< + std::cell::Cell, + > = { #[inline] fn __init() -> std::cell::Cell { std::cell::Cell::new(0) @@ -3166,11 +7415,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedMapVal { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventDataOuter { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedMapVal.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataOuter.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -3179,12 +7428,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedMapVal { - v: arbitrary::Arbitrary::arbitrary(u)?, + Ok(ArbitraryUsedEventDataOuter { + inner: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedMapVal.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataOuter.with(|count| { count.set(count.get() - 1); }); } @@ -3195,7 +7444,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedMapVal.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataOuter.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -3204,12 +7453,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedMapVal { - v: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + Ok(ArbitraryUsedEventDataOuter { + inner: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedMapVal.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataOuter.with(|count| { count.set(count.get() - 1); }); } @@ -3220,7 +7469,7 @@ const _: () = { arbitrary::size_hint::recursion_guard(depth, |depth| { arbitrary::size_hint::and_all( &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( + <::Prototype as arbitrary::Arbitrary>::size_hint( depth, ), ], @@ -3229,47 +7478,47 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedMapVal { - type Prototype = ArbitraryUsedMapVal; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventDataOuter { + type Prototype = ArbitraryUsedEventDataOuter; } - impl soroban_sdk::TryFromVal for UsedMapVal { + impl soroban_sdk::TryFromVal for UsedEventDataOuter { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedMapVal, + v: &ArbitraryUsedEventDataOuter, ) -> std::result::Result { - Ok(UsedMapVal { - v: soroban_sdk::IntoVal::into_val(&v.v, env), + Ok(UsedEventDataOuter { + inner: soroban_sdk::IntoVal::into_val(&v.inner, env), }) } } }; -pub struct UsedOptionElement { - pub data: u32, +pub struct UsedEventDataInner { + pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedOptionElement { +impl ::core::clone::Clone for UsedEventDataInner { #[inline] - fn clone(&self) -> UsedOptionElement { - UsedOptionElement { - data: ::core::clone::Clone::clone(&self.data), + fn clone(&self) -> UsedEventDataInner { + UsedEventDataInner { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedOptionElement { +impl ::core::fmt::Debug for UsedEventDataInner { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedOptionElement", - "data", - &&self.data, + "UsedEventDataInner", + "val", + &&self.val, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedOptionElement { +impl ::core::cmp::Eq for UsedEventDataInner { #[inline] #[doc(hidden)] #[coverage(off)] @@ -3278,65 +7527,67 @@ impl ::core::cmp::Eq for UsedOptionElement { } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedOptionElement {} +impl ::core::marker::StructuralPartialEq for UsedEventDataInner {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedOptionElement { +impl ::core::cmp::PartialEq for UsedEventDataInner { #[inline] - fn eq(&self, other: &UsedOptionElement) -> bool { - self.data == other.data + fn eq(&self, other: &UsedEventDataInner) -> bool { + self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDOPTIONELEMENT: [u8; 56usize] = UsedOptionElement::spec_xdr(); -impl UsedOptionElement { +pub static __SPEC_XDR_TYPE_USEDEVENTDATAINNER: [u8; 56usize] = UsedEventDataInner::spec_xdr(); +impl UsedEventDataInner { pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedOptionElement\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventDataInner\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::TryFromVal for UsedOptionElement { +impl soroban_sdk::TryFromVal for UsedEventDataInner { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; + const KEYS: [&'static str; 1usize] = ["val"]; let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - data: vals[0] + val: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedOptionElement, + val: &UsedEventDataInner, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; - let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedOptionElement, + val: &&UsedEventDataInner, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) } } -impl soroban_sdk::TryFromVal for UsedOptionElement { +impl soroban_sdk::TryFromVal for UsedEventDataInner { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -3351,9 +7602,9 @@ impl soroban_sdk::TryFromVal for Used } map.validate()?; Ok(Self { - data: { + val: { let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "data" + "val" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) @@ -3370,7 +7621,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedOptionElement { +impl soroban_sdk::TryFromVal for UsedEventDataInner { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -3384,77 +7635,77 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedOptionElement> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedEventDataInner> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedOptionElement) -> Result { + fn try_from(val: &UsedEventDataInner) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ soroban_sdk::xdr::ScMapEntry { key: soroban_sdk::xdr::ScSymbol( - "data" + "val" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(), - val: (&val.data) + val: (&val.val) .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, }, ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedOptionElement) -> Result { + fn try_from(val: UsedEventDataInner) -> Result { (&val).try_into() } } -impl TryFrom<&UsedOptionElement> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedEventDataInner> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedOptionElement) -> Result { + fn try_from(val: &UsedEventDataInner) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedOptionElement) -> Result { + fn try_from(val: UsedEventDataInner) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedOptionElement { - data: ::Prototype, + pub struct ArbitraryUsedEventDataInner { + val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedOptionElement { + impl ::core::fmt::Debug for ArbitraryUsedEventDataInner { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedOptionElement", - "data", - &&self.data, + "ArbitraryUsedEventDataInner", + "val", + &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedOptionElement { + impl ::core::clone::Clone for ArbitraryUsedEventDataInner { #[inline] - fn clone(&self) -> ArbitraryUsedOptionElement { - ArbitraryUsedOptionElement { - data: ::core::clone::Clone::clone(&self.data), + fn clone(&self) -> ArbitraryUsedEventDataInner { + ArbitraryUsedEventDataInner { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedOptionElement { + impl ::core::cmp::Eq for ArbitraryUsedEventDataInner { #[inline] #[doc(hidden)] #[coverage(off)] @@ -3465,34 +7716,34 @@ const _: () = { } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedOptionElement {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventDataInner {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedOptionElement { + impl ::core::cmp::PartialEq for ArbitraryUsedEventDataInner { #[inline] - fn eq(&self, other: &ArbitraryUsedOptionElement) -> bool { - self.data == other.data + fn eq(&self, other: &ArbitraryUsedEventDataInner) -> bool { + self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedOptionElement { + impl ::core::cmp::Ord for ArbitraryUsedEventDataInner { #[inline] - fn cmp(&self, other: &ArbitraryUsedOptionElement) -> ::core::cmp::Ordering { - ::core::cmp::Ord::cmp(&self.data, &other.data) + fn cmp(&self, other: &ArbitraryUsedEventDataInner) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedOptionElement { + impl ::core::cmp::PartialOrd for ArbitraryUsedEventDataInner { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedOptionElement, + other: &ArbitraryUsedEventDataInner, ) -> ::core::option::Option<::core::cmp::Ordering> { - ::core::cmp::PartialOrd::partial_cmp(&self.data, &other.data) + ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedOptionElement: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedEventDataInner: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -3526,11 +7777,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedOptionElement { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventDataInner { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedOptionElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataInner.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -3539,12 +7790,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedOptionElement { - data: arbitrary::Arbitrary::arbitrary(u)?, + Ok(ArbitraryUsedEventDataInner { + val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedOptionElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataInner.with(|count| { count.set(count.get() - 1); }); } @@ -3555,7 +7806,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedOptionElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataInner.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -3564,12 +7815,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedOptionElement { - data: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + Ok(ArbitraryUsedEventDataInner { + val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedOptionElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataInner.with(|count| { count.set(count.get() - 1); }); } @@ -3589,265 +7840,302 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedOptionElement { - type Prototype = ArbitraryUsedOptionElement; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventDataInner { + type Prototype = ArbitraryUsedEventDataInner; } - impl soroban_sdk::TryFromVal for UsedOptionElement { + impl soroban_sdk::TryFromVal for UsedEventDataInner { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedOptionElement, + v: &ArbitraryUsedEventDataInner, ) -> std::result::Result { - Ok(UsedOptionElement { - data: soroban_sdk::IntoVal::into_val(&v.data, env), + Ok(UsedEventDataInner { + val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -pub struct UsedResultOk { - pub data: u32, +pub struct UsedEventWithNestedData { + pub kind: Symbol, + pub payload: UsedEventDataOuter, } #[automatically_derived] -impl ::core::clone::Clone for UsedResultOk { +impl ::core::clone::Clone for UsedEventWithNestedData { #[inline] - fn clone(&self) -> UsedResultOk { - UsedResultOk { - data: ::core::clone::Clone::clone(&self.data), + fn clone(&self) -> UsedEventWithNestedData { + UsedEventWithNestedData { + kind: ::core::clone::Clone::clone(&self.kind), + payload: ::core::clone::Clone::clone(&self.payload), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedResultOk { +impl ::core::fmt::Debug for UsedEventWithNestedData { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedResultOk", "data", &&self.data) + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UsedEventWithNestedData", + "kind", + &self.kind, + "payload", + &&self.payload, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventWithNestedData { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventWithNestedData {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventWithNestedData { + #[inline] + fn eq(&self, other: &UsedEventWithNestedData) -> bool { + self.kind == other.kind && self.payload == other.payload + } +} +pub static __SPEC_XDR_EVENT_USEDEVENTWITHNESTEDDATA: [u8; 152usize] = + UsedEventWithNestedData::spec_xdr(); +impl UsedEventWithNestedData { + pub const fn spec_xdr() -> [u8; 152usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x17UsedEventWithNestedData\0\0\0\0\x01\0\0\0\x1bused_event_with_nested_data\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x12UsedEventDataOuter\0\0\0\0\0\0\0\0\0\x02" + } +} +impl soroban_sdk::Event for UsedEventWithNestedData { + fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { + use soroban_sdk::IntoVal; + ( + &{ soroban_sdk::Symbol::new(env, "used_event_with_nested_data") }, + { + let v: soroban_sdk::Val = self.kind.into_val(env); + v + }, + ) + .into_val(env) + } + fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { + use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; + const KEYS: [&'static str; 1usize] = ["payload"]; + let vals: [soroban_sdk::Val; 1usize] = [self.payload.into_val(env)]; + env.map_new_from_slices(&KEYS, &vals) + .unwrap_infallible() + .into() + } +} +impl UsedEventWithNestedData { + pub fn publish(&self, env: &soroban_sdk::Env) { + <_ as soroban_sdk::Event>::publish(self, env); + } +} +pub enum UsedRefTopicType { + Send = 1, + Recv = 2, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedRefTopicType {} +#[automatically_derived] +impl ::core::clone::Clone for UsedRefTopicType { + #[inline] + fn clone(&self) -> UsedRefTopicType { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedRefTopicType { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + UsedRefTopicType::Send => "Send", + UsedRefTopicType::Recv => "Recv", + }, + ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedResultOk { +impl ::core::cmp::Eq for UsedRefTopicType { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - } + fn assert_receiver_is_total_eq(&self) -> () {} } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedResultOk {} +impl ::core::marker::StructuralPartialEq for UsedRefTopicType {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedResultOk { +impl ::core::cmp::PartialEq for UsedRefTopicType { #[inline] - fn eq(&self, other: &UsedResultOk) -> bool { - self.data == other.data + fn eq(&self, other: &UsedRefTopicType) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr } } -pub static __SPEC_XDR_TYPE_USEDRESULTOK: [u8; 48usize] = UsedResultOk::spec_xdr(); -impl UsedResultOk { - pub const fn spec_xdr() -> [u8; 48usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0cUsedResultOk\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDREFTOPICTYPE: [u8; 68usize] = UsedRefTopicType::spec_xdr(); +impl UsedRefTopicType { + pub const fn spec_xdr() -> [u8; 68usize] { + *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x10UsedRefTopicType\0\0\0\x02\0\0\0\0\0\0\0\x04Send\0\0\0\x01\0\0\0\0\0\0\0\x04Recv\0\0\0\x02" } } -impl soroban_sdk::TryFromVal for UsedResultOk { +impl soroban_sdk::TryFromVal for UsedRefTopicType { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; - let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; - let map: MapObject = val.try_into().map_err(|_| ConversionError)?; - env.map_unpack_to_slice(map, &KEYS, &mut vals) - .map_err(|_| ConversionError)?; - Ok(Self { - data: vals[0] - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?, + use soroban_sdk::TryIntoVal; + let discriminant: u32 = val.try_into_val(env)?; + Ok(match discriminant { + 1u32 => Self::Send, + 2u32 => Self::Recv, + _ => Err(soroban_sdk::ConversionError {})?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedResultOk, + val: &UsedRefTopicType, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; - let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; - Ok(env - .map_new_from_slices(&KEYS, &vals) - .map_err(|_| ConversionError)? - .into()) + Ok(match val { + UsedRefTopicType::Send => 1u32.into(), + UsedRefTopicType::Recv => 2u32.into(), + }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedResultOk, + val: &&UsedRefTopicType, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) - } -} -impl soroban_sdk::TryFromVal for UsedResultOk { - type Error = soroban_sdk::xdr::Error; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &soroban_sdk::xdr::ScMap, - ) -> Result { - use soroban_sdk::xdr::Validate; - use soroban_sdk::TryIntoVal; - let map = val; - if map.len() != 1usize { - return Err(soroban_sdk::xdr::Error::Invalid); - } - map.validate()?; - Ok(Self { - data: { - let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "data" - .try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - ) - .into(); - let idx = map - .binary_search_by_key(&key, |entry| entry.key.clone()) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; - let rv: soroban_sdk::Val = (&map[idx].val.clone()) - .try_into_val(env) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; - rv.try_into_val(env) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)? - }, - }) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedResultOk { +impl soroban_sdk::TryFromVal for UsedRefTopicType { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::xdr::ScVal, ) -> Result { - if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { - <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + if let soroban_sdk::xdr::ScVal::U32(discriminant) = val { + Ok(match *discriminant { + 1u32 => Self::Send, + 2u32 => Self::Recv, + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) } else { Err(soroban_sdk::xdr::Error::Invalid) } } } -impl TryFrom<&UsedResultOk> for soroban_sdk::xdr::ScMap { - type Error = soroban_sdk::xdr::Error; - #[inline(always)] - fn try_from(val: &UsedResultOk) -> Result { - extern crate alloc; - use soroban_sdk::TryFromVal; - soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ - soroban_sdk::xdr::ScMapEntry { - key: soroban_sdk::xdr::ScSymbol( - "data" - .try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - ) - .into(), - val: (&val.data) - .try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - }, - ]))) - } -} -impl TryFrom for soroban_sdk::xdr::ScMap { - type Error = soroban_sdk::xdr::Error; - #[inline(always)] - fn try_from(val: UsedResultOk) -> Result { - (&val).try_into() - } -} -impl TryFrom<&UsedResultOk> for soroban_sdk::xdr::ScVal { +impl TryInto for &UsedRefTopicType { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedResultOk) -> Result { - Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + fn try_into(self) -> Result { + Ok(match self { + UsedRefTopicType::Send => 1u32.into(), + UsedRefTopicType::Recv => 2u32.into(), + }) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryInto for UsedRefTopicType { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedResultOk) -> Result { - (&val).try_into() + fn try_into(self) -> Result { + Ok(match self { + UsedRefTopicType::Send => 1u32.into(), + UsedRefTopicType::Recv => 2u32.into(), + }) } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedResultOk { - data: ::Prototype, + pub enum ArbitraryUsedRefTopicType { + Send, + Recv, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedResultOk { + impl ::core::fmt::Debug for ArbitraryUsedRefTopicType { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( + ::core::fmt::Formatter::write_str( f, - "ArbitraryUsedResultOk", - "data", - &&self.data, + match self { + ArbitraryUsedRefTopicType::Send => "Send", + ArbitraryUsedRefTopicType::Recv => "Recv", + }, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedResultOk { + impl ::core::clone::Clone for ArbitraryUsedRefTopicType { #[inline] - fn clone(&self) -> ArbitraryUsedResultOk { - ArbitraryUsedResultOk { - data: ::core::clone::Clone::clone(&self.data), + fn clone(&self) -> ArbitraryUsedRefTopicType { + match self { + ArbitraryUsedRefTopicType::Send => ArbitraryUsedRefTopicType::Send, + ArbitraryUsedRefTopicType::Recv => ArbitraryUsedRefTopicType::Recv, } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedResultOk { + impl ::core::cmp::Eq for ArbitraryUsedRefTopicType { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq< - ::Prototype, - >; - } + fn assert_receiver_is_total_eq(&self) -> () {} } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedResultOk {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedRefTopicType {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedResultOk { + impl ::core::cmp::PartialEq for ArbitraryUsedRefTopicType { #[inline] - fn eq(&self, other: &ArbitraryUsedResultOk) -> bool { - self.data == other.data + fn eq(&self, other: &ArbitraryUsedRefTopicType) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedResultOk { + impl ::core::cmp::Ord for ArbitraryUsedRefTopicType { #[inline] - fn cmp(&self, other: &ArbitraryUsedResultOk) -> ::core::cmp::Ordering { - ::core::cmp::Ord::cmp(&self.data, &other.data) + fn cmp(&self, other: &ArbitraryUsedRefTopicType) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedResultOk { + impl ::core::cmp::PartialOrd for ArbitraryUsedRefTopicType { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedResultOk, + other: &ArbitraryUsedRefTopicType, ) -> ::core::option::Option<::core::cmp::Ordering> { - ::core::cmp::PartialOrd::partial_cmp(&self.data, &other.data) + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedResultOk: ::std::thread::LocalKey> = { + const RECURSIVE_COUNT_ArbitraryUsedRefTopicType: ::std::thread::LocalKey< + std::cell::Cell, + > = { #[inline] fn __init() -> std::cell::Cell { std::cell::Cell::new(0) @@ -3879,11 +8167,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedResultOk { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedRefTopicType { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedResultOk.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefTopicType.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -3892,12 +8180,19 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedResultOk { - data: arbitrary::Arbitrary::arbitrary(u)?, - }) + Ok( + match (u64::from(::arbitrary(u)?) * 2u64) >> 32 + { + 0u64 => ArbitraryUsedRefTopicType::Send, + 1u64 => ArbitraryUsedRefTopicType::Recv, + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedResultOk.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefTopicType.with(|count| { count.set(count.get() - 1); }); } @@ -3908,7 +8203,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedResultOk.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefTopicType.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -3917,12 +8212,20 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedResultOk { - data: arbitrary::Arbitrary::arbitrary_take_rest(u)?, - }) + Ok( + match (u64::from(::arbitrary(&mut u)?) * 2u64) + >> 32 + { + 0u64 => ArbitraryUsedRefTopicType::Send, + 1u64 => ArbitraryUsedRefTopicType::Recv, + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedResultOk.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefTopicType.with(|count| { count.set(count.get() - 1); }); } @@ -3930,310 +8233,286 @@ const _: () = { } #[inline] fn size_hint(depth: usize) -> (usize, Option) { - arbitrary::size_hint::recursion_guard(depth, |depth| { - arbitrary::size_hint::and_all( - &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( - depth, - ), - ], - ) - }) + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all(&[ + arbitrary::size_hint::and_all(&[]), + arbitrary::size_hint::and_all(&[]), + ]) + }), + ) } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedResultOk { - type Prototype = ArbitraryUsedResultOk; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedRefTopicType { + type Prototype = ArbitraryUsedRefTopicType; } - impl soroban_sdk::TryFromVal for UsedResultOk { + impl soroban_sdk::TryFromVal for UsedRefTopicType { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedResultOk, + v: &ArbitraryUsedRefTopicType, ) -> std::result::Result { - Ok(UsedResultOk { - data: soroban_sdk::IntoVal::into_val(&v.data, env), + Ok(match v { + ArbitraryUsedRefTopicType::Send => UsedRefTopicType::Send, + ArbitraryUsedRefTopicType::Recv => UsedRefTopicType::Recv, }) } } }; -pub struct UsedEventSimple { - pub kind: Symbol, - pub amount: i128, +pub struct UsedRefDataType { + pub nested: UsedRefDataInner, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventSimple { +impl ::core::clone::Clone for UsedRefDataType { #[inline] - fn clone(&self) -> UsedEventSimple { - UsedEventSimple { - kind: ::core::clone::Clone::clone(&self.kind), - amount: ::core::clone::Clone::clone(&self.amount), + fn clone(&self) -> UsedRefDataType { + UsedRefDataType { + nested: ::core::clone::Clone::clone(&self.nested), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventSimple { +impl ::core::fmt::Debug for UsedRefDataType { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( + ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedEventSimple", - "kind", - &self.kind, - "amount", - &&self.amount, + "UsedRefDataType", + "nested", + &&self.nested, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventSimple { +impl ::core::cmp::Eq for UsedRefDataType { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventSimple {} +impl ::core::marker::StructuralPartialEq for UsedRefDataType {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventSimple { +impl ::core::cmp::PartialEq for UsedRefDataType { #[inline] - fn eq(&self, other: &UsedEventSimple) -> bool { - self.amount == other.amount && self.kind == other.kind + fn eq(&self, other: &UsedRefDataType) -> bool { + self.nested == other.nested } } -pub static __SPEC_XDR_EVENT_USEDEVENTSIMPLE: [u8; 112usize] = UsedEventSimple::spec_xdr(); -impl UsedEventSimple { - pub const fn spec_xdr() -> [u8; 112usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x0fUsedEventSimple\0\0\0\0\x01\0\0\0\x11used_event_simple\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" +pub static __SPEC_XDR_TYPE_USEDREFDATATYPE: [u8; 76usize] = UsedRefDataType::spec_xdr(); +impl UsedRefDataType { + pub const fn spec_xdr() -> [u8; 76usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fUsedRefDataType\0\0\0\0\x01\0\0\0\0\0\0\0\x06nested\0\0\0\0\x07\xd0\0\0\0\x10UsedRefDataInner" } } -impl soroban_sdk::Event for UsedEventSimple { - fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { - use soroban_sdk::IntoVal; - (&{ soroban_sdk::Symbol::new(env, "used_event_simple") }, { - let v: soroban_sdk::Val = self.kind.into_val(env); - v +impl soroban_sdk::TryFromVal for UsedRefDataType { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["nested"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + nested: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, }) - .into_val(env) - } - fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { - use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["amount"]; - let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; - env.map_new_from_slices(&KEYS, &vals) - .unwrap_infallible() - .into() - } -} -impl UsedEventSimple { - pub fn publish(&self, env: &soroban_sdk::Env) { - <_ as soroban_sdk::Event>::publish(self, env); - } -} -pub enum UsedEventTopicType { - Transfer = 1, - Mint = 2, -} -#[automatically_derived] -impl ::core::marker::Copy for UsedEventTopicType {} -#[automatically_derived] -impl ::core::clone::Clone for UsedEventTopicType { - #[inline] - fn clone(&self) -> UsedEventTopicType { - *self - } -} -#[automatically_derived] -impl ::core::fmt::Debug for UsedEventTopicType { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( - f, - match self { - UsedEventTopicType::Transfer => "Transfer", - UsedEventTopicType::Mint => "Mint", - }, - ) - } -} -#[automatically_derived] -impl ::core::cmp::Eq for UsedEventTopicType { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} -} -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventTopicType {} -#[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventTopicType { - #[inline] - fn eq(&self, other: &UsedEventTopicType) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr } } -pub static __SPEC_XDR_TYPE_USEDEVENTTOPICTYPE: [u8; 76usize] = UsedEventTopicType::spec_xdr(); -impl UsedEventTopicType { - pub const fn spec_xdr() -> [u8; 76usize] { - *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventTopicType\0\0\0\0\0\x02\0\0\0\0\0\0\0\x08Transfer\0\0\0\x01\0\0\0\0\0\0\0\x04Mint\0\0\0\x02" +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedRefDataType, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["nested"]; + let vals: [Val; 1usize] = [(&val.nested) + .try_into_val(env) + .map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) } } -impl soroban_sdk::TryFromVal for UsedEventTopicType { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &soroban_sdk::Val, + val: &&UsedRefDataType, ) -> Result { - use soroban_sdk::TryIntoVal; - let discriminant: u32 = val.try_into_val(env)?; - Ok(match discriminant { - 1u32 => Self::Transfer, - 2u32 => Self::Mint, - _ => Err(soroban_sdk::ConversionError {})?, - }) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; +impl soroban_sdk::TryFromVal for UsedRefDataType { + type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventTopicType, - ) -> Result { - Ok(match val { - UsedEventTopicType::Transfer => 1u32.into(), - UsedEventTopicType::Mint => 2u32.into(), + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + nested: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "nested" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; +impl soroban_sdk::TryFromVal for UsedRefDataType { + type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventTopicType, - ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryFrom<&UsedRefDataType> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedRefDataType) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "nested" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.nested) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) } } -impl soroban_sdk::TryFromVal for UsedEventTopicType { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &soroban_sdk::xdr::ScVal, - ) -> Result { - if let soroban_sdk::xdr::ScVal::U32(discriminant) = val { - Ok(match *discriminant { - 1u32 => Self::Transfer, - 2u32 => Self::Mint, - _ => Err(soroban_sdk::xdr::Error::Invalid)?, - }) - } else { - Err(soroban_sdk::xdr::Error::Invalid) - } + fn try_from(val: UsedRefDataType) -> Result { + (&val).try_into() } } -impl TryInto for &UsedEventTopicType { +impl TryFrom<&UsedRefDataType> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_into(self) -> Result { - Ok(match self { - UsedEventTopicType::Transfer => 1u32.into(), - UsedEventTopicType::Mint => 2u32.into(), - }) + fn try_from(val: &UsedRefDataType) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryInto for UsedEventTopicType { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_into(self) -> Result { - Ok(match self { - UsedEventTopicType::Transfer => 1u32.into(), - UsedEventTopicType::Mint => 2u32.into(), - }) + fn try_from(val: UsedRefDataType) -> Result { + (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub enum ArbitraryUsedEventTopicType { - Transfer, - Mint, + pub struct ArbitraryUsedRefDataType { + nested: + ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedEventTopicType { + impl ::core::fmt::Debug for ArbitraryUsedRefDataType { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( + ::core::fmt::Formatter::debug_struct_field1_finish( f, - match self { - ArbitraryUsedEventTopicType::Transfer => "Transfer", - ArbitraryUsedEventTopicType::Mint => "Mint", - }, + "ArbitraryUsedRefDataType", + "nested", + &&self.nested, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedEventTopicType { + impl ::core::clone::Clone for ArbitraryUsedRefDataType { #[inline] - fn clone(&self) -> ArbitraryUsedEventTopicType { - match self { - ArbitraryUsedEventTopicType::Transfer => ArbitraryUsedEventTopicType::Transfer, - ArbitraryUsedEventTopicType::Mint => ArbitraryUsedEventTopicType::Mint, + fn clone(&self) -> ArbitraryUsedRefDataType { + ArbitraryUsedRefDataType { + nested: ::core::clone::Clone::clone(&self.nested), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedEventTopicType { + impl ::core::cmp::Eq for ArbitraryUsedRefDataType { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventTopicType {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedRefDataType {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedEventTopicType { + impl ::core::cmp::PartialEq for ArbitraryUsedRefDataType { #[inline] - fn eq(&self, other: &ArbitraryUsedEventTopicType) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr + fn eq(&self, other: &ArbitraryUsedRefDataType) -> bool { + self.nested == other.nested } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedEventTopicType { + impl ::core::cmp::Ord for ArbitraryUsedRefDataType { #[inline] - fn cmp(&self, other: &ArbitraryUsedEventTopicType) -> ::core::cmp::Ordering { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) + fn cmp(&self, other: &ArbitraryUsedRefDataType) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.nested, &other.nested) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedEventTopicType { + impl ::core::cmp::PartialOrd for ArbitraryUsedRefDataType { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedEventTopicType, + other: &ArbitraryUsedRefDataType, ) -> ::core::option::Option<::core::cmp::Ordering> { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr) + ::core::cmp::PartialOrd::partial_cmp(&self.nested, &other.nested) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedEventTopicType: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedRefDataType: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -4267,11 +8546,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventTopicType { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedRefDataType { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefDataType.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -4280,19 +8559,12 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(u)?) * 2u64) >> 32 - { - 0u64 => ArbitraryUsedEventTopicType::Transfer, - 1u64 => ArbitraryUsedEventTopicType::Mint, - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryUsedRefDataType { + nested: arbitrary::Arbitrary::arbitrary(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefDataType.with(|count| { count.set(count.get() - 1); }); } @@ -4303,7 +8575,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefDataType.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -4312,20 +8584,12 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(&mut u)?) * 2u64) - >> 32 - { - 0u64 => ArbitraryUsedEventTopicType::Transfer, - 1u64 => ArbitraryUsedEventTopicType::Mint, - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryUsedRefDataType { + nested: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefDataType.with(|count| { count.set(count.get() - 1); }); } @@ -4333,144 +8597,54 @@ const _: () = { } #[inline] fn size_hint(depth: usize) -> (usize, Option) { - arbitrary::size_hint::and( - ::size_hint(depth), - arbitrary::size_hint::recursion_guard(depth, |depth| { - arbitrary::size_hint::or_all(&[ - arbitrary::size_hint::and_all(&[]), - arbitrary::size_hint::and_all(&[]), - ]) - }), - ) + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventTopicType { - type Prototype = ArbitraryUsedEventTopicType; - } - impl soroban_sdk::TryFromVal for UsedEventTopicType { - type Error = soroban_sdk::ConversionError; - fn try_from_val( - env: &soroban_sdk::Env, - v: &ArbitraryUsedEventTopicType, - ) -> std::result::Result { - Ok(match v { - ArbitraryUsedEventTopicType::Transfer => UsedEventTopicType::Transfer, - ArbitraryUsedEventTopicType::Mint => UsedEventTopicType::Mint, - }) - } - } -}; -pub struct UsedEventWithTopicType { - pub kind: UsedEventTopicType, - pub amount: i128, -} -#[automatically_derived] -impl ::core::clone::Clone for UsedEventWithTopicType { - #[inline] - fn clone(&self) -> UsedEventWithTopicType { - UsedEventWithTopicType { - kind: ::core::clone::Clone::clone(&self.kind), - amount: ::core::clone::Clone::clone(&self.amount), - } - } -} -#[automatically_derived] -impl ::core::fmt::Debug for UsedEventWithTopicType { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( - f, - "UsedEventWithTopicType", - "kind", - &self.kind, - "amount", - &&self.amount, - ) - } -} -#[automatically_derived] -impl ::core::cmp::Eq for UsedEventWithTopicType { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; - } -} -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventWithTopicType {} -#[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventWithTopicType { - #[inline] - fn eq(&self, other: &UsedEventWithTopicType) -> bool { - self.amount == other.amount && self.kind == other.kind - } -} -pub static __SPEC_XDR_EVENT_USEDEVENTWITHTOPICTYPE: [u8; 152usize] = - UsedEventWithTopicType::spec_xdr(); -impl UsedEventWithTopicType { - pub const fn spec_xdr() -> [u8; 152usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x16UsedEventWithTopicType\0\0\0\0\0\x01\0\0\0\x1aused_event_with_topic_type\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\x07\xd0\0\0\0\x12UsedEventTopicType\0\0\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" - } -} -impl soroban_sdk::Event for UsedEventWithTopicType { - fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { - use soroban_sdk::IntoVal; - ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_topic_type") }, - { - let v: soroban_sdk::Val = self.kind.into_val(env); - v - }, - ) - .into_val(env) - } - fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { - use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["amount"]; - let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; - env.map_new_from_slices(&KEYS, &vals) - .unwrap_infallible() - .into() - } -} -impl UsedEventWithTopicType { - pub fn publish(&self, env: &soroban_sdk::Env) { - <_ as soroban_sdk::Event>::publish(self, env); + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedRefDataType { + type Prototype = ArbitraryUsedRefDataType; } -} -pub struct UsedEventDataType { - pub x: u32, - pub y: u32, + impl soroban_sdk::TryFromVal for UsedRefDataType { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedRefDataType, + ) -> std::result::Result { + Ok(UsedRefDataType { + nested: soroban_sdk::IntoVal::into_val(&v.nested, env), + }) + } + } +}; +pub struct UsedRefDataInner { + pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventDataType { +impl ::core::clone::Clone for UsedRefDataInner { #[inline] - fn clone(&self) -> UsedEventDataType { - UsedEventDataType { - x: ::core::clone::Clone::clone(&self.x), - y: ::core::clone::Clone::clone(&self.y), + fn clone(&self) -> UsedRefDataInner { + UsedRefDataInner { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventDataType { +impl ::core::fmt::Debug for UsedRefDataInner { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( - f, - "UsedEventDataType", - "x", - &self.x, - "y", - &&self.y, - ) + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedRefDataInner", "val", &&self.val) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventDataType { +impl ::core::cmp::Eq for UsedRefDataInner { #[inline] #[doc(hidden)] #[coverage(off)] @@ -4479,71 +8653,65 @@ impl ::core::cmp::Eq for UsedEventDataType { } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventDataType {} +impl ::core::marker::StructuralPartialEq for UsedRefDataInner {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventDataType { +impl ::core::cmp::PartialEq for UsedRefDataInner { #[inline] - fn eq(&self, other: &UsedEventDataType) -> bool { - self.x == other.x && self.y == other.y + fn eq(&self, other: &UsedRefDataInner) -> bool { + self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDEVENTDATATYPE: [u8; 72usize] = UsedEventDataType::spec_xdr(); -impl UsedEventDataType { - pub const fn spec_xdr() -> [u8; 72usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedEventDataType\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x04\0\0\0\0\0\0\0\x01y\0\0\0\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDREFDATAINNER: [u8; 52usize] = UsedRefDataInner::spec_xdr(); +impl UsedRefDataInner { + pub const fn spec_xdr() -> [u8; 52usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedRefDataInner\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::TryFromVal for UsedEventDataType { +impl soroban_sdk::TryFromVal for UsedRefDataInner { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 2usize] = ["x", "y"]; - let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - x: vals[0] - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?, - y: vals[1] + val: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventDataType, + val: &UsedRefDataInner, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 2usize] = ["x", "y"]; - let vals: [Val; 2usize] = [ - (&val.x).try_into_val(env).map_err(|_| ConversionError)?, - (&val.y).try_into_val(env).map_err(|_| ConversionError)?, - ]; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventDataType, + val: &&UsedRefDataInner, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedEventDataType { +impl soroban_sdk::TryFromVal for UsedRefDataInner { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -4553,29 +8721,15 @@ impl soroban_sdk::TryFromVal for Used use soroban_sdk::xdr::Validate; use soroban_sdk::TryIntoVal; let map = val; - if map.len() != 2usize { + if map.len() != 1usize { return Err(soroban_sdk::xdr::Error::Invalid); } map.validate()?; Ok(Self { - x: { - let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "x".try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - ) - .into(); - let idx = map - .binary_search_by_key(&key, |entry| entry.key.clone()) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; - let rv: soroban_sdk::Val = (&map[idx].val.clone()) - .try_into_val(env) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; - rv.try_into_val(env) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)? - }, - y: { + val: { let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "y".try_into() + "val" + .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(); @@ -4591,7 +8745,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedEventDataType { +impl soroban_sdk::TryFromVal for UsedRefDataInner { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -4605,90 +8759,77 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedEventDataType> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedRefDataInner> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventDataType) -> Result { + fn try_from(val: &UsedRefDataInner) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ soroban_sdk::xdr::ScMapEntry { key: soroban_sdk::xdr::ScSymbol( - "x".try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - ) - .into(), - val: (&val.x) - .try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - }, - soroban_sdk::xdr::ScMapEntry { - key: soroban_sdk::xdr::ScSymbol( - "y".try_into() + "val" + .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(), - val: (&val.y) + val: (&val.val) .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, }, ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventDataType) -> Result { + fn try_from(val: UsedRefDataInner) -> Result { (&val).try_into() } } -impl TryFrom<&UsedEventDataType> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedRefDataInner> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventDataType) -> Result { + fn try_from(val: &UsedRefDataInner) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventDataType) -> Result { + fn try_from(val: UsedRefDataInner) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedEventDataType { - x: ::Prototype, - y: ::Prototype, + pub struct ArbitraryUsedRefDataInner { + val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedEventDataType { + impl ::core::fmt::Debug for ArbitraryUsedRefDataInner { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( + ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedEventDataType", - "x", - &self.x, - "y", - &&self.y, + "ArbitraryUsedRefDataInner", + "val", + &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedEventDataType { + impl ::core::clone::Clone for ArbitraryUsedRefDataInner { #[inline] - fn clone(&self) -> ArbitraryUsedEventDataType { - ArbitraryUsedEventDataType { - x: ::core::clone::Clone::clone(&self.x), - y: ::core::clone::Clone::clone(&self.y), + fn clone(&self) -> ArbitraryUsedRefDataInner { + ArbitraryUsedRefDataInner { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedEventDataType { + impl ::core::cmp::Eq for ArbitraryUsedRefDataInner { #[inline] #[doc(hidden)] #[coverage(off)] @@ -4696,48 +8837,37 @@ const _: () = { let _: ::core::cmp::AssertParamIsEq< ::Prototype, >; - let _: ::core::cmp::AssertParamIsEq< - ::Prototype, - >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventDataType {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedRefDataInner {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedEventDataType { + impl ::core::cmp::PartialEq for ArbitraryUsedRefDataInner { #[inline] - fn eq(&self, other: &ArbitraryUsedEventDataType) -> bool { - self.x == other.x && self.y == other.y + fn eq(&self, other: &ArbitraryUsedRefDataInner) -> bool { + self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedEventDataType { + impl ::core::cmp::Ord for ArbitraryUsedRefDataInner { #[inline] - fn cmp(&self, other: &ArbitraryUsedEventDataType) -> ::core::cmp::Ordering { - match ::core::cmp::Ord::cmp(&self.x, &other.x) { - ::core::cmp::Ordering::Equal => ::core::cmp::Ord::cmp(&self.y, &other.y), - cmp => cmp, - } + fn cmp(&self, other: &ArbitraryUsedRefDataInner) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedEventDataType { + impl ::core::cmp::PartialOrd for ArbitraryUsedRefDataInner { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedEventDataType, + other: &ArbitraryUsedRefDataInner, ) -> ::core::option::Option<::core::cmp::Ordering> { - match ::core::cmp::PartialOrd::partial_cmp(&self.x, &other.x) { - ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { - ::core::cmp::PartialOrd::partial_cmp(&self.y, &other.y) - } - cmp => cmp, - } + ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedEventDataType: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedRefDataInner: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -4771,11 +8901,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventDataType { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedRefDataInner { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefDataInner.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -4784,13 +8914,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventDataType { - x: arbitrary::Arbitrary::arbitrary(u)?, - y: arbitrary::Arbitrary::arbitrary(u)?, + Ok(ArbitraryUsedRefDataInner { + val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefDataInner.with(|count| { count.set(count.get() - 1); }); } @@ -4801,7 +8930,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefDataInner.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -4810,13 +8939,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventDataType { - x: arbitrary::Arbitrary::arbitrary(&mut u)?, - y: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + Ok(ArbitraryUsedRefDataInner { + val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefDataInner.with(|count| { count.set(count.get() - 1); }); } @@ -4830,52 +8958,48 @@ const _: () = { <::Prototype as arbitrary::Arbitrary>::size_hint( depth, ), - <::Prototype as arbitrary::Arbitrary>::size_hint( - depth, - ), ], ) }) } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventDataType { - type Prototype = ArbitraryUsedEventDataType; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedRefDataInner { + type Prototype = ArbitraryUsedRefDataInner; } - impl soroban_sdk::TryFromVal for UsedEventDataType { + impl soroban_sdk::TryFromVal for UsedRefDataInner { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedEventDataType, + v: &ArbitraryUsedRefDataInner, ) -> std::result::Result { - Ok(UsedEventDataType { - x: soroban_sdk::IntoVal::into_val(&v.x, env), - y: soroban_sdk::IntoVal::into_val(&v.y, env), + Ok(UsedRefDataInner { + val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -pub struct UsedEventWithDataType { - pub kind: Symbol, - pub payload: UsedEventDataType, +pub struct UsedEventWithRefs<'a> { + pub kind: &'a UsedRefTopicType, + pub payload: &'a UsedRefDataType, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventWithDataType { +impl<'a> ::core::clone::Clone for UsedEventWithRefs<'a> { #[inline] - fn clone(&self) -> UsedEventWithDataType { - UsedEventWithDataType { + fn clone(&self) -> UsedEventWithRefs<'a> { + UsedEventWithRefs { kind: ::core::clone::Clone::clone(&self.kind), payload: ::core::clone::Clone::clone(&self.payload), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventWithDataType { +impl<'a> ::core::fmt::Debug for UsedEventWithRefs<'a> { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field2_finish( f, - "UsedEventWithDataType", + "UsedEventWithRefs", "kind", &self.kind, "payload", @@ -4884,36 +9008,35 @@ impl ::core::fmt::Debug for UsedEventWithDataType { } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventWithDataType { +impl<'a> ::core::cmp::Eq for UsedEventWithRefs<'a> { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq<&'a UsedRefTopicType>; + let _: ::core::cmp::AssertParamIsEq<&'a UsedRefDataType>; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventWithDataType {} +impl<'a> ::core::marker::StructuralPartialEq for UsedEventWithRefs<'a> {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventWithDataType { +impl<'a> ::core::cmp::PartialEq for UsedEventWithRefs<'a> { #[inline] - fn eq(&self, other: &UsedEventWithDataType) -> bool { + fn eq(&self, other: &UsedEventWithRefs<'a>) -> bool { self.kind == other.kind && self.payload == other.payload } } -pub static __SPEC_XDR_EVENT_USEDEVENTWITHDATATYPE: [u8; 152usize] = - UsedEventWithDataType::spec_xdr(); -impl UsedEventWithDataType { - pub const fn spec_xdr() -> [u8; 152usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x15UsedEventWithDataType\0\0\0\0\0\0\x01\0\0\0\x19used_event_with_data_type\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x11UsedEventDataType\0\0\0\0\0\0\0\0\0\0\x02" +pub static __SPEC_XDR_EVENT_USEDEVENTWITHREFS: [u8; 156usize] = UsedEventWithRefs::spec_xdr(); +impl<'a> UsedEventWithRefs<'a> { + pub const fn spec_xdr() -> [u8; 156usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x11UsedEventWithRefs\0\0\0\0\0\0\x01\0\0\0\x14used_event_with_refs\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\x07\xd0\0\0\0\x10UsedRefTopicType\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x0fUsedRefDataType\0\0\0\0\0\0\0\0\x02" } } -impl soroban_sdk::Event for UsedEventWithDataType { +impl<'a> soroban_sdk::Event for UsedEventWithRefs<'a> { fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { use soroban_sdk::IntoVal; ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_data_type") }, + &{ soroban_sdk::Symbol::new(env, "used_event_with_refs") }, { let v: soroban_sdk::Val = self.kind.into_val(env); v @@ -4930,108 +9053,99 @@ impl soroban_sdk::Event for UsedEventWithDataType { .into() } } -impl UsedEventWithDataType { +impl<'a> UsedEventWithRefs<'a> { pub fn publish(&self, env: &soroban_sdk::Env) { <_ as soroban_sdk::Event>::publish(self, env); } } -pub struct UsedEventTopicOuter { - pub inner: UsedEventTopicInner, +pub struct UsedTupleElement { + pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventTopicOuter { +impl ::core::clone::Clone for UsedTupleElement { #[inline] - fn clone(&self) -> UsedEventTopicOuter { - UsedEventTopicOuter { - inner: ::core::clone::Clone::clone(&self.inner), + fn clone(&self) -> UsedTupleElement { + UsedTupleElement { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventTopicOuter { +impl ::core::fmt::Debug for UsedTupleElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( - f, - "UsedEventTopicOuter", - "inner", - &&self.inner, - ) + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedTupleElement", "val", &&self.val) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventTopicOuter { +impl ::core::cmp::Eq for UsedTupleElement { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventTopicOuter {} +impl ::core::marker::StructuralPartialEq for UsedTupleElement {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventTopicOuter { +impl ::core::cmp::PartialEq for UsedTupleElement { #[inline] - fn eq(&self, other: &UsedEventTopicOuter) -> bool { - self.inner == other.inner + fn eq(&self, other: &UsedTupleElement) -> bool { + self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDEVENTTOPICOUTER: [u8; 84usize] = UsedEventTopicOuter::spec_xdr(); -impl UsedEventTopicOuter { - pub const fn spec_xdr() -> [u8; 84usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedEventTopicOuter\0\0\0\0\x01\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x13UsedEventTopicInner\0" +pub static __SPEC_XDR_TYPE_USEDTUPLEELEMENT: [u8; 52usize] = UsedTupleElement::spec_xdr(); +impl UsedTupleElement { + pub const fn spec_xdr() -> [u8; 52usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedTupleElement\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::TryFromVal for UsedEventTopicOuter { +impl soroban_sdk::TryFromVal for UsedTupleElement { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["inner"]; + const KEYS: [&'static str; 1usize] = ["val"]; let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - inner: vals[0] + val: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventTopicOuter, + val: &UsedTupleElement, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["inner"]; - let vals: [Val; 1usize] = [(&val.inner) - .try_into_val(env) - .map_err(|_| ConversionError)?]; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventTopicOuter, + val: &&UsedTupleElement, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedEventTopicOuter { +impl soroban_sdk::TryFromVal for UsedTupleElement { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -5046,9 +9160,9 @@ impl soroban_sdk::TryFromVal for Used } map.validate()?; Ok(Self { - inner: { + val: { let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "inner" + "val" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) @@ -5065,7 +9179,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedEventTopicOuter { +impl soroban_sdk::TryFromVal for UsedTupleElement { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -5079,116 +9193,115 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedEventTopicOuter> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedTupleElement> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventTopicOuter) -> Result { + fn try_from(val: &UsedTupleElement) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ soroban_sdk::xdr::ScMapEntry { key: soroban_sdk::xdr::ScSymbol( - "inner" + "val" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(), - val: (&val.inner) + val: (&val.val) .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, }, ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventTopicOuter) -> Result { + fn try_from(val: UsedTupleElement) -> Result { (&val).try_into() } } -impl TryFrom<&UsedEventTopicOuter> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedTupleElement> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventTopicOuter) -> Result { + fn try_from(val: &UsedTupleElement) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventTopicOuter) -> Result { + fn try_from(val: UsedTupleElement) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedEventTopicOuter { - inner: - ::Prototype, + pub struct ArbitraryUsedTupleElement { + val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedEventTopicOuter { + impl ::core::fmt::Debug for ArbitraryUsedTupleElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedEventTopicOuter", - "inner", - &&self.inner, + "ArbitraryUsedTupleElement", + "val", + &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedEventTopicOuter { + impl ::core::clone::Clone for ArbitraryUsedTupleElement { #[inline] - fn clone(&self) -> ArbitraryUsedEventTopicOuter { - ArbitraryUsedEventTopicOuter { - inner: ::core::clone::Clone::clone(&self.inner), + fn clone(&self) -> ArbitraryUsedTupleElement { + ArbitraryUsedTupleElement { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedEventTopicOuter { + impl ::core::cmp::Eq for ArbitraryUsedTupleElement { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq< - ::Prototype, + ::Prototype, >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventTopicOuter {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedTupleElement {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedEventTopicOuter { + impl ::core::cmp::PartialEq for ArbitraryUsedTupleElement { #[inline] - fn eq(&self, other: &ArbitraryUsedEventTopicOuter) -> bool { - self.inner == other.inner + fn eq(&self, other: &ArbitraryUsedTupleElement) -> bool { + self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedEventTopicOuter { + impl ::core::cmp::Ord for ArbitraryUsedTupleElement { #[inline] - fn cmp(&self, other: &ArbitraryUsedEventTopicOuter) -> ::core::cmp::Ordering { - ::core::cmp::Ord::cmp(&self.inner, &other.inner) + fn cmp(&self, other: &ArbitraryUsedTupleElement) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedEventTopicOuter { + impl ::core::cmp::PartialOrd for ArbitraryUsedTupleElement { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedEventTopicOuter, + other: &ArbitraryUsedTupleElement, ) -> ::core::option::Option<::core::cmp::Ordering> { - ::core::cmp::PartialOrd::partial_cmp(&self.inner, &other.inner) + ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedTupleElement: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -5222,11 +9335,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventTopicOuter { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedTupleElement { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedTupleElement.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -5235,12 +9348,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventTopicOuter { - inner: arbitrary::Arbitrary::arbitrary(u)?, + Ok(ArbitraryUsedTupleElement { + val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedTupleElement.with(|count| { count.set(count.get() - 1); }); } @@ -5251,7 +9364,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedTupleElement.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -5260,12 +9373,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventTopicOuter { - inner: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + Ok(ArbitraryUsedTupleElement { + val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedTupleElement.with(|count| { count.set(count.get() - 1); }); } @@ -5276,7 +9389,7 @@ const _: () = { arbitrary::size_hint::recursion_guard(depth, |depth| { arbitrary::size_hint::and_all( &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( + <::Prototype as arbitrary::Arbitrary>::size_hint( depth, ), ], @@ -5285,49 +9398,47 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventTopicOuter { - type Prototype = ArbitraryUsedEventTopicOuter; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedTupleElement { + type Prototype = ArbitraryUsedTupleElement; } - impl soroban_sdk::TryFromVal - for UsedEventTopicOuter - { + impl soroban_sdk::TryFromVal for UsedTupleElement { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedEventTopicOuter, + v: &ArbitraryUsedTupleElement, ) -> std::result::Result { - Ok(UsedEventTopicOuter { - inner: soroban_sdk::IntoVal::into_val(&v.inner, env), + Ok(UsedTupleElement { + val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -pub struct UsedEventTopicInner { +pub struct UsedTupleReturnElement { pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventTopicInner { +impl ::core::clone::Clone for UsedTupleReturnElement { #[inline] - fn clone(&self) -> UsedEventTopicInner { - UsedEventTopicInner { + fn clone(&self) -> UsedTupleReturnElement { + UsedTupleReturnElement { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventTopicInner { +impl ::core::fmt::Debug for UsedTupleReturnElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedEventTopicInner", + "UsedTupleReturnElement", "val", &&self.val, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventTopicInner { +impl ::core::cmp::Eq for UsedTupleReturnElement { #[inline] #[doc(hidden)] #[coverage(off)] @@ -5336,21 +9447,22 @@ impl ::core::cmp::Eq for UsedEventTopicInner { } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventTopicInner {} +impl ::core::marker::StructuralPartialEq for UsedTupleReturnElement {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventTopicInner { +impl ::core::cmp::PartialEq for UsedTupleReturnElement { #[inline] - fn eq(&self, other: &UsedEventTopicInner) -> bool { + fn eq(&self, other: &UsedTupleReturnElement) -> bool { self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDEVENTTOPICINNER: [u8; 56usize] = UsedEventTopicInner::spec_xdr(); -impl UsedEventTopicInner { - pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedEventTopicInner\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDTUPLERETURNELEMENT: [u8; 60usize] = + UsedTupleReturnElement::spec_xdr(); +impl UsedTupleReturnElement { + pub const fn spec_xdr() -> [u8; 60usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x16UsedTupleReturnElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::TryFromVal for UsedEventTopicInner { +impl soroban_sdk::TryFromVal for UsedTupleReturnElement { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -5369,11 +9481,11 @@ impl soroban_sdk::TryFromVal for UsedEventTo }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventTopicInner, + val: &UsedTupleReturnElement, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["val"]; @@ -5384,19 +9496,19 @@ impl soroban_sdk::TryFromVal for soroban_ .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventTopicInner, + val: &&UsedTupleReturnElement, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( + <_ as soroban_sdk::TryFromVal>::try_from_val( env, *val, ) } } -impl soroban_sdk::TryFromVal for UsedEventTopicInner { +impl soroban_sdk::TryFromVal for UsedTupleReturnElement { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -5430,7 +9542,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedEventTopicInner { +impl soroban_sdk::TryFromVal for UsedTupleReturnElement { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -5444,10 +9556,10 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedEventTopicInner> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedTupleReturnElement> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventTopicInner) -> Result { + fn try_from(val: &UsedTupleReturnElement) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ @@ -5465,56 +9577,56 @@ impl TryFrom<&UsedEventTopicInner> for soroban_sdk::xdr::ScMap { ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventTopicInner) -> Result { + fn try_from(val: UsedTupleReturnElement) -> Result { (&val).try_into() } } -impl TryFrom<&UsedEventTopicInner> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedTupleReturnElement> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventTopicInner) -> Result { + fn try_from(val: &UsedTupleReturnElement) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventTopicInner) -> Result { + fn try_from(val: UsedTupleReturnElement) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedEventTopicInner { + pub struct ArbitraryUsedTupleReturnElement { val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedEventTopicInner { + impl ::core::fmt::Debug for ArbitraryUsedTupleReturnElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedEventTopicInner", + "ArbitraryUsedTupleReturnElement", "val", &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedEventTopicInner { + impl ::core::clone::Clone for ArbitraryUsedTupleReturnElement { #[inline] - fn clone(&self) -> ArbitraryUsedEventTopicInner { - ArbitraryUsedEventTopicInner { + fn clone(&self) -> ArbitraryUsedTupleReturnElement { + ArbitraryUsedTupleReturnElement { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedEventTopicInner { + impl ::core::cmp::Eq for ArbitraryUsedTupleReturnElement { #[inline] #[doc(hidden)] #[coverage(off)] @@ -5525,34 +9637,34 @@ const _: () = { } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventTopicInner {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedTupleReturnElement {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedEventTopicInner { + impl ::core::cmp::PartialEq for ArbitraryUsedTupleReturnElement { #[inline] - fn eq(&self, other: &ArbitraryUsedEventTopicInner) -> bool { + fn eq(&self, other: &ArbitraryUsedTupleReturnElement) -> bool { self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedEventTopicInner { + impl ::core::cmp::Ord for ArbitraryUsedTupleReturnElement { #[inline] - fn cmp(&self, other: &ArbitraryUsedEventTopicInner) -> ::core::cmp::Ordering { + fn cmp(&self, other: &ArbitraryUsedTupleReturnElement) -> ::core::cmp::Ordering { ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedEventTopicInner { + impl ::core::cmp::PartialOrd for ArbitraryUsedTupleReturnElement { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedEventTopicInner, + other: &ArbitraryUsedTupleReturnElement, ) -> ::core::option::Option<::core::cmp::Ordering> { ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedEventTopicInner: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -5586,11 +9698,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventTopicInner { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedTupleReturnElement { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -5599,12 +9711,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventTopicInner { + Ok(ArbitraryUsedTupleReturnElement { val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement.with(|count| { count.set(count.get() - 1); }); } @@ -5615,7 +9727,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -5624,12 +9736,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventTopicInner { + Ok(ArbitraryUsedTupleReturnElement { val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement.with(|count| { count.set(count.get() - 1); }); } @@ -5649,200 +9761,119 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventTopicInner { - type Prototype = ArbitraryUsedEventTopicInner; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedTupleReturnElement { + type Prototype = ArbitraryUsedTupleReturnElement; } - impl soroban_sdk::TryFromVal - for UsedEventTopicInner + impl soroban_sdk::TryFromVal + for UsedTupleReturnElement { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedEventTopicInner, + v: &ArbitraryUsedTupleReturnElement, ) -> std::result::Result { - Ok(UsedEventTopicInner { + Ok(UsedTupleReturnElement { val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -pub struct UsedEventWithNestedTopic { - pub info: UsedEventTopicOuter, - pub amount: i128, -} -#[automatically_derived] -impl ::core::clone::Clone for UsedEventWithNestedTopic { - #[inline] - fn clone(&self) -> UsedEventWithNestedTopic { - UsedEventWithNestedTopic { - info: ::core::clone::Clone::clone(&self.info), - amount: ::core::clone::Clone::clone(&self.amount), - } - } -} -#[automatically_derived] -impl ::core::fmt::Debug for UsedEventWithNestedTopic { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( - f, - "UsedEventWithNestedTopic", - "info", - &self.info, - "amount", - &&self.amount, - ) - } -} -#[automatically_derived] -impl ::core::cmp::Eq for UsedEventWithNestedTopic { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; - } -} -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventWithNestedTopic {} -#[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventWithNestedTopic { - #[inline] - fn eq(&self, other: &UsedEventWithNestedTopic) -> bool { - self.amount == other.amount && self.info == other.info - } -} -pub static __SPEC_XDR_EVENT_USEDEVENTWITHNESTEDTOPIC: [u8; 152usize] = - UsedEventWithNestedTopic::spec_xdr(); -impl UsedEventWithNestedTopic { - pub const fn spec_xdr() -> [u8; 152usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x18UsedEventWithNestedTopic\0\0\0\x01\0\0\0\x1cused_event_with_nested_topic\0\0\0\x02\0\0\0\0\0\0\0\x04info\0\0\x07\xd0\0\0\0\x13UsedEventTopicOuter\0\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" - } -} -impl soroban_sdk::Event for UsedEventWithNestedTopic { - fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { - use soroban_sdk::IntoVal; - ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_nested_topic") }, - { - let v: soroban_sdk::Val = self.info.into_val(env); - v - }, - ) - .into_val(env) - } - fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { - use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["amount"]; - let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; - env.map_new_from_slices(&KEYS, &vals) - .unwrap_infallible() - .into() - } -} -impl UsedEventWithNestedTopic { - pub fn publish(&self, env: &soroban_sdk::Env) { - <_ as soroban_sdk::Event>::publish(self, env); - } -} -pub struct UsedEventDataOuter { - pub inner: UsedEventDataInner, +pub struct UsedVecInnerVecElement { + pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventDataOuter { +impl ::core::clone::Clone for UsedVecInnerVecElement { #[inline] - fn clone(&self) -> UsedEventDataOuter { - UsedEventDataOuter { - inner: ::core::clone::Clone::clone(&self.inner), + fn clone(&self) -> UsedVecInnerVecElement { + UsedVecInnerVecElement { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventDataOuter { +impl ::core::fmt::Debug for UsedVecInnerVecElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedEventDataOuter", - "inner", - &&self.inner, + "UsedVecInnerVecElement", + "val", + &&self.val, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventDataOuter { +impl ::core::cmp::Eq for UsedVecInnerVecElement { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventDataOuter {} +impl ::core::marker::StructuralPartialEq for UsedVecInnerVecElement {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventDataOuter { +impl ::core::cmp::PartialEq for UsedVecInnerVecElement { #[inline] - fn eq(&self, other: &UsedEventDataOuter) -> bool { - self.inner == other.inner + fn eq(&self, other: &UsedVecInnerVecElement) -> bool { + self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDEVENTDATAOUTER: [u8; 84usize] = UsedEventDataOuter::spec_xdr(); -impl UsedEventDataOuter { - pub const fn spec_xdr() -> [u8; 84usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventDataOuter\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x12UsedEventDataInner\0\0" +pub static __SPEC_XDR_TYPE_USEDVECINNERVECELEMENT: [u8; 60usize] = + UsedVecInnerVecElement::spec_xdr(); +impl UsedVecInnerVecElement { + pub const fn spec_xdr() -> [u8; 60usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x16UsedVecInnerVecElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::TryFromVal for UsedEventDataOuter { +impl soroban_sdk::TryFromVal for UsedVecInnerVecElement { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["inner"]; + const KEYS: [&'static str; 1usize] = ["val"]; let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - inner: vals[0] + val: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventDataOuter, + val: &UsedVecInnerVecElement, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["inner"]; - let vals: [Val; 1usize] = [(&val.inner) - .try_into_val(env) - .map_err(|_| ConversionError)?]; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventDataOuter, + val: &&UsedVecInnerVecElement, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( + <_ as soroban_sdk::TryFromVal>::try_from_val( env, *val, ) } } -impl soroban_sdk::TryFromVal for UsedEventDataOuter { +impl soroban_sdk::TryFromVal for UsedVecInnerVecElement { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -5857,9 +9888,9 @@ impl soroban_sdk::TryFromVal for Used } map.validate()?; Ok(Self { - inner: { + val: { let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "inner" + "val" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) @@ -5876,7 +9907,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedEventDataOuter { +impl soroban_sdk::TryFromVal for UsedVecInnerVecElement { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -5890,116 +9921,115 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedEventDataOuter> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedVecInnerVecElement> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventDataOuter) -> Result { + fn try_from(val: &UsedVecInnerVecElement) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ soroban_sdk::xdr::ScMapEntry { key: soroban_sdk::xdr::ScSymbol( - "inner" + "val" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(), - val: (&val.inner) + val: (&val.val) .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, }, ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventDataOuter) -> Result { + fn try_from(val: UsedVecInnerVecElement) -> Result { (&val).try_into() } } -impl TryFrom<&UsedEventDataOuter> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedVecInnerVecElement> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventDataOuter) -> Result { + fn try_from(val: &UsedVecInnerVecElement) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventDataOuter) -> Result { + fn try_from(val: UsedVecInnerVecElement) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedEventDataOuter { - inner: - ::Prototype, + pub struct ArbitraryUsedVecInnerVecElement { + val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedEventDataOuter { + impl ::core::fmt::Debug for ArbitraryUsedVecInnerVecElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedEventDataOuter", - "inner", - &&self.inner, + "ArbitraryUsedVecInnerVecElement", + "val", + &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedEventDataOuter { + impl ::core::clone::Clone for ArbitraryUsedVecInnerVecElement { #[inline] - fn clone(&self) -> ArbitraryUsedEventDataOuter { - ArbitraryUsedEventDataOuter { - inner: ::core::clone::Clone::clone(&self.inner), + fn clone(&self) -> ArbitraryUsedVecInnerVecElement { + ArbitraryUsedVecInnerVecElement { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedEventDataOuter { + impl ::core::cmp::Eq for ArbitraryUsedVecInnerVecElement { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq< - ::Prototype, + ::Prototype, >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventDataOuter {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedVecInnerVecElement {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedEventDataOuter { + impl ::core::cmp::PartialEq for ArbitraryUsedVecInnerVecElement { #[inline] - fn eq(&self, other: &ArbitraryUsedEventDataOuter) -> bool { - self.inner == other.inner + fn eq(&self, other: &ArbitraryUsedVecInnerVecElement) -> bool { + self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedEventDataOuter { + impl ::core::cmp::Ord for ArbitraryUsedVecInnerVecElement { #[inline] - fn cmp(&self, other: &ArbitraryUsedEventDataOuter) -> ::core::cmp::Ordering { - ::core::cmp::Ord::cmp(&self.inner, &other.inner) + fn cmp(&self, other: &ArbitraryUsedVecInnerVecElement) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedEventDataOuter { + impl ::core::cmp::PartialOrd for ArbitraryUsedVecInnerVecElement { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedEventDataOuter, + other: &ArbitraryUsedVecInnerVecElement, ) -> ::core::option::Option<::core::cmp::Ordering> { - ::core::cmp::PartialOrd::partial_cmp(&self.inner, &other.inner) + ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedEventDataOuter: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedVecInnerVecElement: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -6033,11 +10063,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventDataOuter { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedVecInnerVecElement { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataOuter.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecInnerVecElement.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -6046,12 +10076,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventDataOuter { - inner: arbitrary::Arbitrary::arbitrary(u)?, + Ok(ArbitraryUsedVecInnerVecElement { + val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataOuter.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecInnerVecElement.with(|count| { count.set(count.get() - 1); }); } @@ -6062,7 +10092,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataOuter.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecInnerVecElement.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -6071,12 +10101,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventDataOuter { - inner: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + Ok(ArbitraryUsedVecInnerVecElement { + val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataOuter.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecInnerVecElement.with(|count| { count.set(count.get() - 1); }); } @@ -6087,7 +10117,7 @@ const _: () = { arbitrary::size_hint::recursion_guard(depth, |depth| { arbitrary::size_hint::and_all( &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( + <::Prototype as arbitrary::Arbitrary>::size_hint( depth, ), ], @@ -6096,47 +10126,49 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventDataOuter { - type Prototype = ArbitraryUsedEventDataOuter; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedVecInnerVecElement { + type Prototype = ArbitraryUsedVecInnerVecElement; } - impl soroban_sdk::TryFromVal for UsedEventDataOuter { + impl soroban_sdk::TryFromVal + for UsedVecInnerVecElement + { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedEventDataOuter, + v: &ArbitraryUsedVecInnerVecElement, ) -> std::result::Result { - Ok(UsedEventDataOuter { - inner: soroban_sdk::IntoVal::into_val(&v.inner, env), + Ok(UsedVecInnerVecElement { + val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -pub struct UsedEventDataInner { +pub struct UsedVecInnerElement { pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventDataInner { +impl ::core::clone::Clone for UsedVecInnerElement { #[inline] - fn clone(&self) -> UsedEventDataInner { - UsedEventDataInner { + fn clone(&self) -> UsedVecInnerElement { + UsedVecInnerElement { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventDataInner { +impl ::core::fmt::Debug for UsedVecInnerElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedEventDataInner", + "UsedVecInnerElement", "val", &&self.val, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventDataInner { +impl ::core::cmp::Eq for UsedVecInnerElement { #[inline] #[doc(hidden)] #[coverage(off)] @@ -6145,21 +10177,21 @@ impl ::core::cmp::Eq for UsedEventDataInner { } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventDataInner {} +impl ::core::marker::StructuralPartialEq for UsedVecInnerElement {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventDataInner { +impl ::core::cmp::PartialEq for UsedVecInnerElement { #[inline] - fn eq(&self, other: &UsedEventDataInner) -> bool { + fn eq(&self, other: &UsedVecInnerElement) -> bool { self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDEVENTDATAINNER: [u8; 56usize] = UsedEventDataInner::spec_xdr(); -impl UsedEventDataInner { +pub static __SPEC_XDR_TYPE_USEDVECINNERELEMENT: [u8; 56usize] = UsedVecInnerElement::spec_xdr(); +impl UsedVecInnerElement { pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventDataInner\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedVecInnerElement\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::TryFromVal for UsedEventDataInner { +impl soroban_sdk::TryFromVal for UsedVecInnerElement { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -6178,11 +10210,11 @@ impl soroban_sdk::TryFromVal for UsedEventDa }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventDataInner, + val: &UsedVecInnerElement, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["val"]; @@ -6193,19 +10225,19 @@ impl soroban_sdk::TryFromVal for soroban_s .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventDataInner, + val: &&UsedVecInnerElement, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( + <_ as soroban_sdk::TryFromVal>::try_from_val( env, *val, ) } } -impl soroban_sdk::TryFromVal for UsedEventDataInner { +impl soroban_sdk::TryFromVal for UsedVecInnerElement { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -6239,7 +10271,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedEventDataInner { +impl soroban_sdk::TryFromVal for UsedVecInnerElement { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -6253,10 +10285,10 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedEventDataInner> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedVecInnerElement> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventDataInner) -> Result { + fn try_from(val: &UsedVecInnerElement) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ @@ -6274,56 +10306,56 @@ impl TryFrom<&UsedEventDataInner> for soroban_sdk::xdr::ScMap { ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventDataInner) -> Result { + fn try_from(val: UsedVecInnerElement) -> Result { (&val).try_into() } } -impl TryFrom<&UsedEventDataInner> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedVecInnerElement> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventDataInner) -> Result { + fn try_from(val: &UsedVecInnerElement) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventDataInner) -> Result { + fn try_from(val: UsedVecInnerElement) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedEventDataInner { + pub struct ArbitraryUsedVecInnerElement { val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedEventDataInner { + impl ::core::fmt::Debug for ArbitraryUsedVecInnerElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedEventDataInner", + "ArbitraryUsedVecInnerElement", "val", &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedEventDataInner { + impl ::core::clone::Clone for ArbitraryUsedVecInnerElement { #[inline] - fn clone(&self) -> ArbitraryUsedEventDataInner { - ArbitraryUsedEventDataInner { + fn clone(&self) -> ArbitraryUsedVecInnerElement { + ArbitraryUsedVecInnerElement { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedEventDataInner { + impl ::core::cmp::Eq for ArbitraryUsedVecInnerElement { #[inline] #[doc(hidden)] #[coverage(off)] @@ -6334,34 +10366,34 @@ const _: () = { } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventDataInner {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedVecInnerElement {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedEventDataInner { + impl ::core::cmp::PartialEq for ArbitraryUsedVecInnerElement { #[inline] - fn eq(&self, other: &ArbitraryUsedEventDataInner) -> bool { + fn eq(&self, other: &ArbitraryUsedVecInnerElement) -> bool { self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedEventDataInner { + impl ::core::cmp::Ord for ArbitraryUsedVecInnerElement { #[inline] - fn cmp(&self, other: &ArbitraryUsedEventDataInner) -> ::core::cmp::Ordering { + fn cmp(&self, other: &ArbitraryUsedVecInnerElement) -> ::core::cmp::Ordering { ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedEventDataInner { + impl ::core::cmp::PartialOrd for ArbitraryUsedVecInnerElement { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedEventDataInner, + other: &ArbitraryUsedVecInnerElement, ) -> ::core::option::Option<::core::cmp::Ordering> { ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedEventDataInner: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedVecInnerElement: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -6395,11 +10427,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventDataInner { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedVecInnerElement { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecInnerElement.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -6408,12 +10440,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventDataInner { + Ok(ArbitraryUsedVecInnerElement { val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecInnerElement.with(|count| { count.set(count.get() - 1); }); } @@ -6424,7 +10456,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecInnerElement.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -6433,12 +10465,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventDataInner { + Ok(ArbitraryUsedVecInnerElement { val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecInnerElement.with(|count| { count.set(count.get() - 1); }); } @@ -6458,300 +10490,390 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventDataInner { - type Prototype = ArbitraryUsedEventDataInner; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedVecInnerElement { + type Prototype = ArbitraryUsedVecInnerElement; } - impl soroban_sdk::TryFromVal for UsedEventDataInner { + impl soroban_sdk::TryFromVal + for UsedVecInnerElement + { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedEventDataInner, + v: &ArbitraryUsedVecInnerElement, ) -> std::result::Result { - Ok(UsedEventDataInner { + Ok(UsedVecInnerElement { val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -pub struct UsedEventWithNestedData { - pub kind: Symbol, - pub payload: UsedEventDataOuter, +pub struct UsedVecElementNested { + pub val: u32, + pub inner: UsedVecInnerElement, + pub vec_inner: Vec, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventWithNestedData { +impl ::core::clone::Clone for UsedVecElementNested { #[inline] - fn clone(&self) -> UsedEventWithNestedData { - UsedEventWithNestedData { - kind: ::core::clone::Clone::clone(&self.kind), - payload: ::core::clone::Clone::clone(&self.payload), + fn clone(&self) -> UsedVecElementNested { + UsedVecElementNested { + val: ::core::clone::Clone::clone(&self.val), + inner: ::core::clone::Clone::clone(&self.inner), + vec_inner: ::core::clone::Clone::clone(&self.vec_inner), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventWithNestedData { +impl ::core::fmt::Debug for UsedVecElementNested { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( + ::core::fmt::Formatter::debug_struct_field3_finish( f, - "UsedEventWithNestedData", - "kind", - &self.kind, - "payload", - &&self.payload, + "UsedVecElementNested", + "val", + &self.val, + "inner", + &self.inner, + "vec_inner", + &&self.vec_inner, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventWithNestedData { +impl ::core::cmp::Eq for UsedVecElementNested { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventWithNestedData {} +impl ::core::marker::StructuralPartialEq for UsedVecElementNested {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventWithNestedData { +impl ::core::cmp::PartialEq for UsedVecElementNested { #[inline] - fn eq(&self, other: &UsedEventWithNestedData) -> bool { - self.kind == other.kind && self.payload == other.payload - } -} -pub static __SPEC_XDR_EVENT_USEDEVENTWITHNESTEDDATA: [u8; 152usize] = - UsedEventWithNestedData::spec_xdr(); -impl UsedEventWithNestedData { - pub const fn spec_xdr() -> [u8; 152usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x17UsedEventWithNestedData\0\0\0\0\x01\0\0\0\x1bused_event_with_nested_data\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x12UsedEventDataOuter\0\0\0\0\0\0\0\0\0\x02" + fn eq(&self, other: &UsedVecElementNested) -> bool { + self.val == other.val && self.inner == other.inner && self.vec_inner == other.vec_inner } } -impl soroban_sdk::Event for UsedEventWithNestedData { - fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { - use soroban_sdk::IntoVal; - ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_nested_data") }, - { - let v: soroban_sdk::Val = self.kind.into_val(env); - v - }, - ) - .into_val(env) - } - fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { - use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["payload"]; - let vals: [soroban_sdk::Val; 1usize] = [self.payload.into_val(env)]; - env.map_new_from_slices(&KEYS, &vals) - .unwrap_infallible() - .into() +pub static __SPEC_XDR_TYPE_USEDVECELEMENTNESTED: [u8; 156usize] = UsedVecElementNested::spec_xdr(); +impl UsedVecElementNested { + pub const fn spec_xdr() -> [u8; 156usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x14UsedVecElementNested\0\0\0\x03\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x13UsedVecInnerElement\0\0\0\0\0\0\0\0\x03val\0\0\0\0\x04\0\0\0\0\0\0\0\tvec_inner\0\0\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x16UsedVecInnerVecElement\0\0" } } -impl UsedEventWithNestedData { - pub fn publish(&self, env: &soroban_sdk::Env) { - <_ as soroban_sdk::Event>::publish(self, env); +impl soroban_sdk::TryFromVal for UsedVecElementNested { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["inner", "val", "vec_inner"]; + let mut vals: [Val; 3usize] = [Val::VOID.to_val(); 3usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + inner: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + val: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + vec_inner: vals[2] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) } } -pub enum UsedRefTopicType { - Send = 1, - Recv = 2, -} -#[automatically_derived] -impl ::core::marker::Copy for UsedRefTopicType {} -#[automatically_derived] -impl ::core::clone::Clone for UsedRefTopicType { - #[inline] - fn clone(&self) -> UsedRefTopicType { - *self +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedVecElementNested, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["inner", "val", "vec_inner"]; + let vals: [Val; 3usize] = [ + (&val.inner) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.val).try_into_val(env).map_err(|_| ConversionError)?, + (&val.vec_inner) + .try_into_val(env) + .map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) } } -#[automatically_derived] -impl ::core::fmt::Debug for UsedRefTopicType { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( - f, - match self { - UsedRefTopicType::Send => "Send", - UsedRefTopicType::Recv => "Recv", - }, +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedVecElementNested, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, ) } } -#[automatically_derived] -impl ::core::cmp::Eq for UsedRefTopicType { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} -} -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedRefTopicType {} -#[automatically_derived] -impl ::core::cmp::PartialEq for UsedRefTopicType { - #[inline] - fn eq(&self, other: &UsedRefTopicType) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr - } -} -pub static __SPEC_XDR_TYPE_USEDREFTOPICTYPE: [u8; 68usize] = UsedRefTopicType::spec_xdr(); -impl UsedRefTopicType { - pub const fn spec_xdr() -> [u8; 68usize] { - *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x10UsedRefTopicType\0\0\0\x02\0\0\0\0\0\0\0\x04Send\0\0\0\x01\0\0\0\0\0\0\0\x04Recv\0\0\0\x02" - } -} -impl soroban_sdk::TryFromVal for UsedRefTopicType { - type Error = soroban_sdk::ConversionError; +impl soroban_sdk::TryFromVal for UsedVecElementNested { + type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &soroban_sdk::Val, - ) -> Result { + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; use soroban_sdk::TryIntoVal; - let discriminant: u32 = val.try_into_val(env)?; - Ok(match discriminant { - 1u32 => Self::Send, - 2u32 => Self::Recv, - _ => Err(soroban_sdk::ConversionError {})?, + let map = val; + if map.len() != 3usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + inner: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "inner" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + val: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "val" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + vec_inner: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "vec_inner" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; +impl soroban_sdk::TryFromVal for UsedVecElementNested { + type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedRefTopicType, - ) -> Result { - Ok(match val { - UsedRefTopicType::Send => 1u32.into(), - UsedRefTopicType::Recv => 2u32.into(), - }) + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; +impl TryFrom<&UsedVecElementNested> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &&UsedRefTopicType, - ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + fn try_from(val: &UsedVecElementNested) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "inner" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.inner) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "val" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.val) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "vec_inner" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.vec_inner) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) } } -impl soroban_sdk::TryFromVal for UsedRefTopicType { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &soroban_sdk::xdr::ScVal, - ) -> Result { - if let soroban_sdk::xdr::ScVal::U32(discriminant) = val { - Ok(match *discriminant { - 1u32 => Self::Send, - 2u32 => Self::Recv, - _ => Err(soroban_sdk::xdr::Error::Invalid)?, - }) - } else { - Err(soroban_sdk::xdr::Error::Invalid) - } + fn try_from(val: UsedVecElementNested) -> Result { + (&val).try_into() } } -impl TryInto for &UsedRefTopicType { +impl TryFrom<&UsedVecElementNested> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_into(self) -> Result { - Ok(match self { - UsedRefTopicType::Send => 1u32.into(), - UsedRefTopicType::Recv => 2u32.into(), - }) + fn try_from(val: &UsedVecElementNested) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryInto for UsedRefTopicType { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_into(self) -> Result { - Ok(match self { - UsedRefTopicType::Send => 1u32.into(), - UsedRefTopicType::Recv => 2u32.into(), - }) + fn try_from(val: UsedVecElementNested) -> Result { + (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub enum ArbitraryUsedRefTopicType { - Send, - Recv, + pub struct ArbitraryUsedVecElementNested { + val: ::Prototype, + inner: ::Prototype, + vec_inner: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedRefTopicType { + impl ::core::fmt::Debug for ArbitraryUsedVecElementNested { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( + ::core::fmt::Formatter::debug_struct_field3_finish( f, - match self { - ArbitraryUsedRefTopicType::Send => "Send", - ArbitraryUsedRefTopicType::Recv => "Recv", - }, + "ArbitraryUsedVecElementNested", + "val", + &self.val, + "inner", + &self.inner, + "vec_inner", + &&self.vec_inner, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedRefTopicType { + impl ::core::clone::Clone for ArbitraryUsedVecElementNested { #[inline] - fn clone(&self) -> ArbitraryUsedRefTopicType { - match self { - ArbitraryUsedRefTopicType::Send => ArbitraryUsedRefTopicType::Send, - ArbitraryUsedRefTopicType::Recv => ArbitraryUsedRefTopicType::Recv, + fn clone(&self) -> ArbitraryUsedVecElementNested { + ArbitraryUsedVecElementNested { + val: ::core::clone::Clone::clone(&self.val), + inner: ::core::clone::Clone::clone(&self.inner), + vec_inner: ::core::clone::Clone::clone(&self.vec_inner), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedRefTopicType { + impl ::core::cmp::Eq for ArbitraryUsedVecElementNested { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedRefTopicType {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedVecElementNested {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedRefTopicType { + impl ::core::cmp::PartialEq for ArbitraryUsedVecElementNested { #[inline] - fn eq(&self, other: &ArbitraryUsedRefTopicType) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr + fn eq(&self, other: &ArbitraryUsedVecElementNested) -> bool { + self.val == other.val && self.inner == other.inner && self.vec_inner == other.vec_inner } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedRefTopicType { + impl ::core::cmp::Ord for ArbitraryUsedVecElementNested { #[inline] - fn cmp(&self, other: &ArbitraryUsedRefTopicType) -> ::core::cmp::Ordering { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) + fn cmp(&self, other: &ArbitraryUsedVecElementNested) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.val, &other.val) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.inner, &other.inner) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.vec_inner, &other.vec_inner) + } + cmp => cmp, + } + } + cmp => cmp, + } } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedRefTopicType { + impl ::core::cmp::PartialOrd for ArbitraryUsedVecElementNested { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedRefTopicType, + other: &ArbitraryUsedVecElementNested, ) -> ::core::option::Option<::core::cmp::Ordering> { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr) + match ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp(&self.inner, &other.inner) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.vec_inner, &other.vec_inner) + } + cmp => cmp, + } + } + cmp => cmp, + } } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedRefTopicType: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedVecElementNested: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -6785,11 +10907,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedRefTopicType { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedVecElementNested { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefTopicType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecElementNested.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -6798,19 +10920,14 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(u)?) * 2u64) >> 32 - { - 0u64 => ArbitraryUsedRefTopicType::Send, - 1u64 => ArbitraryUsedRefTopicType::Recv, - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryUsedVecElementNested { + val: arbitrary::Arbitrary::arbitrary(u)?, + inner: arbitrary::Arbitrary::arbitrary(u)?, + vec_inner: arbitrary::Arbitrary::arbitrary(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefTopicType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecElementNested.with(|count| { count.set(count.get() - 1); }); } @@ -6821,7 +10938,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefTopicType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecElementNested.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -6830,20 +10947,14 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(&mut u)?) * 2u64) - >> 32 - { - 0u64 => ArbitraryUsedRefTopicType::Send, - 1u64 => ArbitraryUsedRefTopicType::Recv, - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryUsedVecElementNested { + val: arbitrary::Arbitrary::arbitrary(&mut u)?, + inner: arbitrary::Arbitrary::arbitrary(&mut u)?, + vec_inner: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefTopicType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecElementNested.with(|count| { count.set(count.get() - 1); }); } @@ -6851,129 +10962,127 @@ const _: () = { } #[inline] fn size_hint(depth: usize) -> (usize, Option) { - arbitrary::size_hint::and( - ::size_hint(depth), - arbitrary::size_hint::recursion_guard(depth, |depth| { - arbitrary::size_hint::or_all(&[ - arbitrary::size_hint::and_all(&[]), - arbitrary::size_hint::and_all(&[]), - ]) - }), - ) + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedRefTopicType { - type Prototype = ArbitraryUsedRefTopicType; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedVecElementNested { + type Prototype = ArbitraryUsedVecElementNested; } - impl soroban_sdk::TryFromVal for UsedRefTopicType { + impl soroban_sdk::TryFromVal + for UsedVecElementNested + { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedRefTopicType, + v: &ArbitraryUsedVecElementNested, ) -> std::result::Result { - Ok(match v { - ArbitraryUsedRefTopicType::Send => UsedRefTopicType::Send, - ArbitraryUsedRefTopicType::Recv => UsedRefTopicType::Recv, + Ok(UsedVecElementNested { + val: soroban_sdk::IntoVal::into_val(&v.val, env), + inner: soroban_sdk::IntoVal::into_val(&v.inner, env), + vec_inner: soroban_sdk::IntoVal::into_val(&v.vec_inner, env), }) } } }; -pub struct UsedRefDataType { - pub nested: UsedRefDataInner, +struct UsedNonPubStruct { + pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedRefDataType { +impl ::core::clone::Clone for UsedNonPubStruct { #[inline] - fn clone(&self) -> UsedRefDataType { - UsedRefDataType { - nested: ::core::clone::Clone::clone(&self.nested), + fn clone(&self) -> UsedNonPubStruct { + UsedNonPubStruct { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedRefDataType { +impl ::core::fmt::Debug for UsedNonPubStruct { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( - f, - "UsedRefDataType", - "nested", - &&self.nested, - ) + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedNonPubStruct", "val", &&self.val) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedRefDataType { +impl ::core::cmp::Eq for UsedNonPubStruct { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedRefDataType {} +impl ::core::marker::StructuralPartialEq for UsedNonPubStruct {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedRefDataType { +impl ::core::cmp::PartialEq for UsedNonPubStruct { #[inline] - fn eq(&self, other: &UsedRefDataType) -> bool { - self.nested == other.nested - } -} -pub static __SPEC_XDR_TYPE_USEDREFDATATYPE: [u8; 76usize] = UsedRefDataType::spec_xdr(); -impl UsedRefDataType { - pub const fn spec_xdr() -> [u8; 76usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fUsedRefDataType\0\0\0\0\x01\0\0\0\0\0\0\0\x06nested\0\0\0\0\x07\xd0\0\0\0\x10UsedRefDataInner" + fn eq(&self, other: &UsedNonPubStruct) -> bool { + self.val == other.val } } -impl soroban_sdk::TryFromVal for UsedRefDataType { +impl soroban_sdk::TryFromVal for UsedNonPubStruct { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["nested"]; + const KEYS: [&'static str; 1usize] = ["val"]; let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - nested: vals[0] + val: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedRefDataType, + val: &UsedNonPubStruct, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["nested"]; - let vals: [Val; 1usize] = [(&val.nested) - .try_into_val(env) - .map_err(|_| ConversionError)?]; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedRefDataType, + val: &&UsedNonPubStruct, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedRefDataType { +impl soroban_sdk::TryFromVal for UsedNonPubStruct { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -6988,9 +11097,9 @@ impl soroban_sdk::TryFromVal for Used } map.validate()?; Ok(Self { - nested: { + val: { let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "nested" + "val" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) @@ -7007,7 +11116,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedRefDataType { +impl soroban_sdk::TryFromVal for UsedNonPubStruct { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -7021,116 +11130,115 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedRefDataType> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedNonPubStruct> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedRefDataType) -> Result { + fn try_from(val: &UsedNonPubStruct) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ soroban_sdk::xdr::ScMapEntry { key: soroban_sdk::xdr::ScSymbol( - "nested" + "val" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(), - val: (&val.nested) + val: (&val.val) .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, }, ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedRefDataType) -> Result { + fn try_from(val: UsedNonPubStruct) -> Result { (&val).try_into() } } -impl TryFrom<&UsedRefDataType> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedNonPubStruct> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedRefDataType) -> Result { + fn try_from(val: &UsedNonPubStruct) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedRefDataType) -> Result { + fn try_from(val: UsedNonPubStruct) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedRefDataType { - nested: - ::Prototype, + struct ArbitraryUsedNonPubStruct { + val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedRefDataType { + impl ::core::fmt::Debug for ArbitraryUsedNonPubStruct { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedRefDataType", - "nested", - &&self.nested, + "ArbitraryUsedNonPubStruct", + "val", + &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedRefDataType { + impl ::core::clone::Clone for ArbitraryUsedNonPubStruct { #[inline] - fn clone(&self) -> ArbitraryUsedRefDataType { - ArbitraryUsedRefDataType { - nested: ::core::clone::Clone::clone(&self.nested), + fn clone(&self) -> ArbitraryUsedNonPubStruct { + ArbitraryUsedNonPubStruct { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedRefDataType { + impl ::core::cmp::Eq for ArbitraryUsedNonPubStruct { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq< - ::Prototype, + ::Prototype, >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedRefDataType {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedNonPubStruct {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedRefDataType { + impl ::core::cmp::PartialEq for ArbitraryUsedNonPubStruct { #[inline] - fn eq(&self, other: &ArbitraryUsedRefDataType) -> bool { - self.nested == other.nested + fn eq(&self, other: &ArbitraryUsedNonPubStruct) -> bool { + self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedRefDataType { + impl ::core::cmp::Ord for ArbitraryUsedNonPubStruct { #[inline] - fn cmp(&self, other: &ArbitraryUsedRefDataType) -> ::core::cmp::Ordering { - ::core::cmp::Ord::cmp(&self.nested, &other.nested) + fn cmp(&self, other: &ArbitraryUsedNonPubStruct) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedRefDataType { + impl ::core::cmp::PartialOrd for ArbitraryUsedNonPubStruct { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedRefDataType, + other: &ArbitraryUsedNonPubStruct, ) -> ::core::option::Option<::core::cmp::Ordering> { - ::core::cmp::PartialOrd::partial_cmp(&self.nested, &other.nested) + ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedRefDataType: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedNonPubStruct: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -7164,11 +11272,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedRefDataType { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedNonPubStruct { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefDataType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedNonPubStruct.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -7177,12 +11285,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedRefDataType { - nested: arbitrary::Arbitrary::arbitrary(u)?, + Ok(ArbitraryUsedNonPubStruct { + val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefDataType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedNonPubStruct.with(|count| { count.set(count.get() - 1); }); } @@ -7193,7 +11301,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefDataType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedNonPubStruct.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -7202,12 +11310,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedRefDataType { - nested: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + Ok(ArbitraryUsedNonPubStruct { + val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefDataType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedNonPubStruct.with(|count| { count.set(count.get() - 1); }); } @@ -7218,7 +11326,7 @@ const _: () = { arbitrary::size_hint::recursion_guard(depth, |depth| { arbitrary::size_hint::and_all( &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( + <::Prototype as arbitrary::Arbitrary>::size_hint( depth, ), ], @@ -7227,65 +11335,208 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedRefDataType { - type Prototype = ArbitraryUsedRefDataType; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedNonPubStruct { + type Prototype = ArbitraryUsedNonPubStruct; + } + impl soroban_sdk::TryFromVal for UsedNonPubStruct { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedNonPubStruct, + ) -> std::result::Result { + Ok(UsedNonPubStruct { + val: soroban_sdk::IntoVal::into_val(&v.val, env), + }) + } + } +}; +enum UsedNonPubError { + Fail = 1, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedNonPubError {} +#[automatically_derived] +impl ::core::clone::Clone for UsedNonPubError { + #[inline] + fn clone(&self) -> UsedNonPubError { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedNonPubError { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str(f, "Fail") + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedNonPubError { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedNonPubError {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedNonPubError { + #[inline] + fn eq(&self, other: &UsedNonPubError) -> bool { + true + } +} +impl TryFrom for UsedNonPubError { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: soroban_sdk::Error) -> Result { + if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { + let discriminant = error.get_code(); + Ok(match discriminant { + 1u32 => Self::Fail, + _ => return Err(error), + }) + } else { + Err(error) + } + } +} +impl TryFrom<&soroban_sdk::Error> for UsedNonPubError { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: &soroban_sdk::Error) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::Error { + #[inline(always)] + fn from(val: UsedNonPubError) -> soroban_sdk::Error { + <_ as From<&UsedNonPubError>>::from(&val) + } +} +impl From<&UsedNonPubError> for soroban_sdk::Error { + #[inline(always)] + fn from(val: &UsedNonPubError) -> soroban_sdk::Error { + match val { + UsedNonPubError::Fail => soroban_sdk::Error::from_contract_error(1u32), + } + } +} +impl TryFrom for UsedNonPubError { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: soroban_sdk::InvokeError) -> Result { + match error { + soroban_sdk::InvokeError::Abort => Err(error), + soroban_sdk::InvokeError::Contract(code) => Ok(match code { + 1u32 => Self::Fail, + _ => return Err(error), + }), + } + } +} +impl TryFrom<&soroban_sdk::InvokeError> for UsedNonPubError { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: &soroban_sdk::InvokeError) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: UsedNonPubError) -> soroban_sdk::InvokeError { + <_ as From<&UsedNonPubError>>::from(&val) + } +} +impl From<&UsedNonPubError> for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: &UsedNonPubError) -> soroban_sdk::InvokeError { + match val { + UsedNonPubError::Fail => soroban_sdk::InvokeError::Contract(1u32), + } + } +} +impl soroban_sdk::TryFromVal for UsedNonPubError { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let error: soroban_sdk::Error = val.try_into_val(env)?; + error.try_into().map_err(|_| soroban_sdk::ConversionError) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedNonPubError, + ) -> Result { + let error: soroban_sdk::Error = val.into(); + Ok(error.into()) } - impl soroban_sdk::TryFromVal for UsedRefDataType { - type Error = soroban_sdk::ConversionError; - fn try_from_val( - env: &soroban_sdk::Env, - v: &ArbitraryUsedRefDataType, - ) -> std::result::Result { - Ok(UsedRefDataType { - nested: soroban_sdk::IntoVal::into_val(&v.nested, env), - }) - } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedNonPubError, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } -}; -pub struct UsedRefDataInner { - pub val: u32, +} +pub struct UsedRecursiveRoot { + pub val: UsedRecursiveNode, } #[automatically_derived] -impl ::core::clone::Clone for UsedRefDataInner { +impl ::core::clone::Clone for UsedRecursiveRoot { #[inline] - fn clone(&self) -> UsedRefDataInner { - UsedRefDataInner { + fn clone(&self) -> UsedRecursiveRoot { + UsedRecursiveRoot { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedRefDataInner { +impl ::core::fmt::Debug for UsedRecursiveRoot { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedRefDataInner", "val", &&self.val) + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedRecursiveRoot", + "val", + &&self.val, + ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedRefDataInner { +impl ::core::cmp::Eq for UsedRecursiveRoot { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedRefDataInner {} +impl ::core::marker::StructuralPartialEq for UsedRecursiveRoot {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedRefDataInner { +impl ::core::cmp::PartialEq for UsedRecursiveRoot { #[inline] - fn eq(&self, other: &UsedRefDataInner) -> bool { + fn eq(&self, other: &UsedRecursiveRoot) -> bool { self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDREFDATAINNER: [u8; 52usize] = UsedRefDataInner::spec_xdr(); -impl UsedRefDataInner { - pub const fn spec_xdr() -> [u8; 52usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedRefDataInner\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDRECURSIVEROOT: [u8; 80usize] = UsedRecursiveRoot::spec_xdr(); +impl UsedRecursiveRoot { + pub const fn spec_xdr() -> [u8; 80usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedRecursiveRoot\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\x07\xd0\0\0\0\x11UsedRecursiveNode\0\0\0" } } -impl soroban_sdk::TryFromVal for UsedRefDataInner { +impl soroban_sdk::TryFromVal for UsedRecursiveRoot { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -7304,11 +11555,11 @@ impl soroban_sdk::TryFromVal for UsedRefData }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedRefDataInner, + val: &UsedRecursiveRoot, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["val"]; @@ -7319,17 +11570,17 @@ impl soroban_sdk::TryFromVal for soroban_sdk .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedRefDataInner, + val: &&UsedRecursiveRoot, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedRefDataInner { +impl soroban_sdk::TryFromVal for UsedRecursiveRoot { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -7363,7 +11614,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedRefDataInner { +impl soroban_sdk::TryFromVal for UsedRecursiveRoot { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -7377,10 +11628,10 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedRefDataInner> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedRecursiveRoot> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedRefDataInner) -> Result { + fn try_from(val: &UsedRecursiveRoot) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ @@ -7398,94 +11649,94 @@ impl TryFrom<&UsedRefDataInner> for soroban_sdk::xdr::ScMap { ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedRefDataInner) -> Result { + fn try_from(val: UsedRecursiveRoot) -> Result { (&val).try_into() } } -impl TryFrom<&UsedRefDataInner> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedRecursiveRoot> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedRefDataInner) -> Result { + fn try_from(val: &UsedRecursiveRoot) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedRefDataInner) -> Result { + fn try_from(val: UsedRecursiveRoot) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedRefDataInner { - val: ::Prototype, + pub struct ArbitraryUsedRecursiveRoot { + val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedRefDataInner { + impl ::core::fmt::Debug for ArbitraryUsedRecursiveRoot { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedRefDataInner", + "ArbitraryUsedRecursiveRoot", "val", &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedRefDataInner { + impl ::core::clone::Clone for ArbitraryUsedRecursiveRoot { #[inline] - fn clone(&self) -> ArbitraryUsedRefDataInner { - ArbitraryUsedRefDataInner { + fn clone(&self) -> ArbitraryUsedRecursiveRoot { + ArbitraryUsedRecursiveRoot { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedRefDataInner { + impl ::core::cmp::Eq for ArbitraryUsedRecursiveRoot { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq< - ::Prototype, + ::Prototype, >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedRefDataInner {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedRecursiveRoot {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedRefDataInner { + impl ::core::cmp::PartialEq for ArbitraryUsedRecursiveRoot { #[inline] - fn eq(&self, other: &ArbitraryUsedRefDataInner) -> bool { + fn eq(&self, other: &ArbitraryUsedRecursiveRoot) -> bool { self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedRefDataInner { + impl ::core::cmp::Ord for ArbitraryUsedRecursiveRoot { #[inline] - fn cmp(&self, other: &ArbitraryUsedRefDataInner) -> ::core::cmp::Ordering { + fn cmp(&self, other: &ArbitraryUsedRecursiveRoot) -> ::core::cmp::Ordering { ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedRefDataInner { + impl ::core::cmp::PartialOrd for ArbitraryUsedRecursiveRoot { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedRefDataInner, + other: &ArbitraryUsedRecursiveRoot, ) -> ::core::option::Option<::core::cmp::Ordering> { ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedRefDataInner: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedRecursiveRoot: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -7519,11 +11770,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedRefDataInner { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedRecursiveRoot { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefDataInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveRoot.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -7532,12 +11783,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedRefDataInner { + Ok(ArbitraryUsedRecursiveRoot { val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefDataInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveRoot.with(|count| { count.set(count.get() - 1); }); } @@ -7548,7 +11799,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefDataInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveRoot.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -7557,12 +11808,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedRefDataInner { + Ok(ArbitraryUsedRecursiveRoot { val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefDataInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveRoot.with(|count| { count.set(count.get() - 1); }); } @@ -7573,7 +11824,7 @@ const _: () = { arbitrary::size_hint::recursion_guard(depth, |depth| { arbitrary::size_hint::and_all( &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( + <::Prototype as arbitrary::Arbitrary>::size_hint( depth, ), ], @@ -7582,344 +11833,406 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedRefDataInner { - type Prototype = ArbitraryUsedRefDataInner; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedRecursiveRoot { + type Prototype = ArbitraryUsedRecursiveRoot; } - impl soroban_sdk::TryFromVal for UsedRefDataInner { + impl soroban_sdk::TryFromVal for UsedRecursiveRoot { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedRefDataInner, + v: &ArbitraryUsedRecursiveRoot, ) -> std::result::Result { - Ok(UsedRefDataInner { + Ok(UsedRecursiveRoot { val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -pub struct UsedEventWithRefs<'a> { - pub kind: &'a UsedRefTopicType, - pub payload: &'a UsedRefDataType, +pub enum UsedRecursiveNode { + NotRecursive(UsedLeaf), + Recursive(UsedRecursiveLeaf), } #[automatically_derived] -impl<'a> ::core::clone::Clone for UsedEventWithRefs<'a> { +impl ::core::clone::Clone for UsedRecursiveNode { #[inline] - fn clone(&self) -> UsedEventWithRefs<'a> { - UsedEventWithRefs { - kind: ::core::clone::Clone::clone(&self.kind), - payload: ::core::clone::Clone::clone(&self.payload), + fn clone(&self) -> UsedRecursiveNode { + match self { + UsedRecursiveNode::NotRecursive(__self_0) => { + UsedRecursiveNode::NotRecursive(::core::clone::Clone::clone(__self_0)) + } + UsedRecursiveNode::Recursive(__self_0) => { + UsedRecursiveNode::Recursive(::core::clone::Clone::clone(__self_0)) + } } } } #[automatically_derived] -impl<'a> ::core::fmt::Debug for UsedEventWithRefs<'a> { +impl ::core::fmt::Debug for UsedRecursiveNode { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( - f, - "UsedEventWithRefs", - "kind", - &self.kind, - "payload", - &&self.payload, - ) - } -} -#[automatically_derived] -impl<'a> ::core::cmp::Eq for UsedEventWithRefs<'a> { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq<&'a UsedRefTopicType>; - let _: ::core::cmp::AssertParamIsEq<&'a UsedRefDataType>; - } -} -#[automatically_derived] -impl<'a> ::core::marker::StructuralPartialEq for UsedEventWithRefs<'a> {} -#[automatically_derived] -impl<'a> ::core::cmp::PartialEq for UsedEventWithRefs<'a> { - #[inline] - fn eq(&self, other: &UsedEventWithRefs<'a>) -> bool { - self.kind == other.kind && self.payload == other.payload - } -} -pub static __SPEC_XDR_EVENT_USEDEVENTWITHREFS: [u8; 156usize] = UsedEventWithRefs::spec_xdr(); -impl<'a> UsedEventWithRefs<'a> { - pub const fn spec_xdr() -> [u8; 156usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x11UsedEventWithRefs\0\0\0\0\0\0\x01\0\0\0\x14used_event_with_refs\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\x07\xd0\0\0\0\x10UsedRefTopicType\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x0fUsedRefDataType\0\0\0\0\0\0\0\0\x02" - } -} -impl<'a> soroban_sdk::Event for UsedEventWithRefs<'a> { - fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { - use soroban_sdk::IntoVal; - ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_refs") }, - { - let v: soroban_sdk::Val = self.kind.into_val(env); - v - }, - ) - .into_val(env) - } - fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { - use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["payload"]; - let vals: [soroban_sdk::Val; 1usize] = [self.payload.into_val(env)]; - env.map_new_from_slices(&KEYS, &vals) - .unwrap_infallible() - .into() - } -} -impl<'a> UsedEventWithRefs<'a> { - pub fn publish(&self, env: &soroban_sdk::Env) { - <_ as soroban_sdk::Event>::publish(self, env); - } -} -pub struct UsedTupleElement { - pub val: u32, -} -#[automatically_derived] -impl ::core::clone::Clone for UsedTupleElement { - #[inline] - fn clone(&self) -> UsedTupleElement { - UsedTupleElement { - val: ::core::clone::Clone::clone(&self.val), + match self { + UsedRecursiveNode::NotRecursive(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "NotRecursive", &__self_0) + } + UsedRecursiveNode::Recursive(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Recursive", &__self_0) + } } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedTupleElement { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedTupleElement", "val", &&self.val) - } -} -#[automatically_derived] -impl ::core::cmp::Eq for UsedTupleElement { +impl ::core::cmp::Eq for UsedRecursiveNode { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedTupleElement {} +impl ::core::marker::StructuralPartialEq for UsedRecursiveNode {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedTupleElement { +impl ::core::cmp::PartialEq for UsedRecursiveNode { #[inline] - fn eq(&self, other: &UsedTupleElement) -> bool { - self.val == other.val + fn eq(&self, other: &UsedRecursiveNode) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + UsedRecursiveNode::NotRecursive(__self_0), + UsedRecursiveNode::NotRecursive(__arg1_0), + ) => __self_0 == __arg1_0, + ( + UsedRecursiveNode::Recursive(__self_0), + UsedRecursiveNode::Recursive(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } } } -pub static __SPEC_XDR_TYPE_USEDTUPLEELEMENT: [u8; 52usize] = UsedTupleElement::spec_xdr(); -impl UsedTupleElement { - pub const fn spec_xdr() -> [u8; 52usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedTupleElement\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDRECURSIVENODE: [u8; 140usize] = UsedRecursiveNode::spec_xdr(); +impl UsedRecursiveNode { + pub const fn spec_xdr() -> [u8; 140usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x11UsedRecursiveNode\0\0\0\0\0\0\x02\0\0\0\x01\0\0\0\0\0\0\0\x0cNotRecursive\0\0\0\x01\0\0\x07\xd0\0\0\0\x08UsedLeaf\0\0\0\x01\0\0\0\0\0\0\0\tRecursive\0\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x11UsedRecursiveLeaf\0\0\0" } } -impl soroban_sdk::TryFromVal for UsedTupleElement { +impl soroban_sdk::TryFromVal for UsedRecursiveNode { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; - let map: MapObject = val.try_into().map_err(|_| ConversionError)?; - env.map_unpack_to_slice(map, &KEYS, &mut vals) - .map_err(|_| ConversionError)?; - Ok(Self { - val: vals[0] - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?, - }) + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["NotRecursive", "Recursive"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::NotRecursive( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Recursive( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedTupleElement, - ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; - Ok(env - .map_new_from_slices(&KEYS, &vals) - .map_err(|_| ConversionError)? - .into()) + val: &UsedRecursiveNode, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + UsedRecursiveNode::NotRecursive(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"NotRecursive")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + UsedRecursiveNode::Recursive(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Recursive")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedTupleElement, + val: &&UsedRecursiveNode, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedTupleElement { +impl soroban_sdk::TryFromVal for UsedRecursiveNode { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &soroban_sdk::xdr::ScMap, + val: &soroban_sdk::xdr::ScVec, ) -> Result { use soroban_sdk::xdr::Validate; use soroban_sdk::TryIntoVal; - let map = val; - if map.len() != 1usize { - return Err(soroban_sdk::xdr::Error::Invalid); - } - map.validate()?; - Ok(Self { - val: { - let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "val" - .try_into() + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "NotRecursive" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::NotRecursive( + rv0.try_into_val(env) .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) - .into(); - let idx = map - .binary_search_by_key(&key, |entry| entry.key.clone()) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; - let rv: soroban_sdk::Val = (&map[idx].val.clone()) + } + "Recursive" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? .try_into_val(env) .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; - rv.try_into_val(env) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)? - }, + Self::Recursive( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, }) } } -impl soroban_sdk::TryFromVal for UsedTupleElement { +impl soroban_sdk::TryFromVal for UsedRecursiveNode { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::xdr::ScVal, ) -> Result { - if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { - <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) } else { Err(soroban_sdk::xdr::Error::Invalid) } } } -impl TryFrom<&UsedTupleElement> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedRecursiveNode> for soroban_sdk::xdr::ScVec { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedTupleElement) -> Result { + fn try_from(val: &UsedRecursiveNode) -> Result { extern crate alloc; - use soroban_sdk::TryFromVal; - soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ - soroban_sdk::xdr::ScMapEntry { - key: soroban_sdk::xdr::ScSymbol( - "val" + Ok(match val { + UsedRecursiveNode::NotRecursive(value0) => ( + soroban_sdk::xdr::ScSymbol( + "NotRecursive" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - ) - .into(), - val: (&val.val) - .try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - }, - ]))) + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + UsedRecursiveNode::Recursive(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Recursive" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScVec { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedTupleElement) -> Result { + fn try_from(val: UsedRecursiveNode) -> Result { (&val).try_into() } } -impl TryFrom<&UsedTupleElement> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedRecursiveNode> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedTupleElement) -> Result { - Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + fn try_from(val: &UsedRecursiveNode) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedTupleElement) -> Result { + fn try_from(val: UsedRecursiveNode) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedTupleElement { - val: ::Prototype, + pub enum ArbitraryUsedRecursiveNode { + NotRecursive(::Prototype), + Recursive( + ::Prototype, + ), } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedTupleElement { + impl ::core::fmt::Debug for ArbitraryUsedRecursiveNode { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( - f, - "ArbitraryUsedTupleElement", - "val", - &&self.val, - ) + match self { + ArbitraryUsedRecursiveNode::NotRecursive(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "NotRecursive", &__self_0) + } + ArbitraryUsedRecursiveNode::Recursive(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Recursive", &__self_0) + } + } } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedTupleElement { + impl ::core::clone::Clone for ArbitraryUsedRecursiveNode { #[inline] - fn clone(&self) -> ArbitraryUsedTupleElement { - ArbitraryUsedTupleElement { - val: ::core::clone::Clone::clone(&self.val), + fn clone(&self) -> ArbitraryUsedRecursiveNode { + match self { + ArbitraryUsedRecursiveNode::NotRecursive(__self_0) => { + ArbitraryUsedRecursiveNode::NotRecursive(::core::clone::Clone::clone(__self_0)) + } + ArbitraryUsedRecursiveNode::Recursive(__self_0) => { + ArbitraryUsedRecursiveNode::Recursive(::core::clone::Clone::clone(__self_0)) + } } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedTupleElement { + impl ::core::cmp::Eq for ArbitraryUsedRecursiveNode { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq< - ::Prototype, + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedTupleElement {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedRecursiveNode {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedTupleElement { + impl ::core::cmp::PartialEq for ArbitraryUsedRecursiveNode { #[inline] - fn eq(&self, other: &ArbitraryUsedTupleElement) -> bool { - self.val == other.val + fn eq(&self, other: &ArbitraryUsedRecursiveNode) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + ArbitraryUsedRecursiveNode::NotRecursive(__self_0), + ArbitraryUsedRecursiveNode::NotRecursive(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryUsedRecursiveNode::Recursive(__self_0), + ArbitraryUsedRecursiveNode::Recursive(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedTupleElement { + impl ::core::cmp::Ord for ArbitraryUsedRecursiveNode { #[inline] - fn cmp(&self, other: &ArbitraryUsedTupleElement) -> ::core::cmp::Ordering { - ::core::cmp::Ord::cmp(&self.val, &other.val) + fn cmp(&self, other: &ArbitraryUsedRecursiveNode) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + ArbitraryUsedRecursiveNode::NotRecursive(__self_0), + ArbitraryUsedRecursiveNode::NotRecursive(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryUsedRecursiveNode::Recursive(__self_0), + ArbitraryUsedRecursiveNode::Recursive(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedTupleElement { + impl ::core::cmp::PartialOrd for ArbitraryUsedRecursiveNode { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedTupleElement, + other: &ArbitraryUsedRecursiveNode, ) -> ::core::option::Option<::core::cmp::Ordering> { - ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + ArbitraryUsedRecursiveNode::NotRecursive(__self_0), + ArbitraryUsedRecursiveNode::NotRecursive(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + ArbitraryUsedRecursiveNode::Recursive(__self_0), + ArbitraryUsedRecursiveNode::Recursive(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedTupleElement: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedRecursiveNode: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -7953,11 +12266,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedTupleElement { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedRecursiveNode { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedTupleElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveNode.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -7966,12 +12279,23 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedTupleElement { - val: arbitrary::Arbitrary::arbitrary(u)?, - }) + Ok( + match (u64::from(::arbitrary(u)?) * 2u64) >> 32 + { + 0u64 => ArbitraryUsedRecursiveNode::NotRecursive( + arbitrary::Arbitrary::arbitrary(u)?, + ), + 1u64 => ArbitraryUsedRecursiveNode::Recursive( + arbitrary::Arbitrary::arbitrary(u)?, + ), + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedTupleElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveNode.with(|count| { count.set(count.get() - 1); }); } @@ -7982,7 +12306,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedTupleElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveNode.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -7991,12 +12315,24 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedTupleElement { - val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, - }) + Ok( + match (u64::from(::arbitrary(&mut u)?) * 2u64) + >> 32 + { + 0u64 => ArbitraryUsedRecursiveNode::NotRecursive( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 1u64 => ArbitraryUsedRecursiveNode::Recursive( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedTupleElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveNode.with(|count| { count.set(count.get() - 1); }); } @@ -8004,83 +12340,101 @@ const _: () = { } #[inline] fn size_hint(depth: usize) -> (usize, Option) { - arbitrary::size_hint::recursion_guard(depth, |depth| { - arbitrary::size_hint::and_all( - &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( - depth, - ), - ], - ) - }) + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + ], + ) + }), + ) } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedTupleElement { - type Prototype = ArbitraryUsedTupleElement; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedRecursiveNode { + type Prototype = ArbitraryUsedRecursiveNode; } - impl soroban_sdk::TryFromVal for UsedTupleElement { + impl soroban_sdk::TryFromVal for UsedRecursiveNode { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedTupleElement, + v: &ArbitraryUsedRecursiveNode, ) -> std::result::Result { - Ok(UsedTupleElement { - val: soroban_sdk::IntoVal::into_val(&v.val, env), + Ok(match v { + ArbitraryUsedRecursiveNode::NotRecursive(field_0) => { + UsedRecursiveNode::NotRecursive(soroban_sdk::IntoVal::into_val(field_0, env)) + } + ArbitraryUsedRecursiveNode::Recursive(field_0) => { + UsedRecursiveNode::Recursive(soroban_sdk::IntoVal::into_val(field_0, env)) + } }) } } }; -pub struct UsedTupleReturnElement { - pub val: u32, +pub struct UsedRecursiveLeaf { + pub val: Vec, } #[automatically_derived] -impl ::core::clone::Clone for UsedTupleReturnElement { +impl ::core::clone::Clone for UsedRecursiveLeaf { #[inline] - fn clone(&self) -> UsedTupleReturnElement { - UsedTupleReturnElement { + fn clone(&self) -> UsedRecursiveLeaf { + UsedRecursiveLeaf { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedTupleReturnElement { +impl ::core::fmt::Debug for UsedRecursiveLeaf { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedTupleReturnElement", + "UsedRecursiveLeaf", "val", &&self.val, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedTupleReturnElement { +impl ::core::cmp::Eq for UsedRecursiveLeaf { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedTupleReturnElement {} +impl ::core::marker::StructuralPartialEq for UsedRecursiveLeaf {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedTupleReturnElement { +impl ::core::cmp::PartialEq for UsedRecursiveLeaf { #[inline] - fn eq(&self, other: &UsedTupleReturnElement) -> bool { + fn eq(&self, other: &UsedRecursiveLeaf) -> bool { self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDTUPLERETURNELEMENT: [u8; 60usize] = - UsedTupleReturnElement::spec_xdr(); -impl UsedTupleReturnElement { - pub const fn spec_xdr() -> [u8; 60usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x16UsedTupleReturnElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDRECURSIVELEAF: [u8; 84usize] = UsedRecursiveLeaf::spec_xdr(); +impl UsedRecursiveLeaf { + pub const fn spec_xdr() -> [u8; 84usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedRecursiveLeaf\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x11UsedRecursiveRoot\0\0\0" } } -impl soroban_sdk::TryFromVal for UsedTupleReturnElement { +impl soroban_sdk::TryFromVal for UsedRecursiveLeaf { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -8099,11 +12453,11 @@ impl soroban_sdk::TryFromVal for UsedTupleRe }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedTupleReturnElement, + val: &UsedRecursiveLeaf, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["val"]; @@ -8114,19 +12468,17 @@ impl soroban_sdk::TryFromVal for sorob .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedTupleReturnElement, + val: &&UsedRecursiveLeaf, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedTupleReturnElement { +impl soroban_sdk::TryFromVal for UsedRecursiveLeaf { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -8160,7 +12512,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedTupleReturnElement { +impl soroban_sdk::TryFromVal for UsedRecursiveLeaf { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -8174,10 +12526,10 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedTupleReturnElement> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedRecursiveLeaf> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedTupleReturnElement) -> Result { + fn try_from(val: &UsedRecursiveLeaf) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ @@ -8195,94 +12547,98 @@ impl TryFrom<&UsedTupleReturnElement> for soroban_sdk::xdr::ScMap { ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedTupleReturnElement) -> Result { + fn try_from(val: UsedRecursiveLeaf) -> Result { (&val).try_into() } } -impl TryFrom<&UsedTupleReturnElement> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedRecursiveLeaf> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedTupleReturnElement) -> Result { + fn try_from(val: &UsedRecursiveLeaf) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedTupleReturnElement) -> Result { + fn try_from(val: UsedRecursiveLeaf) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedTupleReturnElement { - val: ::Prototype, + pub struct ArbitraryUsedRecursiveLeaf { + val: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedTupleReturnElement { + impl ::core::fmt::Debug for ArbitraryUsedRecursiveLeaf { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedTupleReturnElement", + "ArbitraryUsedRecursiveLeaf", "val", &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedTupleReturnElement { + impl ::core::clone::Clone for ArbitraryUsedRecursiveLeaf { #[inline] - fn clone(&self) -> ArbitraryUsedTupleReturnElement { - ArbitraryUsedTupleReturnElement { + fn clone(&self) -> ArbitraryUsedRecursiveLeaf { + ArbitraryUsedRecursiveLeaf { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedTupleReturnElement { + impl ::core::cmp::Eq for ArbitraryUsedRecursiveLeaf { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq< - ::Prototype, + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedTupleReturnElement {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedRecursiveLeaf {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedTupleReturnElement { + impl ::core::cmp::PartialEq for ArbitraryUsedRecursiveLeaf { #[inline] - fn eq(&self, other: &ArbitraryUsedTupleReturnElement) -> bool { + fn eq(&self, other: &ArbitraryUsedRecursiveLeaf) -> bool { self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedTupleReturnElement { + impl ::core::cmp::Ord for ArbitraryUsedRecursiveLeaf { #[inline] - fn cmp(&self, other: &ArbitraryUsedTupleReturnElement) -> ::core::cmp::Ordering { + fn cmp(&self, other: &ArbitraryUsedRecursiveLeaf) -> ::core::cmp::Ordering { ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedTupleReturnElement { + impl ::core::cmp::PartialOrd for ArbitraryUsedRecursiveLeaf { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedTupleReturnElement, + other: &ArbitraryUsedRecursiveLeaf, ) -> ::core::option::Option<::core::cmp::Ordering> { ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedRecursiveLeaf: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -8316,11 +12672,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedTupleReturnElement { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedRecursiveLeaf { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveLeaf.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -8329,12 +12685,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedTupleReturnElement { + Ok(ArbitraryUsedRecursiveLeaf { val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveLeaf.with(|count| { count.set(count.get() - 1); }); } @@ -8345,7 +12701,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveLeaf.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -8354,12 +12710,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedTupleReturnElement { + Ok(ArbitraryUsedRecursiveLeaf { val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveLeaf.with(|count| { count.set(count.get() - 1); }); } @@ -8370,7 +12726,9 @@ const _: () = { arbitrary::size_hint::recursion_guard(depth, |depth| { arbitrary::size_hint::and_all( &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( depth, ), ], @@ -8379,44 +12737,42 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedTupleReturnElement { - type Prototype = ArbitraryUsedTupleReturnElement; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedRecursiveLeaf { + type Prototype = ArbitraryUsedRecursiveLeaf; } - impl soroban_sdk::TryFromVal - for UsedTupleReturnElement - { + impl soroban_sdk::TryFromVal for UsedRecursiveLeaf { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedTupleReturnElement, + v: &ArbitraryUsedRecursiveLeaf, ) -> std::result::Result { - Ok(UsedTupleReturnElement { + Ok(UsedRecursiveLeaf { val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -struct UsedNonPubStruct { +pub struct UsedLeaf { pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedNonPubStruct { +impl ::core::clone::Clone for UsedLeaf { #[inline] - fn clone(&self) -> UsedNonPubStruct { - UsedNonPubStruct { + fn clone(&self) -> UsedLeaf { + UsedLeaf { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedNonPubStruct { +impl ::core::fmt::Debug for UsedLeaf { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedNonPubStruct", "val", &&self.val) + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedLeaf", "val", &&self.val) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedNonPubStruct { +impl ::core::cmp::Eq for UsedLeaf { #[inline] #[doc(hidden)] #[coverage(off)] @@ -8425,15 +12781,21 @@ impl ::core::cmp::Eq for UsedNonPubStruct { } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedNonPubStruct {} +impl ::core::marker::StructuralPartialEq for UsedLeaf {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedNonPubStruct { +impl ::core::cmp::PartialEq for UsedLeaf { #[inline] - fn eq(&self, other: &UsedNonPubStruct) -> bool { + fn eq(&self, other: &UsedLeaf) -> bool { self.val == other.val } } -impl soroban_sdk::TryFromVal for UsedNonPubStruct { +pub static __SPEC_XDR_TYPE_USEDLEAF: [u8; 44usize] = UsedLeaf::spec_xdr(); +impl UsedLeaf { + pub const fn spec_xdr() -> [u8; 44usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x08UsedLeaf\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" + } +} +impl soroban_sdk::TryFromVal for UsedLeaf { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -8452,11 +12814,11 @@ impl soroban_sdk::TryFromVal for UsedNonPubS }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedNonPubStruct, + val: &UsedLeaf, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["val"]; @@ -8467,17 +12829,17 @@ impl soroban_sdk::TryFromVal for soroban_sdk .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedNonPubStruct, + val: &&UsedLeaf, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedNonPubStruct { +impl soroban_sdk::TryFromVal for UsedLeaf { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -8511,7 +12873,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedNonPubStruct { +impl soroban_sdk::TryFromVal for UsedLeaf { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -8525,10 +12887,10 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedNonPubStruct> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedLeaf> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedNonPubStruct) -> Result { + fn try_from(val: &UsedLeaf) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ @@ -8546,56 +12908,56 @@ impl TryFrom<&UsedNonPubStruct> for soroban_sdk::xdr::ScMap { ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedNonPubStruct) -> Result { + fn try_from(val: UsedLeaf) -> Result { (&val).try_into() } } -impl TryFrom<&UsedNonPubStruct> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedLeaf> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedNonPubStruct) -> Result { + fn try_from(val: &UsedLeaf) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedNonPubStruct) -> Result { + fn try_from(val: UsedLeaf) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - struct ArbitraryUsedNonPubStruct { + pub struct ArbitraryUsedLeaf { val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedNonPubStruct { + impl ::core::fmt::Debug for ArbitraryUsedLeaf { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedNonPubStruct", + "ArbitraryUsedLeaf", "val", &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedNonPubStruct { + impl ::core::clone::Clone for ArbitraryUsedLeaf { #[inline] - fn clone(&self) -> ArbitraryUsedNonPubStruct { - ArbitraryUsedNonPubStruct { + fn clone(&self) -> ArbitraryUsedLeaf { + ArbitraryUsedLeaf { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedNonPubStruct { + impl ::core::cmp::Eq for ArbitraryUsedLeaf { #[inline] #[doc(hidden)] #[coverage(off)] @@ -8606,36 +12968,34 @@ const _: () = { } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedNonPubStruct {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedLeaf {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedNonPubStruct { + impl ::core::cmp::PartialEq for ArbitraryUsedLeaf { #[inline] - fn eq(&self, other: &ArbitraryUsedNonPubStruct) -> bool { + fn eq(&self, other: &ArbitraryUsedLeaf) -> bool { self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedNonPubStruct { + impl ::core::cmp::Ord for ArbitraryUsedLeaf { #[inline] - fn cmp(&self, other: &ArbitraryUsedNonPubStruct) -> ::core::cmp::Ordering { + fn cmp(&self, other: &ArbitraryUsedLeaf) -> ::core::cmp::Ordering { ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedNonPubStruct { + impl ::core::cmp::PartialOrd for ArbitraryUsedLeaf { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedNonPubStruct, + other: &ArbitraryUsedLeaf, ) -> ::core::option::Option<::core::cmp::Ordering> { ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedNonPubStruct: ::std::thread::LocalKey< - std::cell::Cell, - > = { + const RECURSIVE_COUNT_ArbitraryUsedLeaf: ::std::thread::LocalKey> = { #[inline] fn __init() -> std::cell::Cell { std::cell::Cell::new(0) @@ -8667,11 +13027,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedNonPubStruct { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedLeaf { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedNonPubStruct.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedLeaf.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -8680,12 +13040,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedNonPubStruct { + Ok(ArbitraryUsedLeaf { val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedNonPubStruct.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedLeaf.with(|count| { count.set(count.get() - 1); }); } @@ -8696,7 +13056,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedNonPubStruct.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedLeaf.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -8705,12 +13065,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedNonPubStruct { + Ok(ArbitraryUsedLeaf { val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedNonPubStruct.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedLeaf.with(|count| { count.set(count.get() - 1); }); } @@ -8727,162 +13087,24 @@ const _: () = { ], ) }) - } - } - }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedNonPubStruct { - type Prototype = ArbitraryUsedNonPubStruct; - } - impl soroban_sdk::TryFromVal for UsedNonPubStruct { - type Error = soroban_sdk::ConversionError; - fn try_from_val( - env: &soroban_sdk::Env, - v: &ArbitraryUsedNonPubStruct, - ) -> std::result::Result { - Ok(UsedNonPubStruct { - val: soroban_sdk::IntoVal::into_val(&v.val, env), - }) - } - } -}; -enum UsedNonPubError { - Fail = 1, -} -#[automatically_derived] -impl ::core::marker::Copy for UsedNonPubError {} -#[automatically_derived] -impl ::core::clone::Clone for UsedNonPubError { - #[inline] - fn clone(&self) -> UsedNonPubError { - *self - } -} -#[automatically_derived] -impl ::core::fmt::Debug for UsedNonPubError { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str(f, "Fail") - } -} -#[automatically_derived] -impl ::core::cmp::Eq for UsedNonPubError { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} -} -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedNonPubError {} -#[automatically_derived] -impl ::core::cmp::PartialEq for UsedNonPubError { - #[inline] - fn eq(&self, other: &UsedNonPubError) -> bool { - true - } -} -impl TryFrom for UsedNonPubError { - type Error = soroban_sdk::Error; - #[inline(always)] - fn try_from(error: soroban_sdk::Error) -> Result { - if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { - let discriminant = error.get_code(); - Ok(match discriminant { - 1u32 => Self::Fail, - _ => return Err(error), - }) - } else { - Err(error) - } - } -} -impl TryFrom<&soroban_sdk::Error> for UsedNonPubError { - type Error = soroban_sdk::Error; - #[inline(always)] - fn try_from(error: &soroban_sdk::Error) -> Result { - <_ as TryFrom>::try_from(*error) - } -} -impl From for soroban_sdk::Error { - #[inline(always)] - fn from(val: UsedNonPubError) -> soroban_sdk::Error { - <_ as From<&UsedNonPubError>>::from(&val) - } -} -impl From<&UsedNonPubError> for soroban_sdk::Error { - #[inline(always)] - fn from(val: &UsedNonPubError) -> soroban_sdk::Error { - match val { - UsedNonPubError::Fail => soroban_sdk::Error::from_contract_error(1u32), - } - } -} -impl TryFrom for UsedNonPubError { - type Error = soroban_sdk::InvokeError; - #[inline(always)] - fn try_from(error: soroban_sdk::InvokeError) -> Result { - match error { - soroban_sdk::InvokeError::Abort => Err(error), - soroban_sdk::InvokeError::Contract(code) => Ok(match code { - 1u32 => Self::Fail, - _ => return Err(error), - }), - } - } -} -impl TryFrom<&soroban_sdk::InvokeError> for UsedNonPubError { - type Error = soroban_sdk::InvokeError; - #[inline(always)] - fn try_from(error: &soroban_sdk::InvokeError) -> Result { - <_ as TryFrom>::try_from(*error) - } -} -impl From for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: UsedNonPubError) -> soroban_sdk::InvokeError { - <_ as From<&UsedNonPubError>>::from(&val) - } -} -impl From<&UsedNonPubError> for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: &UsedNonPubError) -> soroban_sdk::InvokeError { - match val { - UsedNonPubError::Fail => soroban_sdk::InvokeError::Contract(1u32), - } - } -} -impl soroban_sdk::TryFromVal for UsedNonPubError { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &soroban_sdk::Val, - ) -> Result { - use soroban_sdk::TryIntoVal; - let error: soroban_sdk::Error = val.try_into_val(env)?; - error.try_into().map_err(|_| soroban_sdk::ConversionError) - } -} -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &UsedNonPubError, - ) -> Result { - let error: soroban_sdk::Error = val.into(); - Ok(error.into()) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedLeaf { + type Prototype = ArbitraryUsedLeaf; } -} -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &&UsedNonPubError, - ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + impl soroban_sdk::TryFromVal for UsedLeaf { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedLeaf, + ) -> std::result::Result { + Ok(UsedLeaf { + val: soroban_sdk::IntoVal::into_val(&v.val, env), + }) + } } -} +}; mod wasm_imported { pub const WASM: &[u8] = b"\x00asm\x01\x00\x00\x00\x01*\x07`\x02~~\x01~`\x03~~~\x01~`\x01~\x01~`\x00\x01~`\x02\x7f\x7f\x01~`\x04\x7f\x7f\x7f\x7f\x01~`\x02\x7f~\x00\x02%\x06\x01b\x01j\x00\x00\x01x\x011\x00\x00\x01v\x01g\x00\x00\x01m\x019\x00\x01\x01i\x012\x00\x02\x01i\x011\x00\x02\x03\x0b\n\x03\x04\x03\x02\x00\x05\x00\x00\x06\x06\x05\x03\x01\x00\x11\x06!\x04\x7f\x01A\x80\x80\xc0\x00\x0b\x7f\x00A\x82\x80\xc0\x00\x0b\x7f\x00A\xa0\x80\xc0\x00\x0b\x7f\x00A\xa0\x80\xc0\x00\x0b\x07\x81\x01\n\x06memory\x02\x00\tfn_enum_a\x00\x06\rfn_enum_int_a\x00\x08\nfn_error_a\x00\t\nfn_event_a\x00\n\x0bfn_struct_a\x00\x0c\x11fn_struct_tuple_a\x00\r\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n\xbd\x08\n\x8b\x02\x03\x01\x7f\x01~\x03\x7f#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00B\x00!\x01A~!\x02\x03~\x02@\x02@\x02@\x02@\x02@ \x02E\r\x00A\x01!\x03 \x02A\x82\x80\xc0\x80\x00j-\x00\x00\"\x04A\xdf\x00F\r\x04 \x04APjA\xff\x01qA\nI\r\x02 \x04A\xbf\x7fjA\xff\x01qA\x1aI\r\x03\x02@ \x04A\x9f\x7fjA\xff\x01qA\x1aO\r\x00 \x04AEj!\x03\x0c\x05\x0b \x00 \x04\xadB\x08\x86B\x01\x847\x03\x00A\x80\x80\xc0\x80\x00\xadB \x86B\x04\x84B\x84\x80\x80\x80 \x10\x80\x80\x80\x80\x00!\x01\x0c\x01\x0b \x00 \x01B\x08\x86B\x0e\x84\"\x017\x02\x04\x0b \x00 \x017\x03\x00 \x00A\x01\x10\x87\x80\x80\x80\x00!\x01 \x00A\x10j$\x80\x80\x80\x80\x00 \x01\x0f\x0b \x04ARj!\x03\x0c\x01\x0b \x04AKj!\x03\x0b \x01B\x06\x86 \x03\xadB\xff\x01\x83\x84!\x01 \x02A\x01j!\x02\x0c\x00\x0b\x0b\x1a\x00 \x00\xadB \x86B\x04\x84 \x01\xadB \x86B\x04\x84\x10\x82\x80\x80\x80\x00\x0b\x08\x00B\x84\x80\x80\x800\x0b*\x00\x02@ \x00B\xff\x01\x83B\x04Q\r\x00\x00\x0bB\x83\x80\x80\x80 \x00B\x84\x80\x80\x80p\x83 \x00B\x80\x80\x80\x80\x10T\x1b\x0b\xdc\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A k\"\x02$\x80\x80\x80\x80\x00\x02@ \x00B\xff\x01\x83B\xcd\x00R\r\x00 \x01B\xff\x01\x83B\xc9\x00R\r\x00 \x02 \x007\x03\x08 \x02B\x8e\xcc\xc1\xfc\xac\xdd\xab\x017\x03\x00A\x00!\x03\x03@\x02@ \x03A\x10G\r\x00A\x00!\x03\x02@\x03@ \x03A\x10F\r\x01 \x02A\x10j \x03j \x02 \x03j)\x03\x007\x03\x00 \x03A\x08j!\x03\x0c\x00\x0b\x0b \x02A\x10jA\x02\x10\x87\x80\x80\x80\x00!\x00 \x02 \x017\x03\x10 \x00A\x98\x80\xc0\x80\x00A\x01 \x02A\x10jA\x01\x10\x8b\x80\x80\x80\x00\x10\x81\x80\x80\x80\x00\x1a \x02A j$\x80\x80\x80\x80\x00B\x02\x0f\x0b \x02A\x10j \x03jB\x027\x03\x00 \x03A\x08j!\x03\x0c\x00\x0b\x0b\x00\x0b.\x00\x02@ \x01 \x03F\r\x00\x00\x0b \x00\xadB \x86B\x04\x84 \x02\xadB \x86B\x04\x84 \x01\xadB \x86B\x04\x84\x10\x83\x80\x80\x80\x00\x0by\x01\x02\x7f#\x80\x80\x80\x80\x00A\x10k\"\x02$\x80\x80\x80\x80\x00\x02@ \x00B\xff\x01\x83B\x04R\r\x00A\x01A\x02A\x00 \x01\xa7A\xff\x01q\"\x03\x1b \x03A\x01F\x1b\"\x03A\x02F\r\x00 \x02 \x03\xad7\x03\x08 \x02 \x00B\x84\x80\x80\x80p\x837\x03\x00A\x88\x80\xc0\x80\x00A\x02 \x02A\x02\x10\x8b\x80\x80\x80\x00!\x00 \x02A\x10j$\x80\x80\x80\x80\x00 \x00\x0f\x0b\x00\x0b\xb2\x01\x01\x01\x7f#\x80\x80\x80\x80\x00A k\"\x02$\x80\x80\x80\x80\x00 \x02A\x10j \x00\x10\x8e\x80\x80\x80\x00\x02@ \x02(\x02\x10A\x01F\r\x00 \x02)\x03\x18!\x00 \x02A\x10j \x01\x10\x8e\x80\x80\x80\x00 \x02(\x02\x10A\x01F\r\x00 \x02)\x03\x18!\x01 \x02A\x10j \x00\x10\x8f\x80\x80\x80\x00 \x02(\x02\x10\r\x00 \x02)\x03\x18!\x00 \x02A\x10j \x01\x10\x8f\x80\x80\x80\x00 \x02(\x02\x10A\x01F\r\x00 \x02 \x02)\x03\x187\x03\x08 \x02 \x007\x03\x00 \x02A\x02\x10\x87\x80\x80\x80\x00!\x00 \x02A j$\x80\x80\x80\x80\x00 \x00\x0f\x0b\x00\x0b]\x02\x01\x7f\x01~\x02@\x02@ \x01\xa7A\xff\x01q\"\x02A\xc1\x00F\r\x00\x02@ \x02A\x07F\r\x00B\x01!\x03B\x83\x90\x80\x80\x80\x01!\x01\x0c\x02\x0b \x01B\x08\x87!\x01B\x00!\x03\x0c\x01\x0bB\x00!\x03 \x01\x10\x84\x80\x80\x80\x00!\x01\x0b \x00 \x037\x03\x00 \x00 \x017\x03\x08\x0bF\x00\x02@\x02@ \x01B\x80\x80\x80\x80\x80\x80\x80\xc0\x00|B\xff\xff\xff\xff\xff\xff\xff\xff\x00V\r\x00 \x01B\x08\x86B\x07\x84!\x01\x0c\x01\x0b \x01\x10\x85\x80\x80\x80\x00!\x01\x0b \x00B\x007\x03\x00 \x00 \x017\x03\x08\x0b\x0b)\x01\x00A\x80\x80\xc0\x00\x0b V2f1f2\x00\x00\x02\x00\x10\x00\x02\x00\x00\x00\x04\x00\x10\x00\x02\x00\x00\x00\x04\x00\x10\x00\x02\x00\x00\x00\x00\xbf\x0e\x0econtractspecv0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\tfn_enum_a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x05EnumA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nfn_error_a\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05input\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x03\xe9\x00\x00\x00\x04\x00\x00\x07\xd0\x00\x00\x00\x06ErrorA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nfn_event_a\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bfn_struct_a\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x07StructA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\rfn_enum_int_a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x08EnumIntA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11fn_struct_tuple_a\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0cStructTupleA\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumA\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumB\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x02\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumC\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x07StructA\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0cStructTupleA\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorA\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorB\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorC\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00d\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00e\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00f\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventA\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_a\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventB\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_b\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f3\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventC\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_c\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02f3\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructA\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructB\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructC\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x03\xea\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x13\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntA\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntB\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntC\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00d\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\xc8\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x01,\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleA\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleB\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleC\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\x0b\x00\x1e\x11contractenvmetav0\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x00\x00+\x0econtractmetav0\x00\x00\x00\x00\x00\x00\x00\x05rsver\x00\x00\x00\x00\x00\x00\x061.91.0\x00\x00"; pub trait Contract { @@ -18157,7 +22379,9 @@ impl soroban_sdk::TryFromVal for soroban_s } #[allow(private_interfaces)] impl Contract { + pub fn __constructor(_env: Env, _meta: UsedConstructorMeta) {} pub fn with_param(_env: Env, _s: UsedParamStruct, _ie: UsedParamIntEnum) {} + pub fn with_context(_env: Env, _context: Context) {} pub fn with_return(_env: Env) -> UsedReturnEnum { UsedReturnEnum::A(1) } @@ -18171,6 +22395,13 @@ impl Contract { }; } } + pub fn with_panic_error_ref(env: Env, fail: bool) { + if fail { + { + (&env).panic_with_error(&UsedPanicErrorEnumRef::Boom); + }; + } + } pub fn with_assert_error(env: Env, ok: bool) { { if !(ok) { @@ -18188,11 +22419,13 @@ impl Contract { } } pub fn with_vec(_env: Env, _v: Vec) {} + pub fn with_vec_nested(_env: Env, _v: Vec) {} pub fn with_map(_env: Env, _m: Map) {} pub fn with_option(_env: Env, _o: Option) {} pub fn with_result(_env: Env) -> Result { Ok(UsedResultOk { data: 1 }) } + pub fn with_recursion(_env: Env, _r: UsedRecursiveRoot) {} pub fn publish_simple(env: Env) { UsedEventSimple { kind: Symbol::new(&env, "transfer"), @@ -18256,6 +22489,21 @@ impl Contract { } #[doc(hidden)] #[allow(non_snake_case)] +pub mod __Contract____constructor__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN___CONSTRUCTOR: [u8; 76usize] = + super::Contract::spec_xdr___constructor(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr___constructor() -> [u8; 76usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\r__constructor\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04meta\0\0\x07\xd0\0\0\0\x13UsedConstructorMeta\0\0\0\0\0" + } +} +#[doc(hidden)] +#[allow(non_snake_case)] pub mod __Contract__with_param__spec { #[doc(hidden)] #[allow(non_snake_case)] @@ -18270,6 +22518,20 @@ impl Contract { } #[doc(hidden)] #[allow(non_snake_case)] +pub mod __Contract__with_context__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN_WITH_CONTEXT: [u8; 64usize] = super::Contract::spec_xdr_with_context(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_context() -> [u8; 64usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0cwith_context\0\0\0\x01\0\0\0\0\0\0\0\x07context\0\0\0\x07\xd0\0\0\0\x07Context\0\0\0\0\0" + } +} +#[doc(hidden)] +#[allow(non_snake_case)] pub mod __Contract__with_return__spec { #[doc(hidden)] #[allow(non_snake_case)] @@ -18313,6 +22575,21 @@ impl Contract { } #[doc(hidden)] #[allow(non_snake_case)] +pub mod __Contract__with_panic_error_ref__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN_WITH_PANIC_ERROR_REF: [u8; 56usize] = + super::Contract::spec_xdr_with_panic_error_ref(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_panic_error_ref() -> [u8; 56usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x14with_panic_error_ref\0\0\0\x01\0\0\0\0\0\0\0\x04fail\0\0\0\x01\0\0\0\0" + } +} +#[doc(hidden)] +#[allow(non_snake_case)] pub mod __Contract__with_assert_error__spec { #[doc(hidden)] #[allow(non_snake_case)] @@ -18357,6 +22634,21 @@ impl Contract { } #[doc(hidden)] #[allow(non_snake_case)] +pub mod __Contract__with_vec_nested__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN_WITH_VEC_NESTED: [u8; 80usize] = + super::Contract::spec_xdr_with_vec_nested(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_vec_nested() -> [u8; 80usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0fwith_vec_nested\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x14UsedVecElementNested\0\0\0\0" + } +} +#[doc(hidden)] +#[allow(non_snake_case)] pub mod __Contract__with_map__spec { #[doc(hidden)] #[allow(non_snake_case)] @@ -18399,6 +22691,21 @@ impl Contract { } #[doc(hidden)] #[allow(non_snake_case)] +pub mod __Contract__with_recursion__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN_WITH_RECURSION: [u8; 76usize] = + super::Contract::spec_xdr_with_recursion(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_recursion() -> [u8; 76usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0ewith_recursion\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01r\0\0\0\0\0\x07\xd0\0\0\0\x11UsedRecursiveRoot\0\0\0\0\0\0\0" + } +} +#[doc(hidden)] +#[allow(non_snake_case)] pub mod __Contract__publish_simple__spec { #[doc(hidden)] #[allow(non_snake_case)] @@ -18501,82 +22808,378 @@ impl Contract { pub const fn spec_xdr_with_wasm_imported() -> [u8; 68usize] { *b"\0\0\0\0\0\0\0\0\0\0\0\x12with_wasm_imported\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01s\0\0\0\0\0\x07\xd0\0\0\0\x07StructA\0\0\0\0\0" } -} -#[doc(hidden)] -#[allow(non_snake_case)] -pub mod __Contract__with_non_pub__spec { - #[doc(hidden)] - #[allow(non_snake_case)] - #[allow(non_upper_case_globals)] - pub static __SPEC_XDR_FN_WITH_NON_PUB: [u8; 68usize] = super::Contract::spec_xdr_with_non_pub(); -} -impl Contract { - #[allow(non_snake_case)] - pub const fn spec_xdr_with_non_pub() -> [u8; 68usize] { - *b"\0\0\0\0\0\0\0\0\0\0\0\x0cwith_non_pub\0\0\0\x01\0\0\0\0\0\0\0\x01s\0\0\0\0\0\x07\xd0\0\0\0\x10UsedNonPubStruct\0\0\0\0" +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__with_non_pub__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN_WITH_NON_PUB: [u8; 68usize] = super::Contract::spec_xdr_with_non_pub(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_non_pub() -> [u8; 68usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0cwith_non_pub\0\0\0\x01\0\0\0\0\0\0\0\x01s\0\0\0\0\0\x07\xd0\0\0\0\x10UsedNonPubStruct\0\0\0\0" + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__with_non_pub_error__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN_WITH_NON_PUB_ERROR: [u8; 72usize] = + super::Contract::spec_xdr_with_non_pub_error(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_non_pub_error() -> [u8; 72usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x12with_non_pub_error\0\0\0\0\0\0\0\0\0\x01\0\0\x03\xe9\0\0\0\x04\0\0\x07\xd0\0\0\0\x0fUsedNonPubError\0" + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__with_tuple__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN_WITH_TUPLE: [u8; 80usize] = super::Contract::spec_xdr_with_tuple(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_tuple() -> [u8; 80usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\nwith_tuple\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01t\0\0\0\0\0\x03\xed\0\0\0\x02\0\0\x07\xd0\0\0\0\x10UsedTupleElement\0\0\0\x04\0\0\0\0" + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__with_tuple_return__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN_WITH_TUPLE_RETURN: [u8; 84usize] = + super::Contract::spec_xdr_with_tuple_return(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_tuple_return() -> [u8; 84usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x11with_tuple_return\0\0\0\0\0\0\0\0\0\0\x01\0\0\x03\xed\0\0\0\x02\0\0\x07\xd0\0\0\0\x16UsedTupleReturnElement\0\0\0\0\0\x04" + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__publish_ref_event__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN_PUBLISH_REF_EVENT: [u8; 40usize] = + super::Contract::spec_xdr_publish_ref_event(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_publish_ref_event() -> [u8; 40usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x11publish_ref_event\0\0\0\0\0\0\0\0\0\0\0" + } +} +impl<'a> ContractClient<'a> { + pub fn with_param(&self, _s: &UsedParamStruct, _ie: &UsedParamIntEnum) -> () { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_param") }, + ::soroban_sdk::Vec::from_array( + &self.env, + [_s.into_val(&self.env), _ie.into_val(&self.env)], + ), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn try_with_param( + &self, + _s: &UsedParamStruct, + _ie: &UsedParamIntEnum, + ) -> Result< + Result<(), <() as soroban_sdk::TryFromVal>::Error>, + Result, + > { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_param") }, + ::soroban_sdk::Vec::from_array( + &self.env, + [_s.into_val(&self.env), _ie.into_val(&self.env)], + ), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn with_context(&self, _context: &Context) -> () { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_context") }, + ::soroban_sdk::Vec::from_array(&self.env, [_context.into_val(&self.env)]), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn try_with_context( + &self, + _context: &Context, + ) -> Result< + Result<(), <() as soroban_sdk::TryFromVal>::Error>, + Result, + > { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_context") }, + ::soroban_sdk::Vec::from_array(&self.env, [_context.into_val(&self.env)]), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res } -} -#[doc(hidden)] -#[allow(non_snake_case)] -pub mod __Contract__with_non_pub_error__spec { - #[doc(hidden)] - #[allow(non_snake_case)] - #[allow(non_upper_case_globals)] - pub static __SPEC_XDR_FN_WITH_NON_PUB_ERROR: [u8; 72usize] = - super::Contract::spec_xdr_with_non_pub_error(); -} -impl Contract { - #[allow(non_snake_case)] - pub const fn spec_xdr_with_non_pub_error() -> [u8; 72usize] { - *b"\0\0\0\0\0\0\0\0\0\0\0\x12with_non_pub_error\0\0\0\0\0\0\0\0\0\x01\0\0\x03\xe9\0\0\0\x04\0\0\x07\xd0\0\0\0\x0fUsedNonPubError\0" + pub fn with_return(&self) -> UsedReturnEnum { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_return") }, + ::soroban_sdk::Vec::new(&self.env), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res } -} -#[doc(hidden)] -#[allow(non_snake_case)] -pub mod __Contract__with_tuple__spec { - #[doc(hidden)] - #[allow(non_snake_case)] - #[allow(non_upper_case_globals)] - pub static __SPEC_XDR_FN_WITH_TUPLE: [u8; 80usize] = super::Contract::spec_xdr_with_tuple(); -} -impl Contract { - #[allow(non_snake_case)] - pub const fn spec_xdr_with_tuple() -> [u8; 80usize] { - *b"\0\0\0\0\0\0\0\0\0\0\0\nwith_tuple\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01t\0\0\0\0\0\x03\xed\0\0\0\x02\0\0\x07\xd0\0\0\0\x10UsedTupleElement\0\0\0\x04\0\0\0\0" + pub fn try_with_return( + &self, + ) -> Result< + Result< + UsedReturnEnum, + >::Error, + >, + Result, + > { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_return") }, + ::soroban_sdk::Vec::new(&self.env), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res } -} -#[doc(hidden)] -#[allow(non_snake_case)] -pub mod __Contract__with_tuple_return__spec { - #[doc(hidden)] - #[allow(non_snake_case)] - #[allow(non_upper_case_globals)] - pub static __SPEC_XDR_FN_WITH_TUPLE_RETURN: [u8; 84usize] = - super::Contract::spec_xdr_with_tuple_return(); -} -impl Contract { - #[allow(non_snake_case)] - pub const fn spec_xdr_with_tuple_return() -> [u8; 84usize] { - *b"\0\0\0\0\0\0\0\0\0\0\0\x11with_tuple_return\0\0\0\0\0\0\0\0\0\0\x01\0\0\x03\xed\0\0\0\x02\0\0\x07\xd0\0\0\0\x16UsedTupleReturnElement\0\0\0\0\0\x04" + pub fn with_error(&self) -> u32 { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_error") }, + ::soroban_sdk::Vec::new(&self.env), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res } -} -#[doc(hidden)] -#[allow(non_snake_case)] -pub mod __Contract__publish_ref_event__spec { - #[doc(hidden)] - #[allow(non_snake_case)] - #[allow(non_upper_case_globals)] - pub static __SPEC_XDR_FN_PUBLISH_REF_EVENT: [u8; 40usize] = - super::Contract::spec_xdr_publish_ref_event(); -} -impl Contract { - #[allow(non_snake_case)] - pub const fn spec_xdr_publish_ref_event() -> [u8; 40usize] { - *b"\0\0\0\0\0\0\0\0\0\0\0\x11publish_ref_event\0\0\0\0\0\0\0\0\0\0\0" + pub fn try_with_error( + &self, + ) -> Result< + Result>::Error>, + Result, + > { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_error") }, + ::soroban_sdk::Vec::new(&self.env), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res } -} -impl<'a> ContractClient<'a> { - pub fn with_param(&self, _s: &UsedParamStruct, _ie: &UsedParamIntEnum) -> () { + pub fn with_panic_error(&self, fail: &bool) -> () { use core::ops::Not; let old_auth_manager = self .env @@ -18601,21 +23204,17 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_param") }, - ::soroban_sdk::Vec::from_array( - &self.env, - [_s.into_val(&self.env), _ie.into_val(&self.env)], - ), + &{ soroban_sdk::Symbol::new(&self.env, "with_panic_error") }, + ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn try_with_param( + pub fn try_with_panic_error( &self, - _s: &UsedParamStruct, - _ie: &UsedParamIntEnum, + fail: &bool, ) -> Result< Result<(), <() as soroban_sdk::TryFromVal>::Error>, Result, @@ -18644,18 +23243,15 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_param") }, - ::soroban_sdk::Vec::from_array( - &self.env, - [_s.into_val(&self.env), _ie.into_val(&self.env)], - ), + &{ soroban_sdk::Symbol::new(&self.env, "with_panic_error") }, + ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn with_return(&self) -> UsedReturnEnum { + pub fn with_panic_error_ref(&self, fail: &bool) -> () { use core::ops::Not; let old_auth_manager = self .env @@ -18680,21 +23276,19 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_return") }, - ::soroban_sdk::Vec::new(&self.env), + &{ soroban_sdk::Symbol::new(&self.env, "with_panic_error_ref") }, + ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn try_with_return( + pub fn try_with_panic_error_ref( &self, + fail: &bool, ) -> Result< - Result< - UsedReturnEnum, - >::Error, - >, + Result<(), <() as soroban_sdk::TryFromVal>::Error>, Result, > { use core::ops::Not; @@ -18721,15 +23315,15 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_return") }, - ::soroban_sdk::Vec::new(&self.env), + &{ soroban_sdk::Symbol::new(&self.env, "with_panic_error_ref") }, + ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn with_error(&self) -> u32 { + pub fn with_assert_error(&self, ok: &bool) -> () { use core::ops::Not; let old_auth_manager = self .env @@ -18754,19 +23348,20 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_error") }, - ::soroban_sdk::Vec::new(&self.env), + &{ soroban_sdk::Symbol::new(&self.env, "with_assert_error") }, + ::soroban_sdk::Vec::from_array(&self.env, [ok.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn try_with_error( + pub fn try_with_assert_error( &self, + ok: &bool, ) -> Result< - Result>::Error>, - Result, + Result<(), <() as soroban_sdk::TryFromVal>::Error>, + Result, > { use core::ops::Not; let old_auth_manager = self @@ -18792,15 +23387,15 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_error") }, - ::soroban_sdk::Vec::new(&self.env), + &{ soroban_sdk::Symbol::new(&self.env, "with_assert_error") }, + ::soroban_sdk::Vec::from_array(&self.env, [ok.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn with_panic_error(&self, fail: &bool) -> () { + pub fn with_panic_raw_error(&self, fail: &bool) -> () { use core::ops::Not; let old_auth_manager = self .env @@ -18825,7 +23420,7 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_panic_error") }, + &{ soroban_sdk::Symbol::new(&self.env, "with_panic_raw_error") }, ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { @@ -18833,7 +23428,7 @@ impl<'a> ContractClient<'a> { } res } - pub fn try_with_panic_error( + pub fn try_with_panic_raw_error( &self, fail: &bool, ) -> Result< @@ -18864,7 +23459,7 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_panic_error") }, + &{ soroban_sdk::Symbol::new(&self.env, "with_panic_raw_error") }, ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { @@ -18872,7 +23467,7 @@ impl<'a> ContractClient<'a> { } res } - pub fn with_assert_error(&self, ok: &bool) -> () { + pub fn with_vec(&self, _v: &Vec) -> () { use core::ops::Not; let old_auth_manager = self .env @@ -18897,17 +23492,21 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_assert_error") }, - ::soroban_sdk::Vec::from_array(&self.env, [ok.into_val(&self.env)]), + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("with_vec"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array(&self.env, [_v.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn try_with_assert_error( + pub fn try_with_vec( &self, - ok: &bool, + _v: &Vec, ) -> Result< Result<(), <() as soroban_sdk::TryFromVal>::Error>, Result, @@ -18936,15 +23535,19 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_assert_error") }, - ::soroban_sdk::Vec::from_array(&self.env, [ok.into_val(&self.env)]), + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("with_vec"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array(&self.env, [_v.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn with_panic_raw_error(&self, fail: &bool) -> () { + pub fn with_vec_nested(&self, _v: &Vec) -> () { use core::ops::Not; let old_auth_manager = self .env @@ -18969,17 +23572,17 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_panic_raw_error") }, - ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), + &{ soroban_sdk::Symbol::new(&self.env, "with_vec_nested") }, + ::soroban_sdk::Vec::from_array(&self.env, [_v.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn try_with_panic_raw_error( + pub fn try_with_vec_nested( &self, - fail: &bool, + _v: &Vec, ) -> Result< Result<(), <() as soroban_sdk::TryFromVal>::Error>, Result, @@ -19008,15 +23611,15 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_panic_raw_error") }, - ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), + &{ soroban_sdk::Symbol::new(&self.env, "with_vec_nested") }, + ::soroban_sdk::Vec::from_array(&self.env, [_v.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn with_vec(&self, _v: &Vec) -> () { + pub fn with_map(&self, _m: &Map) -> () { use core::ops::Not; let old_auth_manager = self .env @@ -19043,19 +23646,19 @@ impl<'a> ContractClient<'a> { &self.address, &{ #[allow(deprecated)] - const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("with_vec"); + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("with_map"); SYMBOL }, - ::soroban_sdk::Vec::from_array(&self.env, [_v.into_val(&self.env)]), + ::soroban_sdk::Vec::from_array(&self.env, [_m.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn try_with_vec( + pub fn try_with_map( &self, - _v: &Vec, + _m: &Map, ) -> Result< Result<(), <() as soroban_sdk::TryFromVal>::Error>, Result, @@ -19086,17 +23689,17 @@ impl<'a> ContractClient<'a> { &self.address, &{ #[allow(deprecated)] - const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("with_vec"); + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("with_map"); SYMBOL }, - ::soroban_sdk::Vec::from_array(&self.env, [_v.into_val(&self.env)]), + ::soroban_sdk::Vec::from_array(&self.env, [_m.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn with_map(&self, _m: &Map) -> () { + pub fn with_option(&self, _o: &Option) -> () { use core::ops::Not; let old_auth_manager = self .env @@ -19121,21 +23724,17 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.invoke_contract( &self.address, - &{ - #[allow(deprecated)] - const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("with_map"); - SYMBOL - }, - ::soroban_sdk::Vec::from_array(&self.env, [_m.into_val(&self.env)]), + &{ soroban_sdk::Symbol::new(&self.env, "with_option") }, + ::soroban_sdk::Vec::from_array(&self.env, [_o.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn try_with_map( + pub fn try_with_option( &self, - _m: &Map, + _o: &Option, ) -> Result< Result<(), <() as soroban_sdk::TryFromVal>::Error>, Result, @@ -19164,19 +23763,15 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ - #[allow(deprecated)] - const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("with_map"); - SYMBOL - }, - ::soroban_sdk::Vec::from_array(&self.env, [_m.into_val(&self.env)]), + &{ soroban_sdk::Symbol::new(&self.env, "with_option") }, + ::soroban_sdk::Vec::from_array(&self.env, [_o.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn with_option(&self, _o: &Option) -> () { + pub fn with_result(&self) -> UsedResultOk { use core::ops::Not; let old_auth_manager = self .env @@ -19201,20 +23796,22 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_option") }, - ::soroban_sdk::Vec::from_array(&self.env, [_o.into_val(&self.env)]), + &{ soroban_sdk::Symbol::new(&self.env, "with_result") }, + ::soroban_sdk::Vec::new(&self.env), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn try_with_option( + pub fn try_with_result( &self, - _o: &Option, ) -> Result< - Result<(), <() as soroban_sdk::TryFromVal>::Error>, - Result, + Result< + UsedResultOk, + >::Error, + >, + Result, > { use core::ops::Not; let old_auth_manager = self @@ -19240,15 +23837,15 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_option") }, - ::soroban_sdk::Vec::from_array(&self.env, [_o.into_val(&self.env)]), + &{ soroban_sdk::Symbol::new(&self.env, "with_result") }, + ::soroban_sdk::Vec::new(&self.env), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn with_result(&self) -> UsedResultOk { + pub fn with_recursion(&self, _r: &UsedRecursiveRoot) -> () { use core::ops::Not; let old_auth_manager = self .env @@ -19273,22 +23870,20 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_result") }, - ::soroban_sdk::Vec::new(&self.env), + &{ soroban_sdk::Symbol::new(&self.env, "with_recursion") }, + ::soroban_sdk::Vec::from_array(&self.env, [_r.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn try_with_result( + pub fn try_with_recursion( &self, + _r: &UsedRecursiveRoot, ) -> Result< - Result< - UsedResultOk, - >::Error, - >, - Result, + Result<(), <() as soroban_sdk::TryFromVal>::Error>, + Result, > { use core::ops::Not; let old_auth_manager = self @@ -19314,8 +23909,8 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_result") }, - ::soroban_sdk::Vec::new(&self.env), + &{ soroban_sdk::Symbol::new(&self.env, "with_recursion") }, + ::soroban_sdk::Vec::from_array(&self.env, [_r.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); @@ -20186,6 +24781,11 @@ impl<'a> ContractClient<'a> { } } impl ContractArgs { + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn __constructor<'i>(_meta: &'i UsedConstructorMeta) -> (&'i UsedConstructorMeta,) { + (_meta,) + } #[inline(always)] #[allow(clippy::unused_unit)] pub fn with_param<'i>( @@ -20196,6 +24796,11 @@ impl ContractArgs { } #[inline(always)] #[allow(clippy::unused_unit)] + pub fn with_context<'i>(_context: &'i Context) -> (&'i Context,) { + (_context,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] pub fn with_return<'i>() -> () { () } @@ -20211,6 +24816,11 @@ impl ContractArgs { } #[inline(always)] #[allow(clippy::unused_unit)] + pub fn with_panic_error_ref<'i>(fail: &'i bool) -> (&'i bool,) { + (fail,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] pub fn with_assert_error<'i>(ok: &'i bool) -> (&'i bool,) { (ok,) } @@ -20226,6 +24836,13 @@ impl ContractArgs { } #[inline(always)] #[allow(clippy::unused_unit)] + pub fn with_vec_nested<'i>( + _v: &'i Vec, + ) -> (&'i Vec,) { + (_v,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] pub fn with_map<'i>(_m: &'i Map) -> (&'i Map,) { (_m,) } @@ -20241,6 +24858,11 @@ impl ContractArgs { } #[inline(always)] #[allow(clippy::unused_unit)] + pub fn with_recursion<'i>(_r: &'i UsedRecursiveRoot) -> (&'i UsedRecursiveRoot,) { + (_r,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] pub fn publish_simple<'i>() -> () { () } @@ -20302,6 +24924,55 @@ impl ContractArgs { } #[doc(hidden)] #[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__constructor` instead")] +#[allow(deprecated)] +pub fn __Contract____constructor__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::__constructor( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__constructor` instead")] +pub fn __Contract____constructor__invoke_raw_slice( + env: soroban_sdk::Env, + args: &[soroban_sdk::Val], +) -> soroban_sdk::Val { + if args.len() != 1usize { + { + ::core::panicking::panic_fmt(format_args!( + "invalid number of input arguments: {0} expected, got {1}", + 1usize, + args.len(), + )); + }; + } + #[allow(deprecated)] + __Contract____constructor__invoke_raw(env, args[0usize]) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__constructor` instead")] +pub extern "C" fn __Contract____constructor__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract____constructor__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] #[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_param` instead")] #[allow(deprecated)] pub fn __Contract__with_param__invoke_raw( @@ -20330,32 +25001,81 @@ pub fn __Contract__with_param__invoke_raw( } #[doc(hidden)] #[allow(non_snake_case)] -#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_param` instead")] -pub fn __Contract__with_param__invoke_raw_slice( +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_param` instead")] +pub fn __Contract__with_param__invoke_raw_slice( + env: soroban_sdk::Env, + args: &[soroban_sdk::Val], +) -> soroban_sdk::Val { + if args.len() != 2usize { + { + ::core::panicking::panic_fmt(format_args!( + "invalid number of input arguments: {0} expected, got {1}", + 2usize, + args.len(), + )); + }; + } + #[allow(deprecated)] + __Contract__with_param__invoke_raw(env, args[0usize], args[1usize]) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_param` instead")] +pub extern "C" fn __Contract__with_param__invoke_raw_extern( + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__with_param__invoke_raw(soroban_sdk::Env::default(), arg_0, arg_1) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_context` instead")] +#[allow(deprecated)] +pub fn __Contract__with_context__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::with_context( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_context` instead")] +pub fn __Contract__with_context__invoke_raw_slice( env: soroban_sdk::Env, args: &[soroban_sdk::Val], ) -> soroban_sdk::Val { - if args.len() != 2usize { + if args.len() != 1usize { { ::core::panicking::panic_fmt(format_args!( "invalid number of input arguments: {0} expected, got {1}", - 2usize, + 1usize, args.len(), )); }; } #[allow(deprecated)] - __Contract__with_param__invoke_raw(env, args[0usize], args[1usize]) + __Contract__with_context__invoke_raw(env, args[0usize]) } #[doc(hidden)] #[allow(non_snake_case)] -#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_param` instead")] -pub extern "C" fn __Contract__with_param__invoke_raw_extern( +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_context` instead")] +pub extern "C" fn __Contract__with_context__invoke_raw_extern( arg_0: soroban_sdk::Val, - arg_1: soroban_sdk::Val, ) -> soroban_sdk::Val { #[allow(deprecated)] - __Contract__with_param__invoke_raw(soroban_sdk::Env::default(), arg_0, arg_1) + __Contract__with_context__invoke_raw(soroban_sdk::Env::default(), arg_0) } #[doc(hidden)] #[allow(non_snake_case)] @@ -20480,6 +25200,55 @@ pub extern "C" fn __Contract__with_panic_error__invoke_raw_extern( } #[doc(hidden)] #[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_panic_error_ref` instead")] +#[allow(deprecated)] +pub fn __Contract__with_panic_error_ref__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::with_panic_error_ref( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_panic_error_ref` instead")] +pub fn __Contract__with_panic_error_ref__invoke_raw_slice( + env: soroban_sdk::Env, + args: &[soroban_sdk::Val], +) -> soroban_sdk::Val { + if args.len() != 1usize { + { + ::core::panicking::panic_fmt(format_args!( + "invalid number of input arguments: {0} expected, got {1}", + 1usize, + args.len(), + )); + }; + } + #[allow(deprecated)] + __Contract__with_panic_error_ref__invoke_raw(env, args[0usize]) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_panic_error_ref` instead")] +pub extern "C" fn __Contract__with_panic_error_ref__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__with_panic_error_ref__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] #[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_assert_error` instead")] #[allow(deprecated)] pub fn __Contract__with_assert_error__invoke_raw( @@ -20627,6 +25396,55 @@ pub extern "C" fn __Contract__with_vec__invoke_raw_extern( } #[doc(hidden)] #[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_vec_nested` instead")] +#[allow(deprecated)] +pub fn __Contract__with_vec_nested__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::with_vec_nested( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_vec_nested` instead")] +pub fn __Contract__with_vec_nested__invoke_raw_slice( + env: soroban_sdk::Env, + args: &[soroban_sdk::Val], +) -> soroban_sdk::Val { + if args.len() != 1usize { + { + ::core::panicking::panic_fmt(format_args!( + "invalid number of input arguments: {0} expected, got {1}", + 1usize, + args.len(), + )); + }; + } + #[allow(deprecated)] + __Contract__with_vec_nested__invoke_raw(env, args[0usize]) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_vec_nested` instead")] +pub extern "C" fn __Contract__with_vec_nested__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__with_vec_nested__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] #[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_map` instead")] #[allow(deprecated)] pub fn __Contract__with_map__invoke_raw( @@ -20761,6 +25579,55 @@ pub extern "C" fn __Contract__with_result__invoke_raw_extern() -> soroban_sdk::V } #[doc(hidden)] #[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_recursion` instead")] +#[allow(deprecated)] +pub fn __Contract__with_recursion__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::with_recursion( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_recursion` instead")] +pub fn __Contract__with_recursion__invoke_raw_slice( + env: soroban_sdk::Env, + args: &[soroban_sdk::Val], +) -> soroban_sdk::Val { + if args.len() != 1usize { + { + ::core::panicking::panic_fmt(format_args!( + "invalid number of input arguments: {0} expected, got {1}", + 1usize, + args.len(), + )); + }; + } + #[allow(deprecated)] + __Contract__with_recursion__invoke_raw(env, args[0usize]) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_recursion` instead")] +pub extern "C" fn __Contract__with_recursion__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__with_recursion__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] #[deprecated(note = "use `ContractClient::new(&env, &contract_id).publish_simple` instead")] #[allow(deprecated)] pub fn __Contract__publish_simple__invoke_raw(env: soroban_sdk::Env) -> soroban_sdk::Val { @@ -21246,7 +26113,7 @@ pub extern "C" fn __Contract__publish_ref_event__invoke_raw_extern() -> soroban_ #[doc(hidden)] #[allow(non_snake_case)] #[allow(unused)] -fn __Contract____72b5aebeb1af1dc083347284f3fd5e8bb48509c944bf8958f42d24678cfcd7a7_ctor() { +fn __Contract____b0b775ab08c55b3c14d80f9e18224a59091ef93d6cb9cd08fd75b94a7ad289b8_ctor() { #[allow(unsafe_code)] { #[link_section = ".init_array"] @@ -21258,7 +26125,7 @@ fn __Contract____72b5aebeb1af1dc083347284f3fd5e8bb48509c944bf8958f42d24678cfcd7a #[allow(non_snake_case)] extern "C" fn f() -> ::ctor::__support::CtorRetType { unsafe { - __Contract____72b5aebeb1af1dc083347284f3fd5e8bb48509c944bf8958f42d24678cfcd7a7_ctor(); + __Contract____b0b775ab08c55b3c14d80f9e18224a59091ef93d6cb9cd08fd75b94a7ad289b8_ctor(); }; core::default::Default::default() } @@ -21266,11 +26133,21 @@ fn __Contract____72b5aebeb1af1dc083347284f3fd5e8bb48509c944bf8958f42d24678cfcd7a }; } { + ::register( + "__constructor", + #[allow(deprecated)] + &__Contract____constructor__invoke_raw_slice, + ); ::register( "with_param", #[allow(deprecated)] &__Contract__with_param__invoke_raw_slice, ); + ::register( + "with_context", + #[allow(deprecated)] + &__Contract__with_context__invoke_raw_slice, + ); ::register( "with_return", #[allow(deprecated)] @@ -21286,6 +26163,11 @@ fn __Contract____72b5aebeb1af1dc083347284f3fd5e8bb48509c944bf8958f42d24678cfcd7a #[allow(deprecated)] &__Contract__with_panic_error__invoke_raw_slice, ); + ::register( + "with_panic_error_ref", + #[allow(deprecated)] + &__Contract__with_panic_error_ref__invoke_raw_slice, + ); ::register( "with_assert_error", #[allow(deprecated)] @@ -21301,6 +26183,11 @@ fn __Contract____72b5aebeb1af1dc083347284f3fd5e8bb48509c944bf8958f42d24678cfcd7a #[allow(deprecated)] &__Contract__with_vec__invoke_raw_slice, ); + ::register( + "with_vec_nested", + #[allow(deprecated)] + &__Contract__with_vec_nested__invoke_raw_slice, + ); ::register( "with_map", #[allow(deprecated)] @@ -21316,6 +26203,11 @@ fn __Contract____72b5aebeb1af1dc083347284f3fd5e8bb48509c944bf8958f42d24678cfcd7a #[allow(deprecated)] &__Contract__with_result__invoke_raw_slice, ); + ::register( + "with_recursion", + #[allow(deprecated)] + &__Contract__with_recursion__invoke_raw_slice, + ); ::register( "publish_simple", #[allow(deprecated)] @@ -21378,6 +26270,145 @@ fn __Contract____72b5aebeb1af1dc083347284f3fd5e8bb48509c944bf8958f42d24678cfcd7a ); } } +impl CustomAccountInterface for Contract { + type Error = UsedAuthErrorEnum; + type Signature = CustomSignature; + fn __check_auth( + _env: Env, + _signature_payload: Hash<32>, + _signatures: Self::Signature, + _auth_contexts: Vec, + ) -> Result<(), UsedAuthErrorEnum> { + Ok(()) + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract____check_auth__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN___CHECK_AUTH: [u8; 192usize] = + super::Contract::spec_xdr___check_auth(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr___check_auth() -> [u8; 192usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0c__check_auth\0\0\0\x03\0\0\0\0\0\0\0\x11signature_payload\0\0\0\0\0\x03\xee\0\0\0 \0\0\0\0\0\0\0\nsignatures\0\0\0\0\x07\xd0\0\0\0\x0fCustomSignature\0\0\0\0\0\0\0\0\rauth_contexts\0\0\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x07Context\0\0\0\0\x01\0\0\x03\xe9\0\0\0\x02\0\0\x07\xd0\0\0\0\x11UsedAuthErrorEnum\0\0\0" + } +} +impl<'a> ContractClient<'a> {} +impl ContractArgs { + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn __check_auth<'i>( + _signature_payload: &'i Hash<32>, + _signatures: &'i CustomSignature, + _auth_contexts: &'i Vec, + ) -> ( + &'i Hash<32>, + &'i CustomSignature, + &'i Vec, + ) { + (_signature_payload, _signatures, _auth_contexts) + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__check_auth` instead")] +#[allow(deprecated)] +pub fn __Contract____check_auth__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, + arg_2: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::__check_auth( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_1), + ), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_2), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__check_auth` instead")] +pub fn __Contract____check_auth__invoke_raw_slice( + env: soroban_sdk::Env, + args: &[soroban_sdk::Val], +) -> soroban_sdk::Val { + if args.len() != 3usize { + { + ::core::panicking::panic_fmt(format_args!( + "invalid number of input arguments: {0} expected, got {1}", + 3usize, + args.len(), + )); + }; + } + #[allow(deprecated)] + __Contract____check_auth__invoke_raw(env, args[0usize], args[1usize], args[2usize]) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__check_auth` instead")] +pub extern "C" fn __Contract____check_auth__invoke_raw_extern( + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, + arg_2: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract____check_auth__invoke_raw(soroban_sdk::Env::default(), arg_0, arg_1, arg_2) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[allow(unused)] +fn __Contract__CustomAccountInterface__d465b6861ce11142d9f64c1622e1ad88ae003d910de0a8493889a96a23449736_ctor( +) { + #[allow(unsafe_code)] + { + #[link_section = ".init_array"] + #[used] + #[allow(non_upper_case_globals, non_snake_case)] + #[doc(hidden)] + static f: extern "C" fn() -> ::ctor::__support::CtorRetType = { + #[link_section = ".text.startup"] + #[allow(non_snake_case)] + extern "C" fn f() -> ::ctor::__support::CtorRetType { + unsafe { + __Contract__CustomAccountInterface__d465b6861ce11142d9f64c1622e1ad88ae003d910de0a8493889a96a23449736_ctor(); + }; + core::default::Default::default() + } + f + }; + } + { + ::register( + "__check_auth", + #[allow(deprecated)] + &__Contract____check_auth__invoke_raw_slice, + ); + } +} #[allow(dead_code)] fn non_contract_fn(_s: UnusedNonContractFnParam) -> UnusedNonContractFnReturn { UnusedNonContractFnReturn { x: 1 } @@ -21387,7 +26418,7 @@ mod test { use soroban_sdk::xdr::ScSpecEntry; use std::collections::HashSet; use std::vec::Vec; - const WASM: &[u8] = b"\x00asm\x01\x00\x00\x00\x01D\x0b`\x02~~\x01~`\x01~\x01~`\x03~~~\x01~`\x04~~~~\x01~`\x00\x01~`\x02\x7f\x7f\x01~`\x04\x7f\x7f\x7f\x7f\x01~`\x01~\x00`\x05~\x7f\x7f\x7f\x7f\x00`\x03\x7f\x7f\x7f\x00`\x01\x7f\x01~\x021\x08\x01x\x011\x00\x00\x01i\x012\x00\x01\x01v\x01h\x00\x02\x01v\x01g\x00\x00\x01b\x01j\x00\x00\x01x\x015\x00\x01\x01m\x019\x00\x02\x01m\x01a\x00\x03\x03\x1f\x1e\x04\x05\x00\x06\x04\x04\x04\x04\x04\x04\x01\x07\x04\x01\x08\x01\x01\x04\x01\x01\x01\x00\x04\x04\t\n\x01\x04\x01\x01\x05\x03\x01\x00\x11\x06!\x04\x7f\x01A\x80\x80\xc0\x00\x0b\x7f\x00A\x9a\x82\xc0\x00\x0b\x7f\x00A\xb0\x82\xc0\x00\x0b\x7f\x00A\xb0\x82\xc0\x00\x0b\x07\xa8\x03\x1a\x06memory\x02\x00\x11publish_data_type\x00\x08\x13publish_nested_data\x00\x0c\x14publish_nested_topic\x00\r\x11publish_ref_event\x00\x0f\x0epublish_simple\x00\x10\x12publish_topic_type\x00\x11\x11with_assert_error\x00\x12\nwith_error\x00\x14\x0fwith_lib_struct\x00\x15\x08with_map\x00\x17\x0cwith_non_pub\x00\x18\x12with_non_pub_error\x00\x19\x0bwith_option\x00\x1a\x10with_panic_error\x00\x1b\x14with_panic_raw_error\x00\x1c\nwith_param\x00\x1d\x0bwith_result\x00\x1e\x0bwith_return\x00\x1f\nwith_tuple\x00\"\x11with_tuple_return\x00#\x08with_vec\x00$\x12with_wasm_imported\x00%\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n\xb4\x16\x1e\x9a\x01\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A k\"\x00$\x80\x80\x80\x80\x00A\xe8\x80\xc0\x80\x00A\x06\x10\x89\x80\x80\x80\x00!\x01A\xb0\x81\xc0\x80\x00A\x19\x10\x89\x80\x80\x80\x00 \x01\x10\x8a\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80 7\x03\x18 \x00B\x84\x80\x80\x80\x107\x03\x10 \x00A\xc0\x80\xc0\x80\x00A\x02 \x00A\x10jA\x02\x10\x8b\x80\x80\x80\x007\x03\x08 \x01A\x94\x81\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x00\x10\x80\x80\x80\x80\x00\x1a \x00A j$\x80\x80\x80\x80\x00B\x02\x0bE\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x02$\x80\x80\x80\x80\x00 \x02 \x00 \x01\x10\xa0\x80\x80\x80\x00\x02@ \x02(\x02\x00A\x01G\r\x00\x00\x0b \x02)\x03\x08!\x03 \x02A\x10j$\x80\x80\x80\x80\x00 \x03\x0b\x92\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A k\"\x02$\x80\x80\x80\x80\x00 \x02 \x017\x03\x08 \x02 \x007\x03\x00A\x00!\x03\x03~\x02@ \x03A\x10G\r\x00A\x00!\x03\x02@\x03@ \x03A\x10F\r\x01 \x02A\x10j \x03j \x02 \x03j)\x03\x007\x03\x00 \x03A\x08j!\x03\x0c\x00\x0b\x0b \x02A\x10j\x10\xa1\x80\x80\x80\x00!\x01 \x02A j$\x80\x80\x80\x80\x00 \x01\x0f\x0b \x02A\x10j \x03jB\x027\x03\x00 \x03A\x08j!\x03\x0c\x00\x0b\x0b.\x00\x02@ \x01 \x03F\r\x00\x00\x0b \x00\xadB \x86B\x04\x84 \x02\xadB \x86B\x04\x84 \x01\xadB \x86B\x04\x84\x10\x86\x80\x80\x80\x00\x0b\xa7\x01\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\x81\x80\xc0\x80\x00A\x06\x10\x89\x80\x80\x80\x00!\x01A\xe3\x81\xc0\x80\x00A\x1b\x10\x89\x80\x80\x80\x00 \x01\x10\x8a\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80\xa0\x057\x03\x08 \x00A\x9c\x80\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x007\x03\x00 \x00A\xd8\x80\xc0\x80\x00A\x01 \x00A\x01\x10\x8b\x80\x80\x80\x007\x03\x08 \x01A\x94\x81\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x00\x10\x80\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\x9f\x01\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\xfe\x81\xc0\x80\x00A\x1c\x10\x89\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80\xa0\x057\x03\x08 \x00A\x9c\x80\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x007\x03\x00 \x01A\xd8\x80\xc0\x80\x00A\x01 \x00A\x01\x10\x8b\x80\x80\x80\x00\x10\x8a\x80\x80\x80\x00!\x01 \x00\x10\x8e\x80\x80\x80\x007\x03\x08 \x01A\xf4\x80\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x00\x10\x80\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\x06\x00B\x8b\xc8\x01\x0b\x9b\x01\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\x9c\x81\xc0\x80\x00A\x14\x10\x89\x80\x80\x80\x00B\x84\x80\x80\x80\x10\x10\x8a\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80\xb0\x0c7\x03\x08 \x00A\x9c\x80\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x007\x03\x00 \x00A\xb4\x80\xc0\x80\x00A\x01 \x00A\x01\x10\x8b\x80\x80\x80\x007\x03\x08 \x01A\x94\x81\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x00\x10\x80\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0bu\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\xe0\x80\xc0\x80\x00A\x08\x10\x89\x80\x80\x80\x00!\x01A\xfc\x80\xc0\x80\x00A\x11\x10\x89\x80\x80\x80\x00 \x01\x10\x8a\x80\x80\x80\x00!\x01 \x00\x10\x8e\x80\x80\x80\x007\x03\x08 \x01A\xf4\x80\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x00\x10\x80\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0bi\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\xc9\x81\xc0\x80\x00A\x1a\x10\x89\x80\x80\x80\x00B\x84\x80\x80\x80\x10\x10\x8a\x80\x80\x80\x00!\x01 \x00\x10\x8e\x80\x80\x80\x007\x03\x08 \x01A\xf4\x80\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x00\x10\x80\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0b@\x01\x01\x7f\x02@\x02@A\x01A\x02A\x00 \x00\xa7A\xff\x01q\"\x01\x1b \x01A\x01F\x1b\"\x01A\x02F\r\x00 \x01A\x01qE\r\x01B\x02\x0f\x0b\x00\x0bB\x83\x80\x80\x80\x10\x10\x93\x80\x80\x80\x00\x00\x0b\x0b\x00 \x00\x10\x85\x80\x80\x80\x00\x1a\x0b\t\x00B\x84\x80\x80\x80\xa0\x05\x0b\x83\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00A\x00!\x02\x02@\x03@ \x02A\x10F\r\x01 \x01 \x02jB\x027\x03\x00 \x02A\x08j!\x02\x0c\x00\x0b\x0b\x02@\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\xa0\x82\xc0\x80\x00A\x02 \x01A\x02\x10\x96\x80\x80\x80\x00 \x011\x00\x00B\xcb\x00R\r\x00 \x011\x00\x08B\xcd\x00Q\r\x01\x0b\x00\x0b \x01A\x10j$\x80\x80\x80\x80\x00B\x02\x0b1\x00\x02@ \x02 \x04F\r\x00\x00\x0b \x00 \x01\xadB \x86B\x04\x84 \x03\xadB \x86B\x04\x84 \x02\xadB \x86B\x04\x84\x10\x87\x80\x80\x80\x00\x1a\x0b\x14\x00\x02@ \x00B\xff\x01\x83B\xcc\x00Q\r\x00\x00\x0bB\x02\x0b]\x01\x01\x7f#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00 \x01B\x027\x03\x08\x02@\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\x9c\x80\xc0\x80\x00A\x01 \x01A\x08jA\x01\x10\x96\x80\x80\x80\x00 \x011\x00\x08B\x04Q\r\x01\x0b\x00\x0b \x01A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\x08\x00B\x84\x80\x80\x80\x10\x0bh\x01\x01\x7f#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00\x02@ \x00B\x02Q\r\x00 \x01B\x027\x03\x08\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\xa8\x80\xc0\x80\x00A\x01 \x01A\x08jA\x01\x10\x96\x80\x80\x80\x00 \x01)\x03\x08B\xff\x01\x83B\x04Q\r\x01\x0b\x00\x0b \x01A\x10j$\x80\x80\x80\x80\x00B\x02\x0b?\x01\x01\x7f\x02@\x02@A\x01A\x02A\x00 \x00\xa7A\xff\x01q\"\x01\x1b \x01A\x01F\x1b\"\x01A\x02F\r\x00 \x01A\x01q\r\x01B\x02\x0f\x0b\x00\x0bB\x83\x80\x80\x80\x10\x10\x93\x80\x80\x80\x00\x00\x0b@\x01\x01\x7f\x02@\x02@A\x01A\x02A\x00 \x00\xa7A\xff\x01q\"\x01\x1b \x01A\x01F\x1b\"\x01A\x02F\r\x00 \x01A\x01q\r\x01B\x02\x0f\x0b\x00\x0bB\x83\x80\x80\x80\xf0\x00\x10\x93\x80\x80\x80\x00\x00\x0b\xec\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A k\"\x02$\x80\x80\x80\x80\x00A\x00!\x03\x02@\x03@ \x03A\x10F\r\x01 \x02A\x08j \x03jB\x027\x03\x00 \x03A\x08j!\x03\x0c\x00\x0b\x0b\x02@\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\x88\x80\xc0\x80\x00A\x02 \x02A\x08jA\x02\x10\x96\x80\x80\x80\x00 \x021\x00\x08B\x04R\r\x00 \x02B\x027\x03\x18 \x02)\x03\x10\"\x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\x9c\x80\xc0\x80\x00A\x01 \x02A\x18jA\x01\x10\x96\x80\x80\x80\x00\x02@ \x02)\x03\x18\"\x00\xa7A\xff\x01q\"\x03A\x07F\r\x00 \x03A\xc1\x00G\r\x01 \x00\x10\x81\x80\x80\x80\x00\x1a\x0b \x01B\xff\x01\x83B\x04R\r\x00 \x01B \x88\xa7A}jA}K\r\x01\x0b\x00\x0b \x02A j$\x80\x80\x80\x80\x00B\x02\x0bF\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00 \x00B\x84\x80\x80\x80\x107\x03\x08A\xa8\x80\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x00!\x01 \x00A\x10j$\x80\x80\x80\x80\x00 \x01\x0be\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00 \x00A\xb0\x80\xc0\x80\x00A\x01\x10\xa0\x80\x80\x80\x00\x02@ \x00(\x02\x00A\x01G\r\x00\x00\x0b \x00)\x03\x08!\x01 \x00B\x84\x80\x80\x80\x107\x03\x08 \x00 \x017\x03\x00 \x00\x10\xa1\x80\x80\x80\x00!\x01 \x00A\x10j$\x80\x80\x80\x80\x00 \x01\x0b\xdb\x01\x02\x01~\x04\x7f\x02@\x02@ \x02A\tK\r\x00B\x00!\x03 \x02!\x04 \x01!\x05\x03@\x02@ \x04\r\x00 \x03B\x08\x86B\x0e\x84!\x03\x0c\x03\x0bA\x01!\x06\x02@ \x05-\x00\x00\"\x07A\xdf\x00F\r\x00\x02@\x02@ \x07APjA\xff\x01qA\nI\r\x00 \x07A\xbf\x7fjA\xff\x01qA\x1aI\r\x01 \x07A\x9f\x7fjA\xff\x01qA\x1aO\r\x04 \x07AEj!\x06\x0c\x02\x0b \x07ARj!\x06\x0c\x01\x0b \x07AKj!\x06\x0b \x03B\x06\x86 \x06\xadB\xff\x01\x83\x84!\x03 \x04A\x7fj!\x04 \x05A\x01j!\x05\x0c\x00\x0b\x0b \x01\xadB \x86B\x04\x84 \x02\xadB \x86B\x04\x84\x10\x84\x80\x80\x80\x00!\x03\x0b \x00B\x007\x03\x00 \x00 \x037\x03\x08\x0b\x17\x00 \x00\xadB \x86B\x04\x84B\x84\x80\x80\x80 \x10\x83\x80\x80\x80\x00\x0b\xba\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A k\"\x01$\x80\x80\x80\x80\x00\x02@\x02@ \x00B\xff\x01\x83B\xcb\x00R\r\x00A\x00!\x02\x02@\x03@ \x02A\x10F\r\x01 \x01A\x08j \x02jB\x027\x03\x00 \x02A\x08j!\x02\x0c\x00\x0b\x0b \x00 \x01A\x08j\xadB \x86B\x04\x84B\x84\x80\x80\x80 \x10\x82\x80\x80\x80\x00\x1a \x01B\x027\x03\x18 \x01)\x03\x08\"\x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\x9c\x80\xc0\x80\x00A\x01 \x01A\x18jA\x01\x10\x96\x80\x80\x80\x00 \x011\x00\x18B\x04R\r\x00 \x011\x00\x10B\x04Q\r\x01\x0b\x00\x0b \x01A j$\x80\x80\x80\x80\x00B\x02\x0be\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A k\"\x00$\x80\x80\x80\x80\x00 \x00B\x84\x80\x80\x80\x107\x03\x18A\x9c\x80\xc0\x80\x00A\x01 \x00A\x18jA\x01\x10\x8b\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80 7\x03\x10 \x00 \x017\x03\x08 \x00A\x08j\x10\xa1\x80\x80\x80\x00!\x01 \x00A j$\x80\x80\x80\x80\x00 \x01\x0b\x14\x00\x02@ \x00B\xff\x01\x83B\xcb\x00Q\r\x00\x00\x0bB\x02\x0b\x83\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00A\x00!\x02\x02@\x03@ \x02A\x10F\r\x01 \x01 \x02jB\x027\x03\x00 \x02A\x08j!\x02\x0c\x00\x0b\x0b\x02@\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\xa0\x82\xc0\x80\x00A\x02 \x01A\x02\x10\x96\x80\x80\x80\x00 \x011\x00\x00B\x04R\r\x00 \x01)\x03\x08B\xfe\x01\x83P\r\x01\x0b\x00\x0b \x01A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\x0b\xba\x02\x01\x00A\x80\x80\xc0\x00\x0b\xb0\x02anested\x00\x00\x00\x10\x00\x01\x00\x00\x00\x01\x00\x10\x00\x06\x00\x00\x00val\x00\x18\x00\x10\x00\x03\x00\x00\x00data$\x00\x10\x00\x04\x00\x00\x00A\x00\x00\x00\x01\x00\x10\x00\x06\x00\x00\x00xy\x00\x00<\x00\x10\x00\x01\x00\x00\x00=\x00\x10\x00\x01\x00\x00\x00inner\x00\x00\x00P\x00\x10\x00\x05\x00\x00\x00transfercoordsamountn\x00\x10\x00\x06\x00\x00\x00used_event_simplepayload\x8d\x00\x10\x00\x07\x00\x00\x00used_event_with_refsused_event_with_data_typeused_event_with_topic_typeused_event_with_nested_dataused_event_with_nested_topicf1f2\x00\x00\x1a\x01\x10\x00\x02\x00\x00\x00\x1c\x01\x10\x00\x02\x00\x00\x00\x00\x8b,\x0econtractspecv0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08with_map\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01m\x00\x00\x00\x00\x00\x03\xec\x00\x00\x07\xd0\x00\x00\x00\nUsedMapKey\x00\x00\x00\x00\x07\xd0\x00\x00\x00\nUsedMapVal\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08with_vec\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01v\x00\x00\x00\x00\x00\x03\xea\x00\x00\x07\xd0\x00\x00\x00\x0eUsedVecElement\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nUnusedEnum\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01A\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01B\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nUsedMapKey\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02K1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02K2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nUsedMapVal\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01v\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nwith_error\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x03\xe9\x00\x00\x00\x04\x00\x00\x07\xd0\x00\x00\x00\rUsedErrorEnum\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nwith_param\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01s\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x0fUsedParamStruct\x00\x00\x00\x00\x00\x00\x00\x00\x02ie\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x10UsedParamIntEnum\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nwith_tuple\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01t\x00\x00\x00\x00\x00\x03\xed\x00\x00\x00\x02\x00\x00\x07\xd0\x00\x00\x00\x10UsedTupleElement\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bUnusedEvent\x00\x00\x00\x00\x01\x00\x00\x00\x0cunused_event\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04data\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cUnusedStruct\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01x\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cUsedResultOk\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04data\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bwith_option\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01o\x00\x00\x00\x00\x00\x03\xe8\x00\x00\x07\xd0\x00\x00\x00\x11UsedOptionElement\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bwith_result\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x03\xe9\x00\x00\x07\xd0\x00\x00\x00\x0cUsedResultOk\x00\x00\x07\xd0\x00\x00\x00\rUsedErrorEnum\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bwith_return\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0eUsedReturnEnum\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\rUnusedIntEnum\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02U1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02U2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\rUsedErrorEnum\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x08NotFound\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07Invalid\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cwith_non_pub\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01s\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x10UsedNonPubStruct\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0eUnusedPubError\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Nope\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0eUsedReturnEnum\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01A\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01B\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0eUsedVecElement\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04data\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fUsedParamStruct\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01a\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x06nested\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12UsedNestedInStruct\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fUsedRefDataType\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x06nested\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x10UsedRefDataInner\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0epublish_simple\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fUsedEventSimple\x00\x00\x00\x00\x01\x00\x00\x00\x11used_event_simple\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x06amount\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10UsedParamIntEnum\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01X\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01Y\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10UsedRefDataInner\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10UsedRefTopicType\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04Send\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Recv\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10UsedTupleElement\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fwith_lib_struct\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01s\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x07StructC\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedEventDataType\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01x\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x01y\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedOptionElement\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04data\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10with_panic_error\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04fail\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedEventWithRefs\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x14used_event_with_refs\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x07\xd0\x00\x00\x00\x10UsedRefTopicType\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07payload\x00\x00\x00\x07\xd0\x00\x00\x00\x0fUsedRefDataType\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedEventDataInner\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedEventDataOuter\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05inner\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12UsedEventDataInner\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedEventTopicType\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x08Transfer\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Mint\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedNestedInStruct\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x07\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedPanicErrorEnum\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Boom\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11publish_data_type\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11publish_ref_event\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11with_assert_error\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02ok\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11with_tuple_return\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x03\xed\x00\x00\x00\x02\x00\x00\x07\xd0\x00\x00\x00\x16UsedTupleReturnElement\x00\x00\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13UsedAssertErrorEnum\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03Bad\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13UsedEventTopicInner\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13UsedEventTopicOuter\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05inner\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x13UsedEventTopicInner\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12publish_topic_type\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12with_non_pub_error\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x03\xe9\x00\x00\x00\x04\x00\x00\x07\xd0\x00\x00\x00\x0fUsedNonPubError\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12with_wasm_imported\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01s\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x07StructA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13publish_nested_data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14publish_nested_topic\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14with_panic_raw_error\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04fail\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x15UsedEventWithDataType\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x19used_event_with_data_type\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07payload\x00\x00\x00\x07\xd0\x00\x00\x00\x11UsedEventDataType\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16UsedTupleReturnElement\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16UsedEventWithTopicType\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1aused_event_with_topic_type\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x07\xd0\x00\x00\x00\x12UsedEventTopicType\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x06amount\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17UsedEventWithNestedData\x00\x00\x00\x00\x01\x00\x00\x00\x1bused_event_with_nested_data\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07payload\x00\x00\x00\x07\xd0\x00\x00\x00\x12UsedEventDataOuter\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18UnusedNonContractFnParam\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01x\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18UsedEventWithNestedTopic\x00\x00\x00\x01\x00\x00\x00\x1cused_event_with_nested_topic\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04info\x00\x00\x07\xd0\x00\x00\x00\x13UsedEventTopicOuter\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x06amount\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19UnusedNonContractFnReturn\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01x\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumA\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumB\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x02\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumC\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x07StructA\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0cStructTupleA\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorA\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorB\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorC\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00d\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00e\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00f\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventA\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_a\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventB\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_b\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f3\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventC\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_c\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02f3\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructA\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructB\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructC\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x03\xea\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x13\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntA\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntB\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntC\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00d\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\xc8\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x01,\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleA\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleB\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleC\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\x0b\x00\x1e\x11contractenvmetav0\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x00\x00+\x0econtractmetav0\x00\x00\x00\x00\x00\x00\x00\x05rsver\x00\x00\x00\x00\x00\x00\x061.91.0\x00\x00"; + const WASM: &[u8] = b"\x00asm\x01\x00\x00\x00\x01R\x0e`\x01~\x01~`\x02~~\x01~`\x03~~~\x01~`\x04~~~~\x01~`\x05~\x7f\x7f\x7f\x7f\x00`\x00\x01~`\x02\x7f\x7f\x01~`\x04\x7f\x7f\x7f\x7f\x01~`\x01~\x00`\x02\x7f\x7f\x00`\x02\x7f\x7f\x01\x7f`\x03\x7f\x7f\x7f\x00`\x01\x7f\x01~`\x00\x00\x02I\x0c\x01b\x018\x00\x00\x01x\x011\x00\x01\x01i\x012\x00\x00\x01v\x013\x00\x00\x01b\x01m\x00\x02\x01v\x01h\x00\x02\x01v\x01g\x00\x01\x01b\x01j\x00\x01\x01v\x011\x00\x01\x01x\x015\x00\x00\x01m\x019\x00\x02\x01m\x01a\x00\x03\x03%$\x02\x04\x00\x05\x06\x01\x07\x05\x05\x05\x05\x05\x05\x00\x08\x05\x00\x00\x05\x00\x00\x00\x01\x00\t\n\x05\x05\x0b\x0c\x00\x05\x00\x00\r\r\x04\x05\x01p\x01\x01\x01\x05\x03\x01\x00\x11\x06!\x04\x7f\x01A\x80\x80\xc0\x00\x0b\x7f\x00A\xd2\x82\xc0\x00\x0b\x7f\x00A\xe8\x82\xc0\x00\x0b\x7f\x00A\xf0\x82\xc0\x00\x0b\x07\x90\x04 \x06memory\x02\x00\x0c__check_auth\x00\x0c\r__constructor\x00\x0e\x11publish_data_type\x00\x0f\x13publish_nested_data\x00\x13\x14publish_nested_topic\x00\x14\x11publish_ref_event\x00\x16\x0epublish_simple\x00\x17\x12publish_topic_type\x00\x18\x11with_assert_error\x00\x19\nwith_error\x00\x1b\x0fwith_lib_struct\x00\x1c\x08with_map\x00\x1d\x12with_non_pub_error\x00\x1e\x0bwith_option\x00\x1f\x10with_panic_error\x00 \x14with_panic_raw_error\x00!\nwith_param\x00\"\x0ewith_recursion\x00#\x0bwith_result\x00&\x0bwith_return\x00\'\nwith_tuple\x00*\x11with_tuple_return\x00+\x08with_vec\x00,\x12with_wasm_imported\x00-\x01_\x03\x01\x0fwith_vec_nested\x00,\x0cwith_context\x00\x0e\x0cwith_non_pub\x00\x0e\x14with_panic_error_ref\x00 \n__data_end\x03\x02\x0b__heap_base\x03\x03\n\x99\x1c$\x8c\x01\x01\x01\x7f#\x80\x80\x80\x80\x00A\x10k\"\x03$\x80\x80\x80\x80\x00\x02@ \x00B\xff\x01\x83B\xc8\x00R\r\x00 \x00\x10\x80\x80\x80\x80\x00B\x80\x80\x80\x80p\x83B\x80\x80\x80\x80\x80\x04R\r\x00 \x03B\x027\x03\x08 \x01B\xff\x01\x83B\xcc\x00R\r\x00 \x01A\x94\x80\xc0\x80\x00A\x01 \x03A\x08jA\x01\x10\x8d\x80\x80\x80\x00 \x031\x00\x08B\x04R\r\x00 \x02B\xff\x01\x83B\xcb\x00R\r\x00 \x03A\x10j$\x80\x80\x80\x80\x00B\x02\x0f\x0b\x00\x0b1\x00\x02@ \x02 \x04F\r\x00\x00\x0b \x00 \x01\xadB \x86B\x04\x84 \x03\xadB \x86B\x04\x84 \x02\xadB \x86B\x04\x84\x10\x8b\x80\x80\x80\x00\x1a\x0b]\x01\x01\x7f#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00 \x01B\x027\x03\x08\x02@\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\x84\x80\xc0\x80\x00A\x01 \x01A\x08jA\x01\x10\x8d\x80\x80\x80\x00 \x011\x00\x08B\x04Q\r\x01\x0b\x00\x0b \x01A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\x9a\x01\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A k\"\x00$\x80\x80\x80\x80\x00A\xa0\x81\xc0\x80\x00A\x06\x10\x90\x80\x80\x80\x00!\x01A\xe8\x81\xc0\x80\x00A\x19\x10\x90\x80\x80\x80\x00 \x01\x10\x91\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80 7\x03\x18 \x00B\x84\x80\x80\x80\x107\x03\x10 \x00A\xf8\x80\xc0\x80\x00A\x02 \x00A\x10jA\x02\x10\x92\x80\x80\x80\x007\x03\x08 \x01A\xcc\x81\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x00\x10\x81\x80\x80\x80\x00\x1a \x00A j$\x80\x80\x80\x80\x00B\x02\x0bE\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x02$\x80\x80\x80\x80\x00 \x02 \x00 \x01\x10\xa8\x80\x80\x80\x00\x02@ \x02(\x02\x00A\x01G\r\x00\x00\x0b \x02)\x03\x08!\x03 \x02A\x10j$\x80\x80\x80\x80\x00 \x03\x0b\x92\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A k\"\x02$\x80\x80\x80\x80\x00 \x02 \x017\x03\x08 \x02 \x007\x03\x00A\x00!\x03\x03~\x02@ \x03A\x10G\r\x00A\x00!\x03\x02@\x03@ \x03A\x10F\r\x01 \x02A\x10j \x03j \x02 \x03j)\x03\x007\x03\x00 \x03A\x08j!\x03\x0c\x00\x0b\x0b \x02A\x10j\x10\xa9\x80\x80\x80\x00!\x01 \x02A j$\x80\x80\x80\x80\x00 \x01\x0f\x0b \x02A\x10j \x03jB\x027\x03\x00 \x03A\x08j!\x03\x0c\x00\x0b\x0b.\x00\x02@ \x01 \x03F\r\x00\x00\x0b \x00\xadB \x86B\x04\x84 \x02\xadB \x86B\x04\x84 \x01\xadB \x86B\x04\x84\x10\x8a\x80\x80\x80\x00\x0b\xa7\x01\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\x9d\x80\xc0\x80\x00A\x06\x10\x90\x80\x80\x80\x00!\x01A\x9b\x82\xc0\x80\x00A\x1b\x10\x90\x80\x80\x80\x00 \x01\x10\x91\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80\xa0\x057\x03\x08 \x00A\x84\x80\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x007\x03\x00 \x00A\x90\x81\xc0\x80\x00A\x01 \x00A\x01\x10\x92\x80\x80\x80\x007\x03\x08 \x01A\xcc\x81\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x00\x10\x81\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\x9f\x01\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\xb6\x82\xc0\x80\x00A\x1c\x10\x90\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80\xa0\x057\x03\x08 \x00A\x84\x80\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x007\x03\x00 \x01A\x90\x81\xc0\x80\x00A\x01 \x00A\x01\x10\x92\x80\x80\x80\x00\x10\x91\x80\x80\x80\x00!\x01 \x00\x10\x95\x80\x80\x80\x007\x03\x08 \x01A\xac\x81\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x00\x10\x81\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\x06\x00B\x8b\xc8\x01\x0b\x9b\x01\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\xd4\x81\xc0\x80\x00A\x14\x10\x90\x80\x80\x80\x00B\x84\x80\x80\x80\x10\x10\x91\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80\xb0\x0c7\x03\x08 \x00A\x84\x80\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x007\x03\x00 \x00A\xec\x80\xc0\x80\x00A\x01 \x00A\x01\x10\x92\x80\x80\x80\x007\x03\x08 \x01A\xcc\x81\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x00\x10\x81\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0bu\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\x98\x81\xc0\x80\x00A\x08\x10\x90\x80\x80\x80\x00!\x01A\xb4\x81\xc0\x80\x00A\x11\x10\x90\x80\x80\x80\x00 \x01\x10\x91\x80\x80\x80\x00!\x01 \x00\x10\x95\x80\x80\x80\x007\x03\x08 \x01A\xac\x81\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x00\x10\x81\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0bi\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\x81\x82\xc0\x80\x00A\x1a\x10\x90\x80\x80\x80\x00B\x84\x80\x80\x80\x10\x10\x91\x80\x80\x80\x00!\x01 \x00\x10\x95\x80\x80\x80\x007\x03\x08 \x01A\xac\x81\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x00\x10\x81\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0b@\x01\x01\x7f\x02@\x02@A\x01A\x02A\x00 \x00\xa7A\xff\x01q\"\x01\x1b \x01A\x01F\x1b\"\x01A\x02F\r\x00 \x01A\x01qE\r\x01B\x02\x0f\x0b\x00\x0bB\x83\x80\x80\x80\x10\x10\x9a\x80\x80\x80\x00\x00\x0b\x0b\x00 \x00\x10\x89\x80\x80\x80\x00\x1a\x0b\t\x00B\x84\x80\x80\x80\xa0\x05\x0b\x83\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00A\x00!\x02\x02@\x03@ \x02A\x10F\r\x01 \x01 \x02jB\x027\x03\x00 \x02A\x08j!\x02\x0c\x00\x0b\x0b\x02@\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\xd8\x82\xc0\x80\x00A\x02 \x01A\x02\x10\x8d\x80\x80\x80\x00 \x011\x00\x00B\xcb\x00R\r\x00 \x011\x00\x08B\xcd\x00Q\r\x01\x0b\x00\x0b \x01A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\x14\x00\x02@ \x00B\xff\x01\x83B\xcc\x00Q\r\x00\x00\x0bB\x02\x0b\x08\x00B\x84\x80\x80\x80\x10\x0bh\x01\x01\x7f#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00\x02@ \x00B\x02Q\r\x00 \x01B\x027\x03\x08\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\xb8\x80\xc0\x80\x00A\x01 \x01A\x08jA\x01\x10\x8d\x80\x80\x80\x00 \x01)\x03\x08B\xff\x01\x83B\x04Q\r\x01\x0b\x00\x0b \x01A\x10j$\x80\x80\x80\x80\x00B\x02\x0b?\x01\x01\x7f\x02@\x02@A\x01A\x02A\x00 \x00\xa7A\xff\x01q\"\x01\x1b \x01A\x01F\x1b\"\x01A\x02F\r\x00 \x01A\x01q\r\x01B\x02\x0f\x0b\x00\x0bB\x83\x80\x80\x80\x10\x10\x9a\x80\x80\x80\x00\x00\x0b@\x01\x01\x7f\x02@\x02@A\x01A\x02A\x00 \x00\xa7A\xff\x01q\"\x01\x1b \x01A\x01F\x1b\"\x01A\x02F\r\x00 \x01A\x01q\r\x01B\x02\x0f\x0b\x00\x0bB\x83\x80\x80\x80\xf0\x00\x10\x9a\x80\x80\x80\x00\x00\x0b\xec\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A k\"\x02$\x80\x80\x80\x80\x00A\x00!\x03\x02@\x03@ \x03A\x10F\r\x01 \x02A\x08j \x03jB\x027\x03\x00 \x03A\x08j!\x03\x0c\x00\x0b\x0b\x02@\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\xa4\x80\xc0\x80\x00A\x02 \x02A\x08jA\x02\x10\x8d\x80\x80\x80\x00 \x021\x00\x08B\x04R\r\x00 \x02B\x027\x03\x18 \x02)\x03\x10\"\x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\x84\x80\xc0\x80\x00A\x01 \x02A\x18jA\x01\x10\x8d\x80\x80\x80\x00\x02@ \x02)\x03\x18\"\x00\xa7A\xff\x01q\"\x03A\x07F\r\x00 \x03A\xc1\x00G\r\x01 \x00\x10\x82\x80\x80\x80\x00\x1a\x0b \x01B\xff\x01\x83B\x04R\r\x00 \x01B \x88\xa7A}jA}K\r\x01\x0b\x00\x0b \x02A j$\x80\x80\x80\x80\x00B\x02\x0b\xe2\x03\x03\x01\x7f\x01~\x01\x7f#\x80\x80\x80\x80\x00A0k\"\x01$\x80\x80\x80\x80\x00 \x01B\x027\x03\x08\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\x84\x80\xc0\x80\x00A\x01 \x01A\x08jA\x01\x10\x8d\x80\x80\x80\x00 \x01)\x03\x08\"\x00B\xff\x01\x83B\xcb\x00R\r\x00 \x00\x10\x83\x80\x80\x80\x00!\x02 \x01A\x006\x02\x18 \x01 \x007\x03\x10 \x01 \x02B \x88>\x02\x1c \x01A j \x01A\x10j\x10\xa4\x80\x80\x80\x00 \x01)\x03 \"\x00B\x02Q\r\x00 \x00\xa7A\x01q\r\x00\x02@ \x01)\x03(\"\x00\xa7A\xff\x01q\"\x03A\xca\x00F\r\x00 \x03A\x0eG\r\x01\x0b\x02@\x02@\x02@ \x00A\xd8\x80\xc0\x80\x00\xadB \x86B\x04\x84B\x84\x80\x80\x80 \x10\x84\x80\x80\x80\x00B \x88\xa7\x0e\x02\x01\x00\x03\x0b \x01(\x02\x18 \x01(\x02\x1c\x10\xa5\x80\x80\x80\x00A\x01K\r\x02 \x01A j \x01A\x10j\x10\xa4\x80\x80\x80\x00 \x01)\x03 \"\x00B\x02Q\r\x02 \x00\xa7A\x01q\r\x02 \x01)\x03(!\x00 \x01B\x027\x03 \x00B\xff\x01\x83B\xcc\x00R\r\x02 \x00A\x84\x80\xc0\x80\x00A\x01 \x01A jA\x01\x10\x8d\x80\x80\x80\x00 \x011\x00 B\xcb\x00Q\r\x01\x0c\x02\x0b \x01(\x02\x18 \x01(\x02\x1c\x10\xa5\x80\x80\x80\x00A\x01K\r\x01 \x01A j \x01A\x10j\x10\xa4\x80\x80\x80\x00 \x01)\x03 \"\x00B\x02Q\r\x01 \x00\xa7A\x01q\r\x01 \x01)\x03(!\x00 \x01B\x027\x03 \x00B\xff\x01\x83B\xcc\x00R\r\x01 \x00A\x84\x80\xc0\x80\x00A\x01 \x01A jA\x01\x10\x8d\x80\x80\x80\x00 \x011\x00 B\x04R\r\x01\x0b \x01A0j$\x80\x80\x80\x80\x00B\x02\x0f\x0b\x00\x0bJ\x02\x01~\x01\x7fB\x02!\x02\x02@ \x01(\x02\x08\"\x03 \x01(\x02\x0cO\r\x00 \x00 \x01)\x03\x00 \x03\xadB \x86B\x04\x84\x10\x88\x80\x80\x80\x007\x03\x08 \x01 \x03A\x01j6\x02\x08B\x00!\x02\x0b \x00 \x027\x03\x00\x0b\x19\x00\x02@ \x01 \x00I\r\x00 \x01 \x00k\x0f\x0b\x10\xaf\x80\x80\x80\x00\x00\x0bF\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00 \x00B\x84\x80\x80\x80\x107\x03\x08A\xb8\x80\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x00!\x01 \x00A\x10j$\x80\x80\x80\x80\x00 \x01\x0be\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00 \x00A\xe8\x80\xc0\x80\x00A\x01\x10\xa8\x80\x80\x80\x00\x02@ \x00(\x02\x00A\x01G\r\x00\x00\x0b \x00)\x03\x08!\x01 \x00B\x84\x80\x80\x80\x107\x03\x08 \x00 \x017\x03\x00 \x00\x10\xa9\x80\x80\x80\x00!\x01 \x00A\x10j$\x80\x80\x80\x80\x00 \x01\x0b\xdb\x01\x02\x01~\x04\x7f\x02@\x02@ \x02A\tK\r\x00B\x00!\x03 \x02!\x04 \x01!\x05\x03@\x02@ \x04\r\x00 \x03B\x08\x86B\x0e\x84!\x03\x0c\x03\x0bA\x01!\x06\x02@ \x05-\x00\x00\"\x07A\xdf\x00F\r\x00\x02@\x02@ \x07APjA\xff\x01qA\nI\r\x00 \x07A\xbf\x7fjA\xff\x01qA\x1aI\r\x01 \x07A\x9f\x7fjA\xff\x01qA\x1aO\r\x04 \x07AEj!\x06\x0c\x02\x0b \x07ARj!\x06\x0c\x01\x0b \x07AKj!\x06\x0b \x03B\x06\x86 \x06\xadB\xff\x01\x83\x84!\x03 \x04A\x7fj!\x04 \x05A\x01j!\x05\x0c\x00\x0b\x0b \x01\xadB \x86B\x04\x84 \x02\xadB \x86B\x04\x84\x10\x87\x80\x80\x80\x00!\x03\x0b \x00B\x007\x03\x00 \x00 \x037\x03\x08\x0b\x17\x00 \x00\xadB \x86B\x04\x84B\x84\x80\x80\x80 \x10\x86\x80\x80\x80\x00\x0b\xba\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A k\"\x01$\x80\x80\x80\x80\x00\x02@\x02@ \x00B\xff\x01\x83B\xcb\x00R\r\x00A\x00!\x02\x02@\x03@ \x02A\x10F\r\x01 \x01A\x08j \x02jB\x027\x03\x00 \x02A\x08j!\x02\x0c\x00\x0b\x0b \x00 \x01A\x08j\xadB \x86B\x04\x84B\x84\x80\x80\x80 \x10\x85\x80\x80\x80\x00\x1a \x01B\x027\x03\x18 \x01)\x03\x08\"\x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\x84\x80\xc0\x80\x00A\x01 \x01A\x18jA\x01\x10\x8d\x80\x80\x80\x00 \x011\x00\x18B\x04R\r\x00 \x011\x00\x10B\x04Q\r\x01\x0b\x00\x0b \x01A j$\x80\x80\x80\x80\x00B\x02\x0be\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A k\"\x00$\x80\x80\x80\x80\x00 \x00B\x84\x80\x80\x80\x107\x03\x18A\x84\x80\xc0\x80\x00A\x01 \x00A\x18jA\x01\x10\x92\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80 7\x03\x10 \x00 \x017\x03\x08 \x00A\x08j\x10\xa9\x80\x80\x80\x00!\x01 \x00A j$\x80\x80\x80\x80\x00 \x01\x0b\x14\x00\x02@ \x00B\xff\x01\x83B\xcb\x00Q\r\x00\x00\x0bB\x02\x0b\x83\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00A\x00!\x02\x02@\x03@ \x02A\x10F\r\x01 \x01 \x02jB\x027\x03\x00 \x02A\x08j!\x02\x0c\x00\x0b\x0b\x02@\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\xd8\x82\xc0\x80\x00A\x02 \x01A\x02\x10\x8d\x80\x80\x80\x00 \x011\x00\x00B\x04R\r\x00 \x01)\x03\x08B\xfe\x01\x83P\r\x01\x0b\x00\x0b \x01A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\x03\x00\x00\x0b\t\x00\x10\xae\x80\x80\x80\x00\x00\x0b\x0b\xf2\x02\x01\x00A\x80\x80\xc0\x00\x0b\xe8\x02val\x00\x00\x00\x10\x00\x03\x00\x00\x00nonce\x00\x00\x00\x0c\x00\x10\x00\x05\x00\x00\x00anested\x00\x1c\x00\x10\x00\x01\x00\x00\x00\x1d\x00\x10\x00\x06\x00\x00\x00data4\x00\x10\x00\x04\x00\x00\x00NotRecursiveRecursive\x00\x00\x00@\x00\x10\x00\x0c\x00\x00\x00L\x00\x10\x00\t\x00\x00\x00A\x00\x00\x00\x1d\x00\x10\x00\x06\x00\x00\x00xy\x00\x00t\x00\x10\x00\x01\x00\x00\x00u\x00\x10\x00\x01\x00\x00\x00inner\x00\x00\x00\x88\x00\x10\x00\x05\x00\x00\x00transfercoordsamount\xa6\x00\x10\x00\x06\x00\x00\x00used_event_simplepayload\xc5\x00\x10\x00\x07\x00\x00\x00used_event_with_refsused_event_with_data_typeused_event_with_topic_typeused_event_with_nested_dataused_event_with_nested_topicf1f2\x00\x00R\x01\x10\x00\x02\x00\x00\x00T\x01\x10\x00\x02\x00\x00\x00\x00\xbf7\x0econtractspecv0\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07Context\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08UsedLeaf\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08with_map\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01m\x00\x00\x00\x00\x00\x03\xec\x00\x00\x07\xd0\x00\x00\x00\nUsedMapKey\x00\x00\x00\x00\x07\xd0\x00\x00\x00\nUsedMapVal\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08with_vec\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01v\x00\x00\x00\x00\x00\x03\xea\x00\x00\x07\xd0\x00\x00\x00\x0eUsedVecElement\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nUnusedEnum\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01A\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01B\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nUsedMapKey\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02K1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02K2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nUsedMapVal\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01v\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nwith_error\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x03\xe9\x00\x00\x00\x04\x00\x00\x07\xd0\x00\x00\x00\rUsedErrorEnum\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nwith_param\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01s\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x0fUsedParamStruct\x00\x00\x00\x00\x00\x00\x00\x00\x02ie\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x10UsedParamIntEnum\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nwith_tuple\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01t\x00\x00\x00\x00\x00\x03\xed\x00\x00\x00\x02\x00\x00\x07\xd0\x00\x00\x00\x10UsedTupleElement\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bUnusedEvent\x00\x00\x00\x00\x01\x00\x00\x00\x0cunused_event\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04data\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cUnusedStruct\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01x\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cUsedResultOk\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04data\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bwith_option\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01o\x00\x00\x00\x00\x00\x03\xe8\x00\x00\x07\xd0\x00\x00\x00\x11UsedOptionElement\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bwith_result\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x03\xe9\x00\x00\x07\xd0\x00\x00\x00\x0cUsedResultOk\x00\x00\x07\xd0\x00\x00\x00\rUsedErrorEnum\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bwith_return\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0eUsedReturnEnum\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\rUnusedIntEnum\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02U1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02U2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\rUsedErrorEnum\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x08NotFound\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07Invalid\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c__check_auth\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x11signature_payload\x00\x00\x00\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\nsignatures\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x0fCustomSignature\x00\x00\x00\x00\x00\x00\x00\x00\rauth_contexts\x00\x00\x00\x00\x00\x03\xea\x00\x00\x07\xd0\x00\x00\x00\x07Context\x00\x00\x00\x00\x01\x00\x00\x03\xe9\x00\x00\x00\x02\x00\x00\x07\xd0\x00\x00\x00\x11UsedAuthErrorEnum\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cwith_context\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07context\x00\x00\x00\x07\xd0\x00\x00\x00\x07Context\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cwith_non_pub\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01s\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x10UsedNonPubStruct\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0eUnusedPubError\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Nope\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0eUsedReturnEnum\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01A\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01B\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0eUsedVecElement\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04data\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\r__constructor\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04meta\x00\x00\x07\xd0\x00\x00\x00\x13UsedConstructorMeta\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fCustomSignature\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05nonce\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fUsedParamStruct\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01a\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x06nested\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12UsedNestedInStruct\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fUsedRefDataType\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x06nested\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x10UsedRefDataInner\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0epublish_simple\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0ewith_recursion\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01r\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x11UsedRecursiveRoot\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fUsedEventSimple\x00\x00\x00\x00\x01\x00\x00\x00\x11used_event_simple\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x06amount\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10UsedParamIntEnum\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01X\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01Y\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10UsedRefDataInner\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10UsedRefTopicType\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04Send\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Recv\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10UsedTupleElement\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fwith_lib_struct\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01s\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x07StructC\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fwith_vec_nested\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01v\x00\x00\x00\x00\x00\x03\xea\x00\x00\x07\xd0\x00\x00\x00\x14UsedVecElementNested\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedAuthErrorEnum\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x08NotFound\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07Invalid\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedEventDataType\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01x\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x01y\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedOptionElement\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04data\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedRecursiveLeaf\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x03\xea\x00\x00\x07\xd0\x00\x00\x00\x11UsedRecursiveRoot\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedRecursiveNode\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x0cNotRecursive\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x08UsedLeaf\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\tRecursive\x00\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x11UsedRecursiveLeaf\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedRecursiveRoot\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x07\xd0\x00\x00\x00\x11UsedRecursiveNode\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10with_panic_error\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04fail\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedEventWithRefs\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x14used_event_with_refs\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x07\xd0\x00\x00\x00\x10UsedRefTopicType\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07payload\x00\x00\x00\x07\xd0\x00\x00\x00\x0fUsedRefDataType\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedEventDataInner\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedEventDataOuter\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05inner\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12UsedEventDataInner\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedEventTopicType\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x08Transfer\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Mint\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedNestedInStruct\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x07\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedPanicErrorEnum\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Boom\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11publish_data_type\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11publish_ref_event\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11with_assert_error\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02ok\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11with_tuple_return\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x03\xed\x00\x00\x00\x02\x00\x00\x07\xd0\x00\x00\x00\x16UsedTupleReturnElement\x00\x00\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13UsedAssertErrorEnum\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03Bad\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13UsedConstructorMeta\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13UsedEventTopicInner\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13UsedEventTopicOuter\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05inner\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x13UsedEventTopicInner\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13UsedVecInnerElement\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12publish_topic_type\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12with_non_pub_error\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x03\xe9\x00\x00\x00\x04\x00\x00\x07\xd0\x00\x00\x00\x0fUsedNonPubError\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12with_wasm_imported\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01s\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x07StructA\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14UsedVecElementNested\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x05inner\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x13UsedVecInnerElement\x00\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\tvec_inner\x00\x00\x00\x00\x00\x03\xea\x00\x00\x07\xd0\x00\x00\x00\x16UsedVecInnerVecElement\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13publish_nested_data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x15UsedPanicErrorEnumRef\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Boom\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14publish_nested_topic\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14with_panic_error_ref\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04fail\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14with_panic_raw_error\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04fail\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x15UsedEventWithDataType\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x19used_event_with_data_type\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07payload\x00\x00\x00\x07\xd0\x00\x00\x00\x11UsedEventDataType\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16UsedTupleReturnElement\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16UsedVecInnerVecElement\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16UsedEventWithTopicType\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1aused_event_with_topic_type\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x07\xd0\x00\x00\x00\x12UsedEventTopicType\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x06amount\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17UsedEventWithNestedData\x00\x00\x00\x00\x01\x00\x00\x00\x1bused_event_with_nested_data\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07payload\x00\x00\x00\x07\xd0\x00\x00\x00\x12UsedEventDataOuter\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18UnusedNonContractFnParam\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01x\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18UsedEventWithNestedTopic\x00\x00\x00\x01\x00\x00\x00\x1cused_event_with_nested_topic\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04info\x00\x00\x07\xd0\x00\x00\x00\x13UsedEventTopicOuter\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x06amount\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19UnusedNonContractFnReturn\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01x\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumA\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumB\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x02\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumC\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x07StructA\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0cStructTupleA\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorA\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorB\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorC\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00d\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00e\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00f\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventA\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_a\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventB\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_b\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f3\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventC\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_c\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02f3\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructA\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructB\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructC\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x03\xea\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x13\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntA\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntB\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntC\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00d\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\xc8\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x01,\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleA\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleB\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleC\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\x0b\x00\x1e\x11contractenvmetav0\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x00\x00+\x0econtractmetav0\x00\x00\x00\x00\x00\x00\x00\x05rsver\x00\x00\x00\x00\x00\x00\x061.91.0\x00\x00"; extern crate test; #[rustc_test_marker = "test::test_spec_shaking_v1"] #[doc(hidden)] @@ -21454,6 +26485,8 @@ mod test { "with_non_pub_error", "with_tuple", "with_tuple_return", + "__check_auth", + "__constructor", ] { if !fn_names.contains(&expected_fn.into()) { { @@ -21489,12 +26522,17 @@ mod test { "UsedResultOk", "UsedTupleElement", "UsedTupleReturnElement", + "UsedRecursiveRoot", + "UsedRecursiveNode", + "UsedRecursiveLeaf", + "UsedLeaf", "UnusedNonContractFnParam", "UnusedNonContractFnReturn", "UnusedStruct", "UnusedEnum", "UnusedIntEnum", "UnusedEvent", + "Context", ]; for name in pub_types { if !all_names.contains(name) { @@ -21554,6 +26592,38 @@ mod test { } } } + let sdk_types = [ + "Executable", + "InvokerContractAuthEntry", + "SubContractInvocation", + "ContractContext", + "CreateContractHostFnContext", + "CreateContractWithConstructorHostFnContext", + "ContractExecutable", + ]; + for name in sdk_types { + if !!all_names.contains(name) { + { + ::core::panicking::panic_fmt(format_args!( + "sdk contract type {0} should NOT have a spec entry", + name, + )); + } + } + } + if !entries.iter().any(|e| { + #[allow(non_exhaustive_omitted_patterns)] + match e { + ScSpecEntry::UdtStructV0(s) if s.name.to_utf8_string_lossy() == "Context" => true, + _ => false, + } + }) { + { + ::core::panicking::panic_fmt(format_args!( + "User-defined Context should be retained as a reachable contract spec UDT", + )); + } + } } /// Extract the name from a non-function spec entry. fn entry_name(entry: &ScSpecEntry) -> Option { diff --git a/tests-expanded/test_spec_shaking_v1_wasm32v1-none.rs b/tests-expanded/test_spec_shaking_v1_wasm32v1-none.rs index 182e0040c..2387370af 100644 --- a/tests-expanded/test_spec_shaking_v1_wasm32v1-none.rs +++ b/tests-expanded/test_spec_shaking_v1_wasm32v1-none.rs @@ -5,8 +5,8 @@ extern crate core; #[prelude_import] use core::prelude::rust_2021::*; use soroban_sdk::{ - assert_with_error, contract, contracterror, contractevent, contractimpl, contracttype, - panic_with_error, Env, Map, Symbol, Vec, + assert_with_error, auth::CustomAccountInterface, contract, contracterror, contractevent, + contractimpl, contracttype, crypto::Hash, panic_with_error, Env, Map, Symbol, Vec, }; pub struct Contract; ///ContractArgs is a type for building arg lists for functions defined in "Contract". @@ -133,6 +133,189 @@ impl soroban_sdk::TryFromVal for soroban_sdk <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } +pub struct UsedConstructorMeta { + pub val: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedConstructorMeta { + #[inline] + fn clone(&self) -> UsedConstructorMeta { + UsedConstructorMeta { + val: ::core::clone::Clone::clone(&self.val), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedConstructorMeta { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedConstructorMeta", + "val", + &&self.val, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedConstructorMeta { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedConstructorMeta {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedConstructorMeta { + #[inline] + fn eq(&self, other: &UsedConstructorMeta) -> bool { + self.val == other.val + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDCONSTRUCTORMETA: [u8; 56usize] = UsedConstructorMeta::spec_xdr(); +impl UsedConstructorMeta { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedConstructorMeta\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" + } +} +impl soroban_sdk::TryFromVal for UsedConstructorMeta { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedConstructorMeta, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedConstructorMeta, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +pub struct Context { + pub val: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for Context { + #[inline] + fn clone(&self) -> Context { + Context { + val: ::core::clone::Clone::clone(&self.val), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for Context { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish(f, "Context", "val", &&self.val) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for Context { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for Context {} +#[automatically_derived] +impl ::core::cmp::PartialEq for Context { + #[inline] + fn eq(&self, other: &Context) -> bool { + self.val == other.val + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_CONTEXT: [u8; 44usize] = Context::spec_xdr(); +impl Context { + pub const fn spec_xdr() -> [u8; 44usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x07Context\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" + } +} +impl soroban_sdk::TryFromVal for Context { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &Context, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&Context, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} pub enum UsedReturnEnum { A(u32), B(i64), @@ -522,56 +705,66 @@ impl soroban_sdk::TryFromVal for soroban_sdk:: <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub enum UsedPanicErrorEnum { - Boom = 1, +pub enum UsedAuthErrorEnum { + NotFound = 1, + Invalid = 2, } #[automatically_derived] -impl ::core::marker::Copy for UsedPanicErrorEnum {} +impl ::core::marker::Copy for UsedAuthErrorEnum {} #[automatically_derived] -impl ::core::clone::Clone for UsedPanicErrorEnum { +impl ::core::clone::Clone for UsedAuthErrorEnum { #[inline] - fn clone(&self) -> UsedPanicErrorEnum { + fn clone(&self) -> UsedAuthErrorEnum { *self } } #[automatically_derived] -impl ::core::fmt::Debug for UsedPanicErrorEnum { +impl ::core::fmt::Debug for UsedAuthErrorEnum { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str(f, "Boom") + ::core::fmt::Formatter::write_str( + f, + match self { + UsedAuthErrorEnum::NotFound => "NotFound", + UsedAuthErrorEnum::Invalid => "Invalid", + }, + ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedPanicErrorEnum { +impl ::core::cmp::Eq for UsedAuthErrorEnum { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () {} } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedPanicErrorEnum {} +impl ::core::marker::StructuralPartialEq for UsedAuthErrorEnum {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedPanicErrorEnum { +impl ::core::cmp::PartialEq for UsedAuthErrorEnum { #[inline] - fn eq(&self, other: &UsedPanicErrorEnum) -> bool { - true + fn eq(&self, other: &UsedAuthErrorEnum) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDPANICERRORENUM: [u8; 56usize] = UsedPanicErrorEnum::spec_xdr(); -impl UsedPanicErrorEnum { - pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x12UsedPanicErrorEnum\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04Boom\0\0\0\x01" +pub static __SPEC_XDR_TYPE_USEDAUTHERRORENUM: [u8; 80usize] = UsedAuthErrorEnum::spec_xdr(); +impl UsedAuthErrorEnum { + pub const fn spec_xdr() -> [u8; 80usize] { + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x11UsedAuthErrorEnum\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x08NotFound\0\0\0\x01\0\0\0\0\0\0\0\x07Invalid\0\0\0\0\x02" } } -impl TryFrom for UsedPanicErrorEnum { +impl TryFrom for UsedAuthErrorEnum { type Error = soroban_sdk::Error; #[inline(always)] fn try_from(error: soroban_sdk::Error) -> Result { if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { let discriminant = error.get_code(); Ok(match discriminant { - 1u32 => Self::Boom, + 1u32 => Self::NotFound, + 2u32 => Self::Invalid, _ => return Err(error), }) } else { @@ -579,62 +772,65 @@ impl TryFrom for UsedPanicErrorEnum { } } } -impl TryFrom<&soroban_sdk::Error> for UsedPanicErrorEnum { +impl TryFrom<&soroban_sdk::Error> for UsedAuthErrorEnum { type Error = soroban_sdk::Error; #[inline(always)] fn try_from(error: &soroban_sdk::Error) -> Result { <_ as TryFrom>::try_from(*error) } } -impl From for soroban_sdk::Error { +impl From for soroban_sdk::Error { #[inline(always)] - fn from(val: UsedPanicErrorEnum) -> soroban_sdk::Error { - <_ as From<&UsedPanicErrorEnum>>::from(&val) + fn from(val: UsedAuthErrorEnum) -> soroban_sdk::Error { + <_ as From<&UsedAuthErrorEnum>>::from(&val) } } -impl From<&UsedPanicErrorEnum> for soroban_sdk::Error { +impl From<&UsedAuthErrorEnum> for soroban_sdk::Error { #[inline(always)] - fn from(val: &UsedPanicErrorEnum) -> soroban_sdk::Error { + fn from(val: &UsedAuthErrorEnum) -> soroban_sdk::Error { match val { - UsedPanicErrorEnum::Boom => soroban_sdk::Error::from_contract_error(1u32), + UsedAuthErrorEnum::NotFound => soroban_sdk::Error::from_contract_error(1u32), + UsedAuthErrorEnum::Invalid => soroban_sdk::Error::from_contract_error(2u32), } } } -impl TryFrom for UsedPanicErrorEnum { +impl TryFrom for UsedAuthErrorEnum { type Error = soroban_sdk::InvokeError; #[inline(always)] fn try_from(error: soroban_sdk::InvokeError) -> Result { match error { soroban_sdk::InvokeError::Abort => Err(error), soroban_sdk::InvokeError::Contract(code) => Ok(match code { - 1u32 => Self::Boom, + 1u32 => Self::NotFound, + 2u32 => Self::Invalid, _ => return Err(error), }), } } } -impl TryFrom<&soroban_sdk::InvokeError> for UsedPanicErrorEnum { +impl TryFrom<&soroban_sdk::InvokeError> for UsedAuthErrorEnum { type Error = soroban_sdk::InvokeError; #[inline(always)] fn try_from(error: &soroban_sdk::InvokeError) -> Result { <_ as TryFrom>::try_from(*error) } } -impl From for soroban_sdk::InvokeError { +impl From for soroban_sdk::InvokeError { #[inline(always)] - fn from(val: UsedPanicErrorEnum) -> soroban_sdk::InvokeError { - <_ as From<&UsedPanicErrorEnum>>::from(&val) + fn from(val: UsedAuthErrorEnum) -> soroban_sdk::InvokeError { + <_ as From<&UsedAuthErrorEnum>>::from(&val) } } -impl From<&UsedPanicErrorEnum> for soroban_sdk::InvokeError { +impl From<&UsedAuthErrorEnum> for soroban_sdk::InvokeError { #[inline(always)] - fn from(val: &UsedPanicErrorEnum) -> soroban_sdk::InvokeError { + fn from(val: &UsedAuthErrorEnum) -> soroban_sdk::InvokeError { match val { - UsedPanicErrorEnum::Boom => soroban_sdk::InvokeError::Contract(1u32), + UsedAuthErrorEnum::NotFound => soroban_sdk::InvokeError::Contract(1u32), + UsedAuthErrorEnum::Invalid => soroban_sdk::InvokeError::Contract(2u32), } } } -impl soroban_sdk::TryFromVal for UsedPanicErrorEnum { +impl soroban_sdk::TryFromVal for UsedAuthErrorEnum { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( @@ -646,79 +842,77 @@ impl soroban_sdk::TryFromVal for UsedPanicEr error.try_into().map_err(|_| soroban_sdk::ConversionError) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedPanicErrorEnum, + val: &UsedAuthErrorEnum, ) -> Result { let error: soroban_sdk::Error = val.into(); Ok(error.into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedPanicErrorEnum, + val: &&UsedAuthErrorEnum, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub enum UsedAssertErrorEnum { - Bad = 1, +pub enum UsedPanicErrorEnum { + Boom = 1, } #[automatically_derived] -impl ::core::marker::Copy for UsedAssertErrorEnum {} +impl ::core::marker::Copy for UsedPanicErrorEnum {} #[automatically_derived] -impl ::core::clone::Clone for UsedAssertErrorEnum { +impl ::core::clone::Clone for UsedPanicErrorEnum { #[inline] - fn clone(&self) -> UsedAssertErrorEnum { + fn clone(&self) -> UsedPanicErrorEnum { *self } } #[automatically_derived] -impl ::core::fmt::Debug for UsedAssertErrorEnum { +impl ::core::fmt::Debug for UsedPanicErrorEnum { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str(f, "Bad") + ::core::fmt::Formatter::write_str(f, "Boom") } } #[automatically_derived] -impl ::core::cmp::Eq for UsedAssertErrorEnum { +impl ::core::cmp::Eq for UsedPanicErrorEnum { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () {} } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedAssertErrorEnum {} +impl ::core::marker::StructuralPartialEq for UsedPanicErrorEnum {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedAssertErrorEnum { +impl ::core::cmp::PartialEq for UsedPanicErrorEnum { #[inline] - fn eq(&self, other: &UsedAssertErrorEnum) -> bool { + fn eq(&self, other: &UsedPanicErrorEnum) -> bool { true } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDASSERTERRORENUM: [u8; 56usize] = UsedAssertErrorEnum::spec_xdr(); -impl UsedAssertErrorEnum { +pub static __SPEC_XDR_TYPE_USEDPANICERRORENUM: [u8; 56usize] = UsedPanicErrorEnum::spec_xdr(); +impl UsedPanicErrorEnum { pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x13UsedAssertErrorEnum\0\0\0\0\x01\0\0\0\0\0\0\0\x03Bad\0\0\0\0\x01" + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x12UsedPanicErrorEnum\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04Boom\0\0\0\x01" } } -impl TryFrom for UsedAssertErrorEnum { +impl TryFrom for UsedPanicErrorEnum { type Error = soroban_sdk::Error; #[inline(always)] fn try_from(error: soroban_sdk::Error) -> Result { if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { let discriminant = error.get_code(); Ok(match discriminant { - 1u32 => Self::Bad, + 1u32 => Self::Boom, _ => return Err(error), }) } else { @@ -726,62 +920,62 @@ impl TryFrom for UsedAssertErrorEnum { } } } -impl TryFrom<&soroban_sdk::Error> for UsedAssertErrorEnum { +impl TryFrom<&soroban_sdk::Error> for UsedPanicErrorEnum { type Error = soroban_sdk::Error; #[inline(always)] fn try_from(error: &soroban_sdk::Error) -> Result { <_ as TryFrom>::try_from(*error) } } -impl From for soroban_sdk::Error { +impl From for soroban_sdk::Error { #[inline(always)] - fn from(val: UsedAssertErrorEnum) -> soroban_sdk::Error { - <_ as From<&UsedAssertErrorEnum>>::from(&val) + fn from(val: UsedPanicErrorEnum) -> soroban_sdk::Error { + <_ as From<&UsedPanicErrorEnum>>::from(&val) } } -impl From<&UsedAssertErrorEnum> for soroban_sdk::Error { +impl From<&UsedPanicErrorEnum> for soroban_sdk::Error { #[inline(always)] - fn from(val: &UsedAssertErrorEnum) -> soroban_sdk::Error { + fn from(val: &UsedPanicErrorEnum) -> soroban_sdk::Error { match val { - UsedAssertErrorEnum::Bad => soroban_sdk::Error::from_contract_error(1u32), + UsedPanicErrorEnum::Boom => soroban_sdk::Error::from_contract_error(1u32), } } } -impl TryFrom for UsedAssertErrorEnum { +impl TryFrom for UsedPanicErrorEnum { type Error = soroban_sdk::InvokeError; #[inline(always)] fn try_from(error: soroban_sdk::InvokeError) -> Result { match error { soroban_sdk::InvokeError::Abort => Err(error), soroban_sdk::InvokeError::Contract(code) => Ok(match code { - 1u32 => Self::Bad, + 1u32 => Self::Boom, _ => return Err(error), }), } } } -impl TryFrom<&soroban_sdk::InvokeError> for UsedAssertErrorEnum { +impl TryFrom<&soroban_sdk::InvokeError> for UsedPanicErrorEnum { type Error = soroban_sdk::InvokeError; #[inline(always)] fn try_from(error: &soroban_sdk::InvokeError) -> Result { <_ as TryFrom>::try_from(*error) } } -impl From for soroban_sdk::InvokeError { +impl From for soroban_sdk::InvokeError { #[inline(always)] - fn from(val: UsedAssertErrorEnum) -> soroban_sdk::InvokeError { - <_ as From<&UsedAssertErrorEnum>>::from(&val) + fn from(val: UsedPanicErrorEnum) -> soroban_sdk::InvokeError { + <_ as From<&UsedPanicErrorEnum>>::from(&val) } } -impl From<&UsedAssertErrorEnum> for soroban_sdk::InvokeError { +impl From<&UsedPanicErrorEnum> for soroban_sdk::InvokeError { #[inline(always)] - fn from(val: &UsedAssertErrorEnum) -> soroban_sdk::InvokeError { + fn from(val: &UsedPanicErrorEnum) -> soroban_sdk::InvokeError { match val { - UsedAssertErrorEnum::Bad => soroban_sdk::InvokeError::Contract(1u32), + UsedPanicErrorEnum::Boom => soroban_sdk::InvokeError::Contract(1u32), } } } -impl soroban_sdk::TryFromVal for UsedAssertErrorEnum { +impl soroban_sdk::TryFromVal for UsedPanicErrorEnum { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( @@ -793,504 +987,439 @@ impl soroban_sdk::TryFromVal for UsedAssertE error.try_into().map_err(|_| soroban_sdk::ConversionError) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedAssertErrorEnum, + val: &UsedPanicErrorEnum, ) -> Result { let error: soroban_sdk::Error = val.into(); Ok(error.into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedAssertErrorEnum, + val: &&UsedPanicErrorEnum, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( + <_ as soroban_sdk::TryFromVal>::try_from_val( env, *val, ) } } -pub struct UsedNestedInStruct { - pub val: i64, +pub enum UsedPanicErrorEnumRef { + Boom = 1, } #[automatically_derived] -impl ::core::clone::Clone for UsedNestedInStruct { +impl ::core::marker::Copy for UsedPanicErrorEnumRef {} +#[automatically_derived] +impl ::core::clone::Clone for UsedPanicErrorEnumRef { #[inline] - fn clone(&self) -> UsedNestedInStruct { - UsedNestedInStruct { - val: ::core::clone::Clone::clone(&self.val), - } + fn clone(&self) -> UsedPanicErrorEnumRef { + *self } } #[automatically_derived] -impl ::core::fmt::Debug for UsedNestedInStruct { +impl ::core::fmt::Debug for UsedPanicErrorEnumRef { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( - f, - "UsedNestedInStruct", - "val", - &&self.val, - ) + ::core::fmt::Formatter::write_str(f, "Boom") } } #[automatically_derived] -impl ::core::cmp::Eq for UsedNestedInStruct { +impl ::core::cmp::Eq for UsedPanicErrorEnumRef { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - } + fn assert_receiver_is_total_eq(&self) -> () {} } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedNestedInStruct {} +impl ::core::marker::StructuralPartialEq for UsedPanicErrorEnumRef {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedNestedInStruct { +impl ::core::cmp::PartialEq for UsedPanicErrorEnumRef { #[inline] - fn eq(&self, other: &UsedNestedInStruct) -> bool { - self.val == other.val + fn eq(&self, other: &UsedPanicErrorEnumRef) -> bool { + true } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDNESTEDINSTRUCT: [u8; 56usize] = UsedNestedInStruct::spec_xdr(); -impl UsedNestedInStruct { - pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedNestedInStruct\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x07" +pub static __SPEC_XDR_TYPE_USEDPANICERRORENUMREF: [u8; 60usize] = UsedPanicErrorEnumRef::spec_xdr(); +impl UsedPanicErrorEnumRef { + pub const fn spec_xdr() -> [u8; 60usize] { + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x15UsedPanicErrorEnumRef\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04Boom\0\0\0\x01" } } -impl soroban_sdk::TryFromVal for UsedNestedInStruct { - type Error = soroban_sdk::ConversionError; - fn try_from_val( - env: &soroban_sdk::Env, - val: &soroban_sdk::Val, - ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; - let map: MapObject = val.try_into().map_err(|_| ConversionError)?; - env.map_unpack_to_slice(map, &KEYS, &mut vals) - .map_err(|_| ConversionError)?; - Ok(Self { - val: vals[0] - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?, - }) +impl TryFrom for UsedPanicErrorEnumRef { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: soroban_sdk::Error) -> Result { + if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { + let discriminant = error.get_code(); + Ok(match discriminant { + 1u32 => Self::Boom, + _ => return Err(error), + }) + } else { + Err(error) + } } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; - fn try_from_val( - env: &soroban_sdk::Env, - val: &UsedNestedInStruct, - ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; - Ok(env - .map_new_from_slices(&KEYS, &vals) - .map_err(|_| ConversionError)? - .into()) +impl TryFrom<&soroban_sdk::Error> for UsedPanicErrorEnumRef { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: &soroban_sdk::Error) -> Result { + <_ as TryFrom>::try_from(*error) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; +impl From for soroban_sdk::Error { #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &&UsedNestedInStruct, - ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) + fn from(val: UsedPanicErrorEnumRef) -> soroban_sdk::Error { + <_ as From<&UsedPanicErrorEnumRef>>::from(&val) } } -pub struct UsedVecElement { - pub data: u32, -} -#[automatically_derived] -impl ::core::clone::Clone for UsedVecElement { - #[inline] - fn clone(&self) -> UsedVecElement { - UsedVecElement { - data: ::core::clone::Clone::clone(&self.data), +impl From<&UsedPanicErrorEnumRef> for soroban_sdk::Error { + #[inline(always)] + fn from(val: &UsedPanicErrorEnumRef) -> soroban_sdk::Error { + match val { + UsedPanicErrorEnumRef::Boom => soroban_sdk::Error::from_contract_error(1u32), } } } -#[automatically_derived] -impl ::core::fmt::Debug for UsedVecElement { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedVecElement", "data", &&self.data) +impl TryFrom for UsedPanicErrorEnumRef { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: soroban_sdk::InvokeError) -> Result { + match error { + soroban_sdk::InvokeError::Abort => Err(error), + soroban_sdk::InvokeError::Contract(code) => Ok(match code { + 1u32 => Self::Boom, + _ => return Err(error), + }), + } } } -#[automatically_derived] -impl ::core::cmp::Eq for UsedVecElement { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; +impl TryFrom<&soroban_sdk::InvokeError> for UsedPanicErrorEnumRef { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: &soroban_sdk::InvokeError) -> Result { + <_ as TryFrom>::try_from(*error) } } -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedVecElement {} -#[automatically_derived] -impl ::core::cmp::PartialEq for UsedVecElement { - #[inline] - fn eq(&self, other: &UsedVecElement) -> bool { - self.data == other.data +impl From for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: UsedPanicErrorEnumRef) -> soroban_sdk::InvokeError { + <_ as From<&UsedPanicErrorEnumRef>>::from(&val) } } -#[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDVECELEMENT: [u8; 52usize] = UsedVecElement::spec_xdr(); -impl UsedVecElement { - pub const fn spec_xdr() -> [u8; 52usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0eUsedVecElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" +impl From<&UsedPanicErrorEnumRef> for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: &UsedPanicErrorEnumRef) -> soroban_sdk::InvokeError { + match val { + UsedPanicErrorEnumRef::Boom => soroban_sdk::InvokeError::Contract(1u32), + } } } -impl soroban_sdk::TryFromVal for UsedVecElement { +impl soroban_sdk::TryFromVal for UsedPanicErrorEnumRef { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; - let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; - let map: MapObject = val.try_into().map_err(|_| ConversionError)?; - env.map_unpack_to_slice(map, &KEYS, &mut vals) - .map_err(|_| ConversionError)?; - Ok(Self { - data: vals[0] - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?, - }) + use soroban_sdk::TryIntoVal; + let error: soroban_sdk::Error = val.try_into_val(env)?; + error.try_into().map_err(|_| soroban_sdk::ConversionError) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedVecElement, + val: &UsedPanicErrorEnumRef, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; - let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; - Ok(env - .map_new_from_slices(&KEYS, &vals) - .map_err(|_| ConversionError)? - .into()) + let error: soroban_sdk::Error = val.into(); + Ok(error.into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedVecElement, + val: &&UsedPanicErrorEnumRef, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) } } -pub enum UsedMapKey { - K1 = 1, - K2 = 2, +pub enum UsedAssertErrorEnum { + Bad = 1, } #[automatically_derived] -impl ::core::marker::Copy for UsedMapKey {} +impl ::core::marker::Copy for UsedAssertErrorEnum {} #[automatically_derived] -impl ::core::clone::Clone for UsedMapKey { +impl ::core::clone::Clone for UsedAssertErrorEnum { #[inline] - fn clone(&self) -> UsedMapKey { + fn clone(&self) -> UsedAssertErrorEnum { *self } } #[automatically_derived] -impl ::core::fmt::Debug for UsedMapKey { +impl ::core::fmt::Debug for UsedAssertErrorEnum { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( - f, - match self { - UsedMapKey::K1 => "K1", - UsedMapKey::K2 => "K2", - }, - ) + ::core::fmt::Formatter::write_str(f, "Bad") } } #[automatically_derived] -impl ::core::cmp::Eq for UsedMapKey { +impl ::core::cmp::Eq for UsedAssertErrorEnum { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () {} } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedMapKey {} +impl ::core::marker::StructuralPartialEq for UsedAssertErrorEnum {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedMapKey { +impl ::core::cmp::PartialEq for UsedAssertErrorEnum { #[inline] - fn eq(&self, other: &UsedMapKey) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr + fn eq(&self, other: &UsedAssertErrorEnum) -> bool { + true } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDMAPKEY: [u8; 64usize] = UsedMapKey::spec_xdr(); -impl UsedMapKey { - pub const fn spec_xdr() -> [u8; 64usize] { - *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\nUsedMapKey\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02K1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02K2\0\0\0\0\0\x02" - } -} -impl soroban_sdk::TryFromVal for UsedMapKey { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &soroban_sdk::Val, - ) -> Result { - use soroban_sdk::TryIntoVal; - let discriminant: u32 = val.try_into_val(env)?; - Ok(match discriminant { - 1u32 => Self::K1, - 2u32 => Self::K2, - _ => Err(soroban_sdk::ConversionError {})?, - }) +pub static __SPEC_XDR_TYPE_USEDASSERTERRORENUM: [u8; 56usize] = UsedAssertErrorEnum::spec_xdr(); +impl UsedAssertErrorEnum { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x13UsedAssertErrorEnum\0\0\0\0\x01\0\0\0\0\0\0\0\x03Bad\0\0\0\0\x01" } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; +impl TryFrom for UsedAssertErrorEnum { + type Error = soroban_sdk::Error; #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &UsedMapKey, - ) -> Result { - Ok(match val { - UsedMapKey::K1 => 1u32.into(), - UsedMapKey::K2 => 2u32.into(), - }) + fn try_from(error: soroban_sdk::Error) -> Result { + if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { + let discriminant = error.get_code(); + Ok(match discriminant { + 1u32 => Self::Bad, + _ => return Err(error), + }) + } else { + Err(error) + } } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; +impl TryFrom<&soroban_sdk::Error> for UsedAssertErrorEnum { + type Error = soroban_sdk::Error; #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &&UsedMapKey, - ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + fn try_from(error: &soroban_sdk::Error) -> Result { + <_ as TryFrom>::try_from(*error) } } -pub struct UsedMapVal { - pub v: u32, +impl From for soroban_sdk::Error { + #[inline(always)] + fn from(val: UsedAssertErrorEnum) -> soroban_sdk::Error { + <_ as From<&UsedAssertErrorEnum>>::from(&val) + } } -#[automatically_derived] -impl ::core::clone::Clone for UsedMapVal { - #[inline] - fn clone(&self) -> UsedMapVal { - UsedMapVal { - v: ::core::clone::Clone::clone(&self.v), +impl From<&UsedAssertErrorEnum> for soroban_sdk::Error { + #[inline(always)] + fn from(val: &UsedAssertErrorEnum) -> soroban_sdk::Error { + match val { + UsedAssertErrorEnum::Bad => soroban_sdk::Error::from_contract_error(1u32), } } } -#[automatically_derived] -impl ::core::fmt::Debug for UsedMapVal { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedMapVal", "v", &&self.v) +impl TryFrom for UsedAssertErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: soroban_sdk::InvokeError) -> Result { + match error { + soroban_sdk::InvokeError::Abort => Err(error), + soroban_sdk::InvokeError::Contract(code) => Ok(match code { + 1u32 => Self::Bad, + _ => return Err(error), + }), + } } } -#[automatically_derived] -impl ::core::cmp::Eq for UsedMapVal { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; +impl TryFrom<&soroban_sdk::InvokeError> for UsedAssertErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: &soroban_sdk::InvokeError) -> Result { + <_ as TryFrom>::try_from(*error) } } -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedMapVal {} -#[automatically_derived] -impl ::core::cmp::PartialEq for UsedMapVal { - #[inline] - fn eq(&self, other: &UsedMapVal) -> bool { - self.v == other.v +impl From for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: UsedAssertErrorEnum) -> soroban_sdk::InvokeError { + <_ as From<&UsedAssertErrorEnum>>::from(&val) } } -#[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDMAPVAL: [u8; 48usize] = UsedMapVal::spec_xdr(); -impl UsedMapVal { - pub const fn spec_xdr() -> [u8; 48usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\nUsedMapVal\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x04" +impl From<&UsedAssertErrorEnum> for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: &UsedAssertErrorEnum) -> soroban_sdk::InvokeError { + match val { + UsedAssertErrorEnum::Bad => soroban_sdk::InvokeError::Contract(1u32), + } } } -impl soroban_sdk::TryFromVal for UsedMapVal { +impl soroban_sdk::TryFromVal for UsedAssertErrorEnum { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["v"]; - let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; - let map: MapObject = val.try_into().map_err(|_| ConversionError)?; - env.map_unpack_to_slice(map, &KEYS, &mut vals) - .map_err(|_| ConversionError)?; - Ok(Self { - v: vals[0] - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?, - }) + use soroban_sdk::TryIntoVal; + let error: soroban_sdk::Error = val.try_into_val(env)?; + error.try_into().map_err(|_| soroban_sdk::ConversionError) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedMapVal, + val: &UsedAssertErrorEnum, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["v"]; - let vals: [Val; 1usize] = [(&val.v).try_into_val(env).map_err(|_| ConversionError)?]; - Ok(env - .map_new_from_slices(&KEYS, &vals) - .map_err(|_| ConversionError)? - .into()) + let error: soroban_sdk::Error = val.into(); + Ok(error.into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedMapVal, + val: &&UsedAssertErrorEnum, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) } } -pub struct UsedOptionElement { - pub data: u32, +pub struct UsedNestedInStruct { + pub val: i64, } #[automatically_derived] -impl ::core::clone::Clone for UsedOptionElement { +impl ::core::clone::Clone for UsedNestedInStruct { #[inline] - fn clone(&self) -> UsedOptionElement { - UsedOptionElement { - data: ::core::clone::Clone::clone(&self.data), + fn clone(&self) -> UsedNestedInStruct { + UsedNestedInStruct { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedOptionElement { +impl ::core::fmt::Debug for UsedNestedInStruct { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedOptionElement", - "data", - &&self.data, + "UsedNestedInStruct", + "val", + &&self.val, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedOptionElement { +impl ::core::cmp::Eq for UsedNestedInStruct { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedOptionElement {} +impl ::core::marker::StructuralPartialEq for UsedNestedInStruct {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedOptionElement { +impl ::core::cmp::PartialEq for UsedNestedInStruct { #[inline] - fn eq(&self, other: &UsedOptionElement) -> bool { - self.data == other.data + fn eq(&self, other: &UsedNestedInStruct) -> bool { + self.val == other.val } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDOPTIONELEMENT: [u8; 56usize] = UsedOptionElement::spec_xdr(); -impl UsedOptionElement { +pub static __SPEC_XDR_TYPE_USEDNESTEDINSTRUCT: [u8; 56usize] = UsedNestedInStruct::spec_xdr(); +impl UsedNestedInStruct { pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedOptionElement\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedNestedInStruct\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x07" } } -impl soroban_sdk::TryFromVal for UsedOptionElement { +impl soroban_sdk::TryFromVal for UsedNestedInStruct { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; + const KEYS: [&'static str; 1usize] = ["val"]; let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - data: vals[0] + val: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedOptionElement, + val: &UsedNestedInStruct, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; - let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedOptionElement, + val: &&UsedNestedInStruct, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) } } -pub struct UsedResultOk { +pub struct UsedVecElement { pub data: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedResultOk { +impl ::core::clone::Clone for UsedVecElement { #[inline] - fn clone(&self) -> UsedResultOk { - UsedResultOk { + fn clone(&self) -> UsedVecElement { + UsedVecElement { data: ::core::clone::Clone::clone(&self.data), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedResultOk { +impl ::core::fmt::Debug for UsedVecElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedResultOk", "data", &&self.data) + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedVecElement", "data", &&self.data) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedResultOk { +impl ::core::cmp::Eq for UsedVecElement { #[inline] #[doc(hidden)] #[coverage(off)] @@ -1299,22 +1428,22 @@ impl ::core::cmp::Eq for UsedResultOk { } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedResultOk {} +impl ::core::marker::StructuralPartialEq for UsedVecElement {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedResultOk { +impl ::core::cmp::PartialEq for UsedVecElement { #[inline] - fn eq(&self, other: &UsedResultOk) -> bool { + fn eq(&self, other: &UsedVecElement) -> bool { self.data == other.data } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDRESULTOK: [u8; 48usize] = UsedResultOk::spec_xdr(); -impl UsedResultOk { - pub const fn spec_xdr() -> [u8; 48usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0cUsedResultOk\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDVECELEMENT: [u8; 52usize] = UsedVecElement::spec_xdr(); +impl UsedVecElement { + pub const fn spec_xdr() -> [u8; 52usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0eUsedVecElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" } } -impl soroban_sdk::TryFromVal for UsedResultOk { +impl soroban_sdk::TryFromVal for UsedVecElement { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -1333,11 +1462,11 @@ impl soroban_sdk::TryFromVal for UsedResultO }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedResultOk, + val: &UsedVecElement, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["data"]; @@ -1348,145 +1477,1502 @@ impl soroban_sdk::TryFromVal for soroban_sdk::Va .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedResultOk, + val: &&UsedVecElement, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub struct UsedEventSimple { - pub kind: Symbol, - pub amount: i128, +pub enum UsedMapKey { + K1 = 1, + K2 = 2, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventSimple { +impl ::core::marker::Copy for UsedMapKey {} +#[automatically_derived] +impl ::core::clone::Clone for UsedMapKey { #[inline] - fn clone(&self) -> UsedEventSimple { - UsedEventSimple { - kind: ::core::clone::Clone::clone(&self.kind), - amount: ::core::clone::Clone::clone(&self.amount), - } + fn clone(&self) -> UsedMapKey { + *self } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventSimple { +impl ::core::fmt::Debug for UsedMapKey { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( + ::core::fmt::Formatter::write_str( + f, + match self { + UsedMapKey::K1 => "K1", + UsedMapKey::K2 => "K2", + }, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedMapKey { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedMapKey {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedMapKey { + #[inline] + fn eq(&self, other: &UsedMapKey) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDMAPKEY: [u8; 64usize] = UsedMapKey::spec_xdr(); +impl UsedMapKey { + pub const fn spec_xdr() -> [u8; 64usize] { + *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\nUsedMapKey\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02K1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02K2\0\0\0\0\0\x02" + } +} +impl soroban_sdk::TryFromVal for UsedMapKey { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let discriminant: u32 = val.try_into_val(env)?; + Ok(match discriminant { + 1u32 => Self::K1, + 2u32 => Self::K2, + _ => Err(soroban_sdk::ConversionError {})?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedMapKey, + ) -> Result { + Ok(match val { + UsedMapKey::K1 => 1u32.into(), + UsedMapKey::K2 => 2u32.into(), + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedMapKey, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +pub struct UsedMapVal { + pub v: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedMapVal { + #[inline] + fn clone(&self) -> UsedMapVal { + UsedMapVal { + v: ::core::clone::Clone::clone(&self.v), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedMapVal { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedMapVal", "v", &&self.v) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedMapVal { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedMapVal {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedMapVal { + #[inline] + fn eq(&self, other: &UsedMapVal) -> bool { + self.v == other.v + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDMAPVAL: [u8; 48usize] = UsedMapVal::spec_xdr(); +impl UsedMapVal { + pub const fn spec_xdr() -> [u8; 48usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\nUsedMapVal\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x04" + } +} +impl soroban_sdk::TryFromVal for UsedMapVal { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["v"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + v: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedMapVal, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["v"]; + let vals: [Val; 1usize] = [(&val.v).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedMapVal, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +pub struct UsedOptionElement { + pub data: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedOptionElement { + #[inline] + fn clone(&self) -> UsedOptionElement { + UsedOptionElement { + data: ::core::clone::Clone::clone(&self.data), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedOptionElement { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedOptionElement", + "data", + &&self.data, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedOptionElement { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedOptionElement {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedOptionElement { + #[inline] + fn eq(&self, other: &UsedOptionElement) -> bool { + self.data == other.data + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDOPTIONELEMENT: [u8; 56usize] = UsedOptionElement::spec_xdr(); +impl UsedOptionElement { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedOptionElement\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" + } +} +impl soroban_sdk::TryFromVal for UsedOptionElement { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + data: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedOptionElement, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedOptionElement, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +pub struct UsedResultOk { + pub data: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedResultOk { + #[inline] + fn clone(&self) -> UsedResultOk { + UsedResultOk { + data: ::core::clone::Clone::clone(&self.data), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedResultOk { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedResultOk", "data", &&self.data) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedResultOk { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedResultOk {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedResultOk { + #[inline] + fn eq(&self, other: &UsedResultOk) -> bool { + self.data == other.data + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDRESULTOK: [u8; 48usize] = UsedResultOk::spec_xdr(); +impl UsedResultOk { + pub const fn spec_xdr() -> [u8; 48usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0cUsedResultOk\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" + } +} +impl soroban_sdk::TryFromVal for UsedResultOk { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + data: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedResultOk, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedResultOk, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +pub struct CustomSignature { + pub nonce: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for CustomSignature { + #[inline] + fn clone(&self) -> CustomSignature { + CustomSignature { + nonce: ::core::clone::Clone::clone(&self.nonce), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for CustomSignature { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "CustomSignature", + "nonce", + &&self.nonce, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for CustomSignature { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for CustomSignature {} +#[automatically_derived] +impl ::core::cmp::PartialEq for CustomSignature { + #[inline] + fn eq(&self, other: &CustomSignature) -> bool { + self.nonce == other.nonce + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_CUSTOMSIGNATURE: [u8; 56usize] = CustomSignature::spec_xdr(); +impl CustomSignature { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fCustomSignature\0\0\0\0\x01\0\0\0\0\0\0\0\x05nonce\0\0\0\0\0\0\x04" + } +} +impl soroban_sdk::TryFromVal for CustomSignature { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["nonce"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + nonce: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &CustomSignature, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["nonce"]; + let vals: [Val; 1usize] = [(&val.nonce) + .try_into_val(env) + .map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&CustomSignature, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +pub struct UsedEventSimple { + pub kind: Symbol, + pub amount: i128, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventSimple { + #[inline] + fn clone(&self) -> UsedEventSimple { + UsedEventSimple { + kind: ::core::clone::Clone::clone(&self.kind), + amount: ::core::clone::Clone::clone(&self.amount), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventSimple { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( f, "UsedEventSimple", "kind", &self.kind, - "amount", - &&self.amount, + "amount", + &&self.amount, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventSimple { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventSimple {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventSimple { + #[inline] + fn eq(&self, other: &UsedEventSimple) -> bool { + self.amount == other.amount && self.kind == other.kind + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_EVENT_USEDEVENTSIMPLE: [u8; 112usize] = UsedEventSimple::spec_xdr(); +impl UsedEventSimple { + pub const fn spec_xdr() -> [u8; 112usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x0fUsedEventSimple\0\0\0\0\x01\0\0\0\x11used_event_simple\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" + } +} +impl soroban_sdk::Event for UsedEventSimple { + fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { + use soroban_sdk::IntoVal; + (&{ soroban_sdk::Symbol::new(env, "used_event_simple") }, { + let v: soroban_sdk::Val = self.kind.into_val(env); + v + }) + .into_val(env) + } + fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { + use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; + const KEYS: [&'static str; 1usize] = ["amount"]; + let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; + env.map_new_from_slices(&KEYS, &vals) + .unwrap_infallible() + .into() + } +} +impl UsedEventSimple { + pub fn publish(&self, env: &soroban_sdk::Env) { + <_ as soroban_sdk::Event>::publish(self, env); + } +} +pub enum UsedEventTopicType { + Transfer = 1, + Mint = 2, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedEventTopicType {} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventTopicType { + #[inline] + fn clone(&self) -> UsedEventTopicType { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventTopicType { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + UsedEventTopicType::Transfer => "Transfer", + UsedEventTopicType::Mint => "Mint", + }, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventTopicType { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventTopicType {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventTopicType { + #[inline] + fn eq(&self, other: &UsedEventTopicType) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDEVENTTOPICTYPE: [u8; 76usize] = UsedEventTopicType::spec_xdr(); +impl UsedEventTopicType { + pub const fn spec_xdr() -> [u8; 76usize] { + *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventTopicType\0\0\0\0\0\x02\0\0\0\0\0\0\0\x08Transfer\0\0\0\x01\0\0\0\0\0\0\0\x04Mint\0\0\0\x02" + } +} +impl soroban_sdk::TryFromVal for UsedEventTopicType { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let discriminant: u32 = val.try_into_val(env)?; + Ok(match discriminant { + 1u32 => Self::Transfer, + 2u32 => Self::Mint, + _ => Err(soroban_sdk::ConversionError {})?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedEventTopicType, + ) -> Result { + Ok(match val { + UsedEventTopicType::Transfer => 1u32.into(), + UsedEventTopicType::Mint => 2u32.into(), + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedEventTopicType, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +pub struct UsedEventWithTopicType { + pub kind: UsedEventTopicType, + pub amount: i128, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventWithTopicType { + #[inline] + fn clone(&self) -> UsedEventWithTopicType { + UsedEventWithTopicType { + kind: ::core::clone::Clone::clone(&self.kind), + amount: ::core::clone::Clone::clone(&self.amount), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventWithTopicType { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UsedEventWithTopicType", + "kind", + &self.kind, + "amount", + &&self.amount, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventWithTopicType { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventWithTopicType {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventWithTopicType { + #[inline] + fn eq(&self, other: &UsedEventWithTopicType) -> bool { + self.amount == other.amount && self.kind == other.kind + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_EVENT_USEDEVENTWITHTOPICTYPE: [u8; 152usize] = + UsedEventWithTopicType::spec_xdr(); +impl UsedEventWithTopicType { + pub const fn spec_xdr() -> [u8; 152usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x16UsedEventWithTopicType\0\0\0\0\0\x01\0\0\0\x1aused_event_with_topic_type\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\x07\xd0\0\0\0\x12UsedEventTopicType\0\0\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" + } +} +impl soroban_sdk::Event for UsedEventWithTopicType { + fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { + use soroban_sdk::IntoVal; + ( + &{ soroban_sdk::Symbol::new(env, "used_event_with_topic_type") }, + { + let v: soroban_sdk::Val = self.kind.into_val(env); + v + }, + ) + .into_val(env) + } + fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { + use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; + const KEYS: [&'static str; 1usize] = ["amount"]; + let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; + env.map_new_from_slices(&KEYS, &vals) + .unwrap_infallible() + .into() + } +} +impl UsedEventWithTopicType { + pub fn publish(&self, env: &soroban_sdk::Env) { + <_ as soroban_sdk::Event>::publish(self, env); + } +} +pub struct UsedEventDataType { + pub x: u32, + pub y: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventDataType { + #[inline] + fn clone(&self) -> UsedEventDataType { + UsedEventDataType { + x: ::core::clone::Clone::clone(&self.x), + y: ::core::clone::Clone::clone(&self.y), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventDataType { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UsedEventDataType", + "x", + &self.x, + "y", + &&self.y, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventDataType { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventDataType {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventDataType { + #[inline] + fn eq(&self, other: &UsedEventDataType) -> bool { + self.x == other.x && self.y == other.y + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDEVENTDATATYPE: [u8; 72usize] = UsedEventDataType::spec_xdr(); +impl UsedEventDataType { + pub const fn spec_xdr() -> [u8; 72usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedEventDataType\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x04\0\0\0\0\0\0\0\x01y\0\0\0\0\0\0\x04" + } +} +impl soroban_sdk::TryFromVal for UsedEventDataType { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["x", "y"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + x: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + y: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedEventDataType, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["x", "y"]; + let vals: [Val; 2usize] = [ + (&val.x).try_into_val(env).map_err(|_| ConversionError)?, + (&val.y).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedEventDataType, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +pub struct UsedEventWithDataType { + pub kind: Symbol, + pub payload: UsedEventDataType, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventWithDataType { + #[inline] + fn clone(&self) -> UsedEventWithDataType { + UsedEventWithDataType { + kind: ::core::clone::Clone::clone(&self.kind), + payload: ::core::clone::Clone::clone(&self.payload), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventWithDataType { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UsedEventWithDataType", + "kind", + &self.kind, + "payload", + &&self.payload, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventWithDataType { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventWithDataType {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventWithDataType { + #[inline] + fn eq(&self, other: &UsedEventWithDataType) -> bool { + self.kind == other.kind && self.payload == other.payload + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_EVENT_USEDEVENTWITHDATATYPE: [u8; 152usize] = + UsedEventWithDataType::spec_xdr(); +impl UsedEventWithDataType { + pub const fn spec_xdr() -> [u8; 152usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x15UsedEventWithDataType\0\0\0\0\0\0\x01\0\0\0\x19used_event_with_data_type\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x11UsedEventDataType\0\0\0\0\0\0\0\0\0\0\x02" + } +} +impl soroban_sdk::Event for UsedEventWithDataType { + fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { + use soroban_sdk::IntoVal; + ( + &{ soroban_sdk::Symbol::new(env, "used_event_with_data_type") }, + { + let v: soroban_sdk::Val = self.kind.into_val(env); + v + }, + ) + .into_val(env) + } + fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { + use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; + const KEYS: [&'static str; 1usize] = ["payload"]; + let vals: [soroban_sdk::Val; 1usize] = [self.payload.into_val(env)]; + env.map_new_from_slices(&KEYS, &vals) + .unwrap_infallible() + .into() + } +} +impl UsedEventWithDataType { + pub fn publish(&self, env: &soroban_sdk::Env) { + <_ as soroban_sdk::Event>::publish(self, env); + } +} +pub struct UsedEventTopicOuter { + pub inner: UsedEventTopicInner, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventTopicOuter { + #[inline] + fn clone(&self) -> UsedEventTopicOuter { + UsedEventTopicOuter { + inner: ::core::clone::Clone::clone(&self.inner), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventTopicOuter { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedEventTopicOuter", + "inner", + &&self.inner, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventTopicOuter { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventTopicOuter {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventTopicOuter { + #[inline] + fn eq(&self, other: &UsedEventTopicOuter) -> bool { + self.inner == other.inner + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDEVENTTOPICOUTER: [u8; 84usize] = UsedEventTopicOuter::spec_xdr(); +impl UsedEventTopicOuter { + pub const fn spec_xdr() -> [u8; 84usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedEventTopicOuter\0\0\0\0\x01\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x13UsedEventTopicInner\0" + } +} +impl soroban_sdk::TryFromVal for UsedEventTopicOuter { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["inner"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + inner: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedEventTopicOuter, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["inner"]; + let vals: [Val; 1usize] = [(&val.inner) + .try_into_val(env) + .map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedEventTopicOuter, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +pub struct UsedEventTopicInner { + pub val: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventTopicInner { + #[inline] + fn clone(&self) -> UsedEventTopicInner { + UsedEventTopicInner { + val: ::core::clone::Clone::clone(&self.val), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventTopicInner { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedEventTopicInner", + "val", + &&self.val, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventTopicInner { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventTopicInner {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventTopicInner { + #[inline] + fn eq(&self, other: &UsedEventTopicInner) -> bool { + self.val == other.val + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDEVENTTOPICINNER: [u8; 56usize] = UsedEventTopicInner::spec_xdr(); +impl UsedEventTopicInner { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedEventTopicInner\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" + } +} +impl soroban_sdk::TryFromVal for UsedEventTopicInner { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedEventTopicInner, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedEventTopicInner, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +pub struct UsedEventWithNestedTopic { + pub info: UsedEventTopicOuter, + pub amount: i128, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventWithNestedTopic { + #[inline] + fn clone(&self) -> UsedEventWithNestedTopic { + UsedEventWithNestedTopic { + info: ::core::clone::Clone::clone(&self.info), + amount: ::core::clone::Clone::clone(&self.amount), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventWithNestedTopic { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UsedEventWithNestedTopic", + "info", + &self.info, + "amount", + &&self.amount, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventWithNestedTopic { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventWithNestedTopic {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventWithNestedTopic { + #[inline] + fn eq(&self, other: &UsedEventWithNestedTopic) -> bool { + self.amount == other.amount && self.info == other.info + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_EVENT_USEDEVENTWITHNESTEDTOPIC: [u8; 152usize] = + UsedEventWithNestedTopic::spec_xdr(); +impl UsedEventWithNestedTopic { + pub const fn spec_xdr() -> [u8; 152usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x18UsedEventWithNestedTopic\0\0\0\x01\0\0\0\x1cused_event_with_nested_topic\0\0\0\x02\0\0\0\0\0\0\0\x04info\0\0\x07\xd0\0\0\0\x13UsedEventTopicOuter\0\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" + } +} +impl soroban_sdk::Event for UsedEventWithNestedTopic { + fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { + use soroban_sdk::IntoVal; + ( + &{ soroban_sdk::Symbol::new(env, "used_event_with_nested_topic") }, + { + let v: soroban_sdk::Val = self.info.into_val(env); + v + }, + ) + .into_val(env) + } + fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { + use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; + const KEYS: [&'static str; 1usize] = ["amount"]; + let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; + env.map_new_from_slices(&KEYS, &vals) + .unwrap_infallible() + .into() + } +} +impl UsedEventWithNestedTopic { + pub fn publish(&self, env: &soroban_sdk::Env) { + <_ as soroban_sdk::Event>::publish(self, env); + } +} +pub struct UsedEventDataOuter { + pub inner: UsedEventDataInner, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventDataOuter { + #[inline] + fn clone(&self) -> UsedEventDataOuter { + UsedEventDataOuter { + inner: ::core::clone::Clone::clone(&self.inner), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventDataOuter { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedEventDataOuter", + "inner", + &&self.inner, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventDataOuter { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventDataOuter {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventDataOuter { + #[inline] + fn eq(&self, other: &UsedEventDataOuter) -> bool { + self.inner == other.inner + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDEVENTDATAOUTER: [u8; 84usize] = UsedEventDataOuter::spec_xdr(); +impl UsedEventDataOuter { + pub const fn spec_xdr() -> [u8; 84usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventDataOuter\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x12UsedEventDataInner\0\0" + } +} +impl soroban_sdk::TryFromVal for UsedEventDataOuter { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["inner"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + inner: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedEventDataOuter, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["inner"]; + let vals: [Val; 1usize] = [(&val.inner) + .try_into_val(env) + .map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedEventDataOuter, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +pub struct UsedEventDataInner { + pub val: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventDataInner { + #[inline] + fn clone(&self) -> UsedEventDataInner { + UsedEventDataInner { + val: ::core::clone::Clone::clone(&self.val), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventDataInner { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedEventDataInner", + "val", + &&self.val, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventDataInner { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventDataInner {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventDataInner { + #[inline] + fn eq(&self, other: &UsedEventDataInner) -> bool { + self.val == other.val + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDEVENTDATAINNER: [u8; 56usize] = UsedEventDataInner::spec_xdr(); +impl UsedEventDataInner { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventDataInner\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" + } +} +impl soroban_sdk::TryFromVal for UsedEventDataInner { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedEventDataInner, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedEventDataInner, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +pub struct UsedEventWithNestedData { + pub kind: Symbol, + pub payload: UsedEventDataOuter, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventWithNestedData { + #[inline] + fn clone(&self) -> UsedEventWithNestedData { + UsedEventWithNestedData { + kind: ::core::clone::Clone::clone(&self.kind), + payload: ::core::clone::Clone::clone(&self.payload), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventWithNestedData { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UsedEventWithNestedData", + "kind", + &self.kind, + "payload", + &&self.payload, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventSimple { +impl ::core::cmp::Eq for UsedEventWithNestedData { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventSimple {} +impl ::core::marker::StructuralPartialEq for UsedEventWithNestedData {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventSimple { +impl ::core::cmp::PartialEq for UsedEventWithNestedData { #[inline] - fn eq(&self, other: &UsedEventSimple) -> bool { - self.amount == other.amount && self.kind == other.kind + fn eq(&self, other: &UsedEventWithNestedData) -> bool { + self.kind == other.kind && self.payload == other.payload } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_EVENT_USEDEVENTSIMPLE: [u8; 112usize] = UsedEventSimple::spec_xdr(); -impl UsedEventSimple { - pub const fn spec_xdr() -> [u8; 112usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x0fUsedEventSimple\0\0\0\0\x01\0\0\0\x11used_event_simple\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" +pub static __SPEC_XDR_EVENT_USEDEVENTWITHNESTEDDATA: [u8; 152usize] = + UsedEventWithNestedData::spec_xdr(); +impl UsedEventWithNestedData { + pub const fn spec_xdr() -> [u8; 152usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x17UsedEventWithNestedData\0\0\0\0\x01\0\0\0\x1bused_event_with_nested_data\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x12UsedEventDataOuter\0\0\0\0\0\0\0\0\0\x02" } } -impl soroban_sdk::Event for UsedEventSimple { +impl soroban_sdk::Event for UsedEventWithNestedData { fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { use soroban_sdk::IntoVal; - (&{ soroban_sdk::Symbol::new(env, "used_event_simple") }, { - let v: soroban_sdk::Val = self.kind.into_val(env); - v - }) + ( + &{ soroban_sdk::Symbol::new(env, "used_event_with_nested_data") }, + { + let v: soroban_sdk::Val = self.kind.into_val(env); + v + }, + ) .into_val(env) } fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["amount"]; - let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; + const KEYS: [&'static str; 1usize] = ["payload"]; + let vals: [soroban_sdk::Val; 1usize] = [self.payload.into_val(env)]; env.map_new_from_slices(&KEYS, &vals) .unwrap_infallible() .into() } } -impl UsedEventSimple { +impl UsedEventWithNestedData { pub fn publish(&self, env: &soroban_sdk::Env) { <_ as soroban_sdk::Event>::publish(self, env); } } -pub enum UsedEventTopicType { - Transfer = 1, - Mint = 2, +pub enum UsedRefTopicType { + Send = 1, + Recv = 2, } #[automatically_derived] -impl ::core::marker::Copy for UsedEventTopicType {} +impl ::core::marker::Copy for UsedRefTopicType {} #[automatically_derived] -impl ::core::clone::Clone for UsedEventTopicType { +impl ::core::clone::Clone for UsedRefTopicType { #[inline] - fn clone(&self) -> UsedEventTopicType { + fn clone(&self) -> UsedRefTopicType { *self } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventTopicType { +impl ::core::fmt::Debug for UsedRefTopicType { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::write_str( f, match self { - UsedEventTopicType::Transfer => "Transfer", - UsedEventTopicType::Mint => "Mint", + UsedRefTopicType::Send => "Send", + UsedRefTopicType::Recv => "Recv", }, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventTopicType { +impl ::core::cmp::Eq for UsedRefTopicType { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () {} } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventTopicType {} +impl ::core::marker::StructuralPartialEq for UsedRefTopicType {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventTopicType { +impl ::core::cmp::PartialEq for UsedRefTopicType { #[inline] - fn eq(&self, other: &UsedEventTopicType) -> bool { + fn eq(&self, other: &UsedRefTopicType) -> bool { let __self_discr = ::core::intrinsics::discriminant_value(self); let __arg1_discr = ::core::intrinsics::discriminant_value(other); __self_discr == __arg1_discr } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDEVENTTOPICTYPE: [u8; 76usize] = UsedEventTopicType::spec_xdr(); -impl UsedEventTopicType { - pub const fn spec_xdr() -> [u8; 76usize] { - *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventTopicType\0\0\0\0\0\x02\0\0\0\0\0\0\0\x08Transfer\0\0\0\x01\0\0\0\0\0\0\0\x04Mint\0\0\0\x02" +pub static __SPEC_XDR_TYPE_USEDREFTOPICTYPE: [u8; 68usize] = UsedRefTopicType::spec_xdr(); +impl UsedRefTopicType { + pub const fn spec_xdr() -> [u8; 68usize] { + *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x10UsedRefTopicType\0\0\0\x02\0\0\0\0\0\0\0\x04Send\0\0\0\x01\0\0\0\0\0\0\0\x04Recv\0\0\0\x02" } } -impl soroban_sdk::TryFromVal for UsedEventTopicType { +impl soroban_sdk::TryFromVal for UsedRefTopicType { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( @@ -1496,148 +2982,151 @@ impl soroban_sdk::TryFromVal for UsedEventTo use soroban_sdk::TryIntoVal; let discriminant: u32 = val.try_into_val(env)?; Ok(match discriminant { - 1u32 => Self::Transfer, - 2u32 => Self::Mint, + 1u32 => Self::Send, + 2u32 => Self::Recv, _ => Err(soroban_sdk::ConversionError {})?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventTopicType, + val: &UsedRefTopicType, ) -> Result { Ok(match val { - UsedEventTopicType::Transfer => 1u32.into(), - UsedEventTopicType::Mint => 2u32.into(), + UsedRefTopicType::Send => 1u32.into(), + UsedRefTopicType::Recv => 2u32.into(), }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventTopicType, + val: &&UsedRefTopicType, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub struct UsedEventWithTopicType { - pub kind: UsedEventTopicType, - pub amount: i128, +pub struct UsedRefDataType { + pub nested: UsedRefDataInner, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventWithTopicType { +impl ::core::clone::Clone for UsedRefDataType { #[inline] - fn clone(&self) -> UsedEventWithTopicType { - UsedEventWithTopicType { - kind: ::core::clone::Clone::clone(&self.kind), - amount: ::core::clone::Clone::clone(&self.amount), + fn clone(&self) -> UsedRefDataType { + UsedRefDataType { + nested: ::core::clone::Clone::clone(&self.nested), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventWithTopicType { +impl ::core::fmt::Debug for UsedRefDataType { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( + ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedEventWithTopicType", - "kind", - &self.kind, - "amount", - &&self.amount, + "UsedRefDataType", + "nested", + &&self.nested, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventWithTopicType { +impl ::core::cmp::Eq for UsedRefDataType { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventWithTopicType {} +impl ::core::marker::StructuralPartialEq for UsedRefDataType {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventWithTopicType { +impl ::core::cmp::PartialEq for UsedRefDataType { #[inline] - fn eq(&self, other: &UsedEventWithTopicType) -> bool { - self.amount == other.amount && self.kind == other.kind + fn eq(&self, other: &UsedRefDataType) -> bool { + self.nested == other.nested } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_EVENT_USEDEVENTWITHTOPICTYPE: [u8; 152usize] = - UsedEventWithTopicType::spec_xdr(); -impl UsedEventWithTopicType { - pub const fn spec_xdr() -> [u8; 152usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x16UsedEventWithTopicType\0\0\0\0\0\x01\0\0\0\x1aused_event_with_topic_type\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\x07\xd0\0\0\0\x12UsedEventTopicType\0\0\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" +pub static __SPEC_XDR_TYPE_USEDREFDATATYPE: [u8; 76usize] = UsedRefDataType::spec_xdr(); +impl UsedRefDataType { + pub const fn spec_xdr() -> [u8; 76usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fUsedRefDataType\0\0\0\0\x01\0\0\0\0\0\0\0\x06nested\0\0\0\0\x07\xd0\0\0\0\x10UsedRefDataInner" } } -impl soroban_sdk::Event for UsedEventWithTopicType { - fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { - use soroban_sdk::IntoVal; - ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_topic_type") }, - { - let v: soroban_sdk::Val = self.kind.into_val(env); - v - }, - ) - .into_val(env) +impl soroban_sdk::TryFromVal for UsedRefDataType { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["nested"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + nested: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) } - fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { - use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["amount"]; - let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; - env.map_new_from_slices(&KEYS, &vals) - .unwrap_infallible() - .into() +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedRefDataType, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["nested"]; + let vals: [Val; 1usize] = [(&val.nested) + .try_into_val(env) + .map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) } } -impl UsedEventWithTopicType { - pub fn publish(&self, env: &soroban_sdk::Env) { - <_ as soroban_sdk::Event>::publish(self, env); +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedRefDataType, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub struct UsedEventDataType { - pub x: u32, - pub y: u32, +pub struct UsedRefDataInner { + pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventDataType { +impl ::core::clone::Clone for UsedRefDataInner { #[inline] - fn clone(&self) -> UsedEventDataType { - UsedEventDataType { - x: ::core::clone::Clone::clone(&self.x), - y: ::core::clone::Clone::clone(&self.y), + fn clone(&self) -> UsedRefDataInner { + UsedRefDataInner { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventDataType { +impl ::core::fmt::Debug for UsedRefDataInner { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( - f, - "UsedEventDataType", - "x", - &self.x, - "y", - &&self.y, - ) + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedRefDataInner", "val", &&self.val) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventDataType { +impl ::core::cmp::Eq for UsedRefDataInner { #[inline] #[doc(hidden)] #[coverage(off)] @@ -1646,92 +3135,86 @@ impl ::core::cmp::Eq for UsedEventDataType { } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventDataType {} +impl ::core::marker::StructuralPartialEq for UsedRefDataInner {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventDataType { +impl ::core::cmp::PartialEq for UsedRefDataInner { #[inline] - fn eq(&self, other: &UsedEventDataType) -> bool { - self.x == other.x && self.y == other.y + fn eq(&self, other: &UsedRefDataInner) -> bool { + self.val == other.val } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDEVENTDATATYPE: [u8; 72usize] = UsedEventDataType::spec_xdr(); -impl UsedEventDataType { - pub const fn spec_xdr() -> [u8; 72usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedEventDataType\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x04\0\0\0\0\0\0\0\x01y\0\0\0\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDREFDATAINNER: [u8; 52usize] = UsedRefDataInner::spec_xdr(); +impl UsedRefDataInner { + pub const fn spec_xdr() -> [u8; 52usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedRefDataInner\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::TryFromVal for UsedEventDataType { +impl soroban_sdk::TryFromVal for UsedRefDataInner { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 2usize] = ["x", "y"]; - let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - x: vals[0] - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?, - y: vals[1] + val: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventDataType, + val: &UsedRefDataInner, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 2usize] = ["x", "y"]; - let vals: [Val; 2usize] = [ - (&val.x).try_into_val(env).map_err(|_| ConversionError)?, - (&val.y).try_into_val(env).map_err(|_| ConversionError)?, - ]; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventDataType, + val: &&UsedRefDataInner, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub struct UsedEventWithDataType { - pub kind: Symbol, - pub payload: UsedEventDataType, +pub struct UsedEventWithRefs<'a> { + pub kind: &'a UsedRefTopicType, + pub payload: &'a UsedRefDataType, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventWithDataType { +impl<'a> ::core::clone::Clone for UsedEventWithRefs<'a> { #[inline] - fn clone(&self) -> UsedEventWithDataType { - UsedEventWithDataType { + fn clone(&self) -> UsedEventWithRefs<'a> { + UsedEventWithRefs { kind: ::core::clone::Clone::clone(&self.kind), payload: ::core::clone::Clone::clone(&self.payload), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventWithDataType { +impl<'a> ::core::fmt::Debug for UsedEventWithRefs<'a> { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field2_finish( f, - "UsedEventWithDataType", + "UsedEventWithRefs", "kind", &self.kind, "payload", @@ -1740,37 +3223,36 @@ impl ::core::fmt::Debug for UsedEventWithDataType { } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventWithDataType { +impl<'a> ::core::cmp::Eq for UsedEventWithRefs<'a> { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq<&'a UsedRefTopicType>; + let _: ::core::cmp::AssertParamIsEq<&'a UsedRefDataType>; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventWithDataType {} +impl<'a> ::core::marker::StructuralPartialEq for UsedEventWithRefs<'a> {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventWithDataType { +impl<'a> ::core::cmp::PartialEq for UsedEventWithRefs<'a> { #[inline] - fn eq(&self, other: &UsedEventWithDataType) -> bool { + fn eq(&self, other: &UsedEventWithRefs<'a>) -> bool { self.kind == other.kind && self.payload == other.payload } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_EVENT_USEDEVENTWITHDATATYPE: [u8; 152usize] = - UsedEventWithDataType::spec_xdr(); -impl UsedEventWithDataType { - pub const fn spec_xdr() -> [u8; 152usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x15UsedEventWithDataType\0\0\0\0\0\0\x01\0\0\0\x19used_event_with_data_type\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x11UsedEventDataType\0\0\0\0\0\0\0\0\0\0\x02" +pub static __SPEC_XDR_EVENT_USEDEVENTWITHREFS: [u8; 156usize] = UsedEventWithRefs::spec_xdr(); +impl<'a> UsedEventWithRefs<'a> { + pub const fn spec_xdr() -> [u8; 156usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x11UsedEventWithRefs\0\0\0\0\0\0\x01\0\0\0\x14used_event_with_refs\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\x07\xd0\0\0\0\x10UsedRefTopicType\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x0fUsedRefDataType\0\0\0\0\0\0\0\0\x02" } } -impl soroban_sdk::Event for UsedEventWithDataType { +impl<'a> soroban_sdk::Event for UsedEventWithRefs<'a> { fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { use soroban_sdk::IntoVal; ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_data_type") }, + &{ soroban_sdk::Symbol::new(env, "used_event_with_refs") }, { let v: soroban_sdk::Val = self.kind.into_val(env); v @@ -1787,134 +3269,32 @@ impl soroban_sdk::Event for UsedEventWithDataType { .into() } } -impl UsedEventWithDataType { +impl<'a> UsedEventWithRefs<'a> { pub fn publish(&self, env: &soroban_sdk::Env) { <_ as soroban_sdk::Event>::publish(self, env); } } -pub struct UsedEventTopicOuter { - pub inner: UsedEventTopicInner, -} -#[automatically_derived] -impl ::core::clone::Clone for UsedEventTopicOuter { - #[inline] - fn clone(&self) -> UsedEventTopicOuter { - UsedEventTopicOuter { - inner: ::core::clone::Clone::clone(&self.inner), - } - } -} -#[automatically_derived] -impl ::core::fmt::Debug for UsedEventTopicOuter { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( - f, - "UsedEventTopicOuter", - "inner", - &&self.inner, - ) - } -} -#[automatically_derived] -impl ::core::cmp::Eq for UsedEventTopicOuter { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - } -} -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventTopicOuter {} -#[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventTopicOuter { - #[inline] - fn eq(&self, other: &UsedEventTopicOuter) -> bool { - self.inner == other.inner - } -} -#[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDEVENTTOPICOUTER: [u8; 84usize] = UsedEventTopicOuter::spec_xdr(); -impl UsedEventTopicOuter { - pub const fn spec_xdr() -> [u8; 84usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedEventTopicOuter\0\0\0\0\x01\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x13UsedEventTopicInner\0" - } -} -impl soroban_sdk::TryFromVal for UsedEventTopicOuter { - type Error = soroban_sdk::ConversionError; - fn try_from_val( - env: &soroban_sdk::Env, - val: &soroban_sdk::Val, - ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["inner"]; - let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; - let map: MapObject = val.try_into().map_err(|_| ConversionError)?; - env.map_unpack_to_slice(map, &KEYS, &mut vals) - .map_err(|_| ConversionError)?; - Ok(Self { - inner: vals[0] - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?, - }) - } -} -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; - fn try_from_val( - env: &soroban_sdk::Env, - val: &UsedEventTopicOuter, - ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["inner"]; - let vals: [Val; 1usize] = [(&val.inner) - .try_into_val(env) - .map_err(|_| ConversionError)?]; - Ok(env - .map_new_from_slices(&KEYS, &vals) - .map_err(|_| ConversionError)? - .into()) - } -} -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &&UsedEventTopicOuter, - ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) - } -} -pub struct UsedEventTopicInner { +pub struct UsedTupleElement { pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventTopicInner { +impl ::core::clone::Clone for UsedTupleElement { #[inline] - fn clone(&self) -> UsedEventTopicInner { - UsedEventTopicInner { + fn clone(&self) -> UsedTupleElement { + UsedTupleElement { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventTopicInner { +impl ::core::fmt::Debug for UsedTupleElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( - f, - "UsedEventTopicInner", - "val", - &&self.val, - ) + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedTupleElement", "val", &&self.val) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventTopicInner { +impl ::core::cmp::Eq for UsedTupleElement { #[inline] #[doc(hidden)] #[coverage(off)] @@ -1923,22 +3303,22 @@ impl ::core::cmp::Eq for UsedEventTopicInner { } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventTopicInner {} +impl ::core::marker::StructuralPartialEq for UsedTupleElement {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventTopicInner { +impl ::core::cmp::PartialEq for UsedTupleElement { #[inline] - fn eq(&self, other: &UsedEventTopicInner) -> bool { + fn eq(&self, other: &UsedTupleElement) -> bool { self.val == other.val } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDEVENTTOPICINNER: [u8; 56usize] = UsedEventTopicInner::spec_xdr(); -impl UsedEventTopicInner { - pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedEventTopicInner\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDTUPLEELEMENT: [u8; 52usize] = UsedTupleElement::spec_xdr(); +impl UsedTupleElement { + pub const fn spec_xdr() -> [u8; 52usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedTupleElement\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::TryFromVal for UsedEventTopicInner { +impl soroban_sdk::TryFromVal for UsedTupleElement { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -1957,11 +3337,11 @@ impl soroban_sdk::TryFromVal for UsedEventTo }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventTopicInner, + val: &UsedTupleElement, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["val"]; @@ -1972,222 +3352,138 @@ impl soroban_sdk::TryFromVal for soroban_ .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventTopicInner, + val: &&UsedTupleElement, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) - } -} -pub struct UsedEventWithNestedTopic { - pub info: UsedEventTopicOuter, - pub amount: i128, -} -#[automatically_derived] -impl ::core::clone::Clone for UsedEventWithNestedTopic { - #[inline] - fn clone(&self) -> UsedEventWithNestedTopic { - UsedEventWithNestedTopic { - info: ::core::clone::Clone::clone(&self.info), - amount: ::core::clone::Clone::clone(&self.amount), - } - } -} -#[automatically_derived] -impl ::core::fmt::Debug for UsedEventWithNestedTopic { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( - f, - "UsedEventWithNestedTopic", - "info", - &self.info, - "amount", - &&self.amount, - ) - } -} -#[automatically_derived] -impl ::core::cmp::Eq for UsedEventWithNestedTopic { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; - } -} -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventWithNestedTopic {} -#[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventWithNestedTopic { - #[inline] - fn eq(&self, other: &UsedEventWithNestedTopic) -> bool { - self.amount == other.amount && self.info == other.info - } -} -#[link_section = "contractspecv0"] -pub static __SPEC_XDR_EVENT_USEDEVENTWITHNESTEDTOPIC: [u8; 152usize] = - UsedEventWithNestedTopic::spec_xdr(); -impl UsedEventWithNestedTopic { - pub const fn spec_xdr() -> [u8; 152usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x18UsedEventWithNestedTopic\0\0\0\x01\0\0\0\x1cused_event_with_nested_topic\0\0\0\x02\0\0\0\0\0\0\0\x04info\0\0\x07\xd0\0\0\0\x13UsedEventTopicOuter\0\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" - } -} -impl soroban_sdk::Event for UsedEventWithNestedTopic { - fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { - use soroban_sdk::IntoVal; - ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_nested_topic") }, - { - let v: soroban_sdk::Val = self.info.into_val(env); - v - }, - ) - .into_val(env) - } - fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { - use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["amount"]; - let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; - env.map_new_from_slices(&KEYS, &vals) - .unwrap_infallible() - .into() - } -} -impl UsedEventWithNestedTopic { - pub fn publish(&self, env: &soroban_sdk::Env) { - <_ as soroban_sdk::Event>::publish(self, env); + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub struct UsedEventDataOuter { - pub inner: UsedEventDataInner, +pub struct UsedTupleReturnElement { + pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventDataOuter { +impl ::core::clone::Clone for UsedTupleReturnElement { #[inline] - fn clone(&self) -> UsedEventDataOuter { - UsedEventDataOuter { - inner: ::core::clone::Clone::clone(&self.inner), + fn clone(&self) -> UsedTupleReturnElement { + UsedTupleReturnElement { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventDataOuter { +impl ::core::fmt::Debug for UsedTupleReturnElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedEventDataOuter", - "inner", - &&self.inner, + "UsedTupleReturnElement", + "val", + &&self.val, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventDataOuter { +impl ::core::cmp::Eq for UsedTupleReturnElement { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventDataOuter {} +impl ::core::marker::StructuralPartialEq for UsedTupleReturnElement {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventDataOuter { +impl ::core::cmp::PartialEq for UsedTupleReturnElement { #[inline] - fn eq(&self, other: &UsedEventDataOuter) -> bool { - self.inner == other.inner + fn eq(&self, other: &UsedTupleReturnElement) -> bool { + self.val == other.val } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDEVENTDATAOUTER: [u8; 84usize] = UsedEventDataOuter::spec_xdr(); -impl UsedEventDataOuter { - pub const fn spec_xdr() -> [u8; 84usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventDataOuter\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x12UsedEventDataInner\0\0" +pub static __SPEC_XDR_TYPE_USEDTUPLERETURNELEMENT: [u8; 60usize] = + UsedTupleReturnElement::spec_xdr(); +impl UsedTupleReturnElement { + pub const fn spec_xdr() -> [u8; 60usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x16UsedTupleReturnElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::TryFromVal for UsedEventDataOuter { +impl soroban_sdk::TryFromVal for UsedTupleReturnElement { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["inner"]; + const KEYS: [&'static str; 1usize] = ["val"]; let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - inner: vals[0] + val: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventDataOuter, + val: &UsedTupleReturnElement, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["inner"]; - let vals: [Val; 1usize] = [(&val.inner) - .try_into_val(env) - .map_err(|_| ConversionError)?]; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventDataOuter, + val: &&UsedTupleReturnElement, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( + <_ as soroban_sdk::TryFromVal>::try_from_val( env, *val, ) } } -pub struct UsedEventDataInner { +pub struct UsedVecInnerVecElement { pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventDataInner { +impl ::core::clone::Clone for UsedVecInnerVecElement { #[inline] - fn clone(&self) -> UsedEventDataInner { - UsedEventDataInner { + fn clone(&self) -> UsedVecInnerVecElement { + UsedVecInnerVecElement { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventDataInner { +impl ::core::fmt::Debug for UsedVecInnerVecElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedEventDataInner", + "UsedVecInnerVecElement", "val", &&self.val, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventDataInner { +impl ::core::cmp::Eq for UsedVecInnerVecElement { #[inline] #[doc(hidden)] #[coverage(off)] @@ -2196,22 +3492,23 @@ impl ::core::cmp::Eq for UsedEventDataInner { } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventDataInner {} +impl ::core::marker::StructuralPartialEq for UsedVecInnerVecElement {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventDataInner { +impl ::core::cmp::PartialEq for UsedVecInnerVecElement { #[inline] - fn eq(&self, other: &UsedEventDataInner) -> bool { + fn eq(&self, other: &UsedVecInnerVecElement) -> bool { self.val == other.val } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDEVENTDATAINNER: [u8; 56usize] = UsedEventDataInner::spec_xdr(); -impl UsedEventDataInner { - pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventDataInner\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDVECINNERVECELEMENT: [u8; 60usize] = + UsedVecInnerVecElement::spec_xdr(); +impl UsedVecInnerVecElement { + pub const fn spec_xdr() -> [u8; 60usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x16UsedVecInnerVecElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::TryFromVal for UsedEventDataInner { +impl soroban_sdk::TryFromVal for UsedVecInnerVecElement { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -2230,11 +3527,11 @@ impl soroban_sdk::TryFromVal for UsedEventDa }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventDataInner, + val: &UsedVecInnerVecElement, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["val"]; @@ -2245,497 +3542,501 @@ impl soroban_sdk::TryFromVal for soroban_s .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventDataInner, + val: &&UsedVecInnerVecElement, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( + <_ as soroban_sdk::TryFromVal>::try_from_val( env, *val, ) } } -pub struct UsedEventWithNestedData { - pub kind: Symbol, - pub payload: UsedEventDataOuter, +pub struct UsedVecInnerElement { + pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventWithNestedData { +impl ::core::clone::Clone for UsedVecInnerElement { #[inline] - fn clone(&self) -> UsedEventWithNestedData { - UsedEventWithNestedData { - kind: ::core::clone::Clone::clone(&self.kind), - payload: ::core::clone::Clone::clone(&self.payload), + fn clone(&self) -> UsedVecInnerElement { + UsedVecInnerElement { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventWithNestedData { +impl ::core::fmt::Debug for UsedVecInnerElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( + ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedEventWithNestedData", - "kind", - &self.kind, - "payload", - &&self.payload, + "UsedVecInnerElement", + "val", + &&self.val, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventWithNestedData { +impl ::core::cmp::Eq for UsedVecInnerElement { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventWithNestedData {} +impl ::core::marker::StructuralPartialEq for UsedVecInnerElement {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventWithNestedData { +impl ::core::cmp::PartialEq for UsedVecInnerElement { #[inline] - fn eq(&self, other: &UsedEventWithNestedData) -> bool { - self.kind == other.kind && self.payload == other.payload + fn eq(&self, other: &UsedVecInnerElement) -> bool { + self.val == other.val } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_EVENT_USEDEVENTWITHNESTEDDATA: [u8; 152usize] = - UsedEventWithNestedData::spec_xdr(); -impl UsedEventWithNestedData { - pub const fn spec_xdr() -> [u8; 152usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x17UsedEventWithNestedData\0\0\0\0\x01\0\0\0\x1bused_event_with_nested_data\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x12UsedEventDataOuter\0\0\0\0\0\0\0\0\0\x02" +pub static __SPEC_XDR_TYPE_USEDVECINNERELEMENT: [u8; 56usize] = UsedVecInnerElement::spec_xdr(); +impl UsedVecInnerElement { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedVecInnerElement\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::Event for UsedEventWithNestedData { - fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { - use soroban_sdk::IntoVal; - ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_nested_data") }, - { - let v: soroban_sdk::Val = self.kind.into_val(env); - v - }, - ) - .into_val(env) +impl soroban_sdk::TryFromVal for UsedVecInnerElement { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) } - fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { - use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["payload"]; - let vals: [soroban_sdk::Val; 1usize] = [self.payload.into_val(env)]; - env.map_new_from_slices(&KEYS, &vals) - .unwrap_infallible() - .into() +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedVecInnerElement, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) } } -impl UsedEventWithNestedData { - pub fn publish(&self, env: &soroban_sdk::Env) { - <_ as soroban_sdk::Event>::publish(self, env); +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedVecInnerElement, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) } } -pub enum UsedRefTopicType { - Send = 1, - Recv = 2, +pub struct UsedVecElementNested { + pub val: u32, + pub inner: UsedVecInnerElement, + pub vec_inner: Vec, } #[automatically_derived] -impl ::core::marker::Copy for UsedRefTopicType {} -#[automatically_derived] -impl ::core::clone::Clone for UsedRefTopicType { +impl ::core::clone::Clone for UsedVecElementNested { #[inline] - fn clone(&self) -> UsedRefTopicType { - *self + fn clone(&self) -> UsedVecElementNested { + UsedVecElementNested { + val: ::core::clone::Clone::clone(&self.val), + inner: ::core::clone::Clone::clone(&self.inner), + vec_inner: ::core::clone::Clone::clone(&self.vec_inner), + } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedRefTopicType { +impl ::core::fmt::Debug for UsedVecElementNested { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( + ::core::fmt::Formatter::debug_struct_field3_finish( f, - match self { - UsedRefTopicType::Send => "Send", - UsedRefTopicType::Recv => "Recv", - }, + "UsedVecElementNested", + "val", + &self.val, + "inner", + &self.inner, + "vec_inner", + &&self.vec_inner, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedRefTopicType { +impl ::core::cmp::Eq for UsedVecElementNested { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedRefTopicType {} +impl ::core::marker::StructuralPartialEq for UsedVecElementNested {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedRefTopicType { +impl ::core::cmp::PartialEq for UsedVecElementNested { #[inline] - fn eq(&self, other: &UsedRefTopicType) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr + fn eq(&self, other: &UsedVecElementNested) -> bool { + self.val == other.val && self.inner == other.inner && self.vec_inner == other.vec_inner } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDREFTOPICTYPE: [u8; 68usize] = UsedRefTopicType::spec_xdr(); -impl UsedRefTopicType { - pub const fn spec_xdr() -> [u8; 68usize] { - *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x10UsedRefTopicType\0\0\0\x02\0\0\0\0\0\0\0\x04Send\0\0\0\x01\0\0\0\0\0\0\0\x04Recv\0\0\0\x02" +pub static __SPEC_XDR_TYPE_USEDVECELEMENTNESTED: [u8; 156usize] = UsedVecElementNested::spec_xdr(); +impl UsedVecElementNested { + pub const fn spec_xdr() -> [u8; 156usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x14UsedVecElementNested\0\0\0\x03\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x13UsedVecInnerElement\0\0\0\0\0\0\0\0\x03val\0\0\0\0\x04\0\0\0\0\0\0\0\tvec_inner\0\0\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x16UsedVecInnerVecElement\0\0" } } -impl soroban_sdk::TryFromVal for UsedRefTopicType { +impl soroban_sdk::TryFromVal for UsedVecElementNested { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::TryIntoVal; - let discriminant: u32 = val.try_into_val(env)?; - Ok(match discriminant { - 1u32 => Self::Send, - 2u32 => Self::Recv, - _ => Err(soroban_sdk::ConversionError {})?, + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["inner", "val", "vec_inner"]; + let mut vals: [Val; 3usize] = [Val::VOID.to_val(); 3usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + inner: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + val: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + vec_inner: vals[2] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedRefTopicType, + val: &UsedVecElementNested, ) -> Result { - Ok(match val { - UsedRefTopicType::Send => 1u32.into(), - UsedRefTopicType::Recv => 2u32.into(), - }) + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["inner", "val", "vec_inner"]; + let vals: [Val; 3usize] = [ + (&val.inner) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.val).try_into_val(env).map_err(|_| ConversionError)?, + (&val.vec_inner) + .try_into_val(env) + .map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedRefTopicType, + val: &&UsedVecElementNested, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) } } -pub struct UsedRefDataType { - pub nested: UsedRefDataInner, +struct UsedNonPubStruct { + pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedRefDataType { +impl ::core::clone::Clone for UsedNonPubStruct { #[inline] - fn clone(&self) -> UsedRefDataType { - UsedRefDataType { - nested: ::core::clone::Clone::clone(&self.nested), + fn clone(&self) -> UsedNonPubStruct { + UsedNonPubStruct { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedRefDataType { +impl ::core::fmt::Debug for UsedNonPubStruct { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( - f, - "UsedRefDataType", - "nested", - &&self.nested, - ) + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedNonPubStruct", "val", &&self.val) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedRefDataType { +impl ::core::cmp::Eq for UsedNonPubStruct { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedRefDataType {} +impl ::core::marker::StructuralPartialEq for UsedNonPubStruct {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedRefDataType { +impl ::core::cmp::PartialEq for UsedNonPubStruct { #[inline] - fn eq(&self, other: &UsedRefDataType) -> bool { - self.nested == other.nested - } -} -#[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDREFDATATYPE: [u8; 76usize] = UsedRefDataType::spec_xdr(); -impl UsedRefDataType { - pub const fn spec_xdr() -> [u8; 76usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fUsedRefDataType\0\0\0\0\x01\0\0\0\0\0\0\0\x06nested\0\0\0\0\x07\xd0\0\0\0\x10UsedRefDataInner" + fn eq(&self, other: &UsedNonPubStruct) -> bool { + self.val == other.val } } -impl soroban_sdk::TryFromVal for UsedRefDataType { +impl soroban_sdk::TryFromVal for UsedNonPubStruct { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["nested"]; + const KEYS: [&'static str; 1usize] = ["val"]; let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - nested: vals[0] + val: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedRefDataType, + val: &UsedNonPubStruct, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["nested"]; - let vals: [Val; 1usize] = [(&val.nested) - .try_into_val(env) - .map_err(|_| ConversionError)?]; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedRefDataType, + val: &&UsedNonPubStruct, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub struct UsedRefDataInner { - pub val: u32, +enum UsedNonPubError { + Fail = 1, } #[automatically_derived] -impl ::core::clone::Clone for UsedRefDataInner { +impl ::core::marker::Copy for UsedNonPubError {} +#[automatically_derived] +impl ::core::clone::Clone for UsedNonPubError { #[inline] - fn clone(&self) -> UsedRefDataInner { - UsedRefDataInner { - val: ::core::clone::Clone::clone(&self.val), - } + fn clone(&self) -> UsedNonPubError { + *self } } #[automatically_derived] -impl ::core::fmt::Debug for UsedRefDataInner { +impl ::core::fmt::Debug for UsedNonPubError { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedRefDataInner", "val", &&self.val) + ::core::fmt::Formatter::write_str(f, "Fail") } } #[automatically_derived] -impl ::core::cmp::Eq for UsedRefDataInner { +impl ::core::cmp::Eq for UsedNonPubError { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - } + fn assert_receiver_is_total_eq(&self) -> () {} } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedRefDataInner {} +impl ::core::marker::StructuralPartialEq for UsedNonPubError {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedRefDataInner { +impl ::core::cmp::PartialEq for UsedNonPubError { #[inline] - fn eq(&self, other: &UsedRefDataInner) -> bool { - self.val == other.val + fn eq(&self, other: &UsedNonPubError) -> bool { + true + } +} +impl TryFrom for UsedNonPubError { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: soroban_sdk::Error) -> Result { + if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { + let discriminant = error.get_code(); + Ok(match discriminant { + 1u32 => Self::Fail, + _ => return Err(error), + }) + } else { + Err(error) + } + } +} +impl TryFrom<&soroban_sdk::Error> for UsedNonPubError { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: &soroban_sdk::Error) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::Error { + #[inline(always)] + fn from(val: UsedNonPubError) -> soroban_sdk::Error { + <_ as From<&UsedNonPubError>>::from(&val) + } +} +impl From<&UsedNonPubError> for soroban_sdk::Error { + #[inline(always)] + fn from(val: &UsedNonPubError) -> soroban_sdk::Error { + match val { + UsedNonPubError::Fail => soroban_sdk::Error::from_contract_error(1u32), + } + } +} +impl TryFrom for UsedNonPubError { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: soroban_sdk::InvokeError) -> Result { + match error { + soroban_sdk::InvokeError::Abort => Err(error), + soroban_sdk::InvokeError::Contract(code) => Ok(match code { + 1u32 => Self::Fail, + _ => return Err(error), + }), + } + } +} +impl TryFrom<&soroban_sdk::InvokeError> for UsedNonPubError { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: &soroban_sdk::InvokeError) -> Result { + <_ as TryFrom>::try_from(*error) } } -#[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDREFDATAINNER: [u8; 52usize] = UsedRefDataInner::spec_xdr(); -impl UsedRefDataInner { - pub const fn spec_xdr() -> [u8; 52usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedRefDataInner\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" +impl From for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: UsedNonPubError) -> soroban_sdk::InvokeError { + <_ as From<&UsedNonPubError>>::from(&val) } } -impl soroban_sdk::TryFromVal for UsedRefDataInner { +impl From<&UsedNonPubError> for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: &UsedNonPubError) -> soroban_sdk::InvokeError { + match val { + UsedNonPubError::Fail => soroban_sdk::InvokeError::Contract(1u32), + } + } +} +impl soroban_sdk::TryFromVal for UsedNonPubError { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; - let map: MapObject = val.try_into().map_err(|_| ConversionError)?; - env.map_unpack_to_slice(map, &KEYS, &mut vals) - .map_err(|_| ConversionError)?; - Ok(Self { - val: vals[0] - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?, - }) + use soroban_sdk::TryIntoVal; + let error: soroban_sdk::Error = val.try_into_val(env)?; + error.try_into().map_err(|_| soroban_sdk::ConversionError) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedRefDataInner, + val: &UsedNonPubError, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; - Ok(env - .map_new_from_slices(&KEYS, &vals) - .map_err(|_| ConversionError)? - .into()) + let error: soroban_sdk::Error = val.into(); + Ok(error.into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedRefDataInner, + val: &&UsedNonPubError, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub struct UsedEventWithRefs<'a> { - pub kind: &'a UsedRefTopicType, - pub payload: &'a UsedRefDataType, +pub struct UsedRecursiveRoot { + pub val: UsedRecursiveNode, } #[automatically_derived] -impl<'a> ::core::clone::Clone for UsedEventWithRefs<'a> { +impl ::core::clone::Clone for UsedRecursiveRoot { #[inline] - fn clone(&self) -> UsedEventWithRefs<'a> { - UsedEventWithRefs { - kind: ::core::clone::Clone::clone(&self.kind), - payload: ::core::clone::Clone::clone(&self.payload), + fn clone(&self) -> UsedRecursiveRoot { + UsedRecursiveRoot { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl<'a> ::core::fmt::Debug for UsedEventWithRefs<'a> { +impl ::core::fmt::Debug for UsedRecursiveRoot { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( + ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedEventWithRefs", - "kind", - &self.kind, - "payload", - &&self.payload, - ) - } -} -#[automatically_derived] -impl<'a> ::core::cmp::Eq for UsedEventWithRefs<'a> { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq<&'a UsedRefTopicType>; - let _: ::core::cmp::AssertParamIsEq<&'a UsedRefDataType>; - } -} -#[automatically_derived] -impl<'a> ::core::marker::StructuralPartialEq for UsedEventWithRefs<'a> {} -#[automatically_derived] -impl<'a> ::core::cmp::PartialEq for UsedEventWithRefs<'a> { - #[inline] - fn eq(&self, other: &UsedEventWithRefs<'a>) -> bool { - self.kind == other.kind && self.payload == other.payload - } -} -#[link_section = "contractspecv0"] -pub static __SPEC_XDR_EVENT_USEDEVENTWITHREFS: [u8; 156usize] = UsedEventWithRefs::spec_xdr(); -impl<'a> UsedEventWithRefs<'a> { - pub const fn spec_xdr() -> [u8; 156usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x11UsedEventWithRefs\0\0\0\0\0\0\x01\0\0\0\x14used_event_with_refs\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\x07\xd0\0\0\0\x10UsedRefTopicType\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x0fUsedRefDataType\0\0\0\0\0\0\0\0\x02" - } -} -impl<'a> soroban_sdk::Event for UsedEventWithRefs<'a> { - fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { - use soroban_sdk::IntoVal; - ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_refs") }, - { - let v: soroban_sdk::Val = self.kind.into_val(env); - v - }, + "UsedRecursiveRoot", + "val", + &&self.val, ) - .into_val(env) - } - fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { - use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["payload"]; - let vals: [soroban_sdk::Val; 1usize] = [self.payload.into_val(env)]; - env.map_new_from_slices(&KEYS, &vals) - .unwrap_infallible() - .into() - } -} -impl<'a> UsedEventWithRefs<'a> { - pub fn publish(&self, env: &soroban_sdk::Env) { - <_ as soroban_sdk::Event>::publish(self, env); - } -} -pub struct UsedTupleElement { - pub val: u32, -} -#[automatically_derived] -impl ::core::clone::Clone for UsedTupleElement { - #[inline] - fn clone(&self) -> UsedTupleElement { - UsedTupleElement { - val: ::core::clone::Clone::clone(&self.val), - } - } -} -#[automatically_derived] -impl ::core::fmt::Debug for UsedTupleElement { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedTupleElement", "val", &&self.val) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedTupleElement { +impl ::core::cmp::Eq for UsedRecursiveRoot { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedTupleElement {} +impl ::core::marker::StructuralPartialEq for UsedRecursiveRoot {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedTupleElement { +impl ::core::cmp::PartialEq for UsedRecursiveRoot { #[inline] - fn eq(&self, other: &UsedTupleElement) -> bool { + fn eq(&self, other: &UsedRecursiveRoot) -> bool { self.val == other.val } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDTUPLEELEMENT: [u8; 52usize] = UsedTupleElement::spec_xdr(); -impl UsedTupleElement { - pub const fn spec_xdr() -> [u8; 52usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedTupleElement\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDRECURSIVEROOT: [u8; 80usize] = UsedRecursiveRoot::spec_xdr(); +impl UsedRecursiveRoot { + pub const fn spec_xdr() -> [u8; 80usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedRecursiveRoot\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\x07\xd0\0\0\0\x11UsedRecursiveNode\0\0\0" } } -impl soroban_sdk::TryFromVal for UsedTupleElement { +impl soroban_sdk::TryFromVal for UsedRecursiveRoot { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -2754,11 +4055,11 @@ impl soroban_sdk::TryFromVal for UsedTupleEl }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedTupleElement, + val: &UsedRecursiveRoot, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["val"]; @@ -2769,150 +4070,217 @@ impl soroban_sdk::TryFromVal for soroban_sdk .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedTupleElement, + val: &&UsedRecursiveRoot, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub struct UsedTupleReturnElement { - pub val: u32, +pub enum UsedRecursiveNode { + NotRecursive(UsedLeaf), + Recursive(UsedRecursiveLeaf), } #[automatically_derived] -impl ::core::clone::Clone for UsedTupleReturnElement { +impl ::core::clone::Clone for UsedRecursiveNode { #[inline] - fn clone(&self) -> UsedTupleReturnElement { - UsedTupleReturnElement { - val: ::core::clone::Clone::clone(&self.val), + fn clone(&self) -> UsedRecursiveNode { + match self { + UsedRecursiveNode::NotRecursive(__self_0) => { + UsedRecursiveNode::NotRecursive(::core::clone::Clone::clone(__self_0)) + } + UsedRecursiveNode::Recursive(__self_0) => { + UsedRecursiveNode::Recursive(::core::clone::Clone::clone(__self_0)) + } } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedTupleReturnElement { +impl ::core::fmt::Debug for UsedRecursiveNode { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( - f, - "UsedTupleReturnElement", - "val", - &&self.val, - ) + match self { + UsedRecursiveNode::NotRecursive(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "NotRecursive", &__self_0) + } + UsedRecursiveNode::Recursive(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Recursive", &__self_0) + } + } } } #[automatically_derived] -impl ::core::cmp::Eq for UsedTupleReturnElement { +impl ::core::cmp::Eq for UsedRecursiveNode { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedTupleReturnElement {} +impl ::core::marker::StructuralPartialEq for UsedRecursiveNode {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedTupleReturnElement { +impl ::core::cmp::PartialEq for UsedRecursiveNode { #[inline] - fn eq(&self, other: &UsedTupleReturnElement) -> bool { - self.val == other.val + fn eq(&self, other: &UsedRecursiveNode) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + UsedRecursiveNode::NotRecursive(__self_0), + UsedRecursiveNode::NotRecursive(__arg1_0), + ) => __self_0 == __arg1_0, + ( + UsedRecursiveNode::Recursive(__self_0), + UsedRecursiveNode::Recursive(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDTUPLERETURNELEMENT: [u8; 60usize] = - UsedTupleReturnElement::spec_xdr(); -impl UsedTupleReturnElement { - pub const fn spec_xdr() -> [u8; 60usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x16UsedTupleReturnElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDRECURSIVENODE: [u8; 140usize] = UsedRecursiveNode::spec_xdr(); +impl UsedRecursiveNode { + pub const fn spec_xdr() -> [u8; 140usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x11UsedRecursiveNode\0\0\0\0\0\0\x02\0\0\0\x01\0\0\0\0\0\0\0\x0cNotRecursive\0\0\0\x01\0\0\x07\xd0\0\0\0\x08UsedLeaf\0\0\0\x01\0\0\0\0\0\0\0\tRecursive\0\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x11UsedRecursiveLeaf\0\0\0" } } -impl soroban_sdk::TryFromVal for UsedTupleReturnElement { +impl soroban_sdk::TryFromVal for UsedRecursiveNode { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; - let map: MapObject = val.try_into().map_err(|_| ConversionError)?; - env.map_unpack_to_slice(map, &KEYS, &mut vals) - .map_err(|_| ConversionError)?; - Ok(Self { - val: vals[0] - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?, - }) + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["NotRecursive", "Recursive"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::NotRecursive( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Recursive( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) } -} -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; - fn try_from_val( - env: &soroban_sdk::Env, - val: &UsedTupleReturnElement, - ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; - Ok(env - .map_new_from_slices(&KEYS, &vals) - .map_err(|_| ConversionError)? - .into()) +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedRecursiveNode, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + UsedRecursiveNode::NotRecursive(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"NotRecursive")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + UsedRecursiveNode::Recursive(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Recursive")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedTupleReturnElement, + val: &&UsedRecursiveNode, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -struct UsedNonPubStruct { - pub val: u32, +pub struct UsedRecursiveLeaf { + pub val: Vec, } #[automatically_derived] -impl ::core::clone::Clone for UsedNonPubStruct { +impl ::core::clone::Clone for UsedRecursiveLeaf { #[inline] - fn clone(&self) -> UsedNonPubStruct { - UsedNonPubStruct { + fn clone(&self) -> UsedRecursiveLeaf { + UsedRecursiveLeaf { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedNonPubStruct { +impl ::core::fmt::Debug for UsedRecursiveLeaf { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedNonPubStruct", "val", &&self.val) + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedRecursiveLeaf", + "val", + &&self.val, + ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedNonPubStruct { +impl ::core::cmp::Eq for UsedRecursiveLeaf { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedNonPubStruct {} +impl ::core::marker::StructuralPartialEq for UsedRecursiveLeaf {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedNonPubStruct { +impl ::core::cmp::PartialEq for UsedRecursiveLeaf { #[inline] - fn eq(&self, other: &UsedNonPubStruct) -> bool { + fn eq(&self, other: &UsedRecursiveLeaf) -> bool { self.val == other.val } } -impl soroban_sdk::TryFromVal for UsedNonPubStruct { +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDRECURSIVELEAF: [u8; 84usize] = UsedRecursiveLeaf::spec_xdr(); +impl UsedRecursiveLeaf { + pub const fn spec_xdr() -> [u8; 84usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedRecursiveLeaf\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x11UsedRecursiveRoot\0\0\0" + } +} +impl soroban_sdk::TryFromVal for UsedRecursiveLeaf { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -2931,11 +4299,11 @@ impl soroban_sdk::TryFromVal for UsedNonPubS }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedNonPubStruct, + val: &UsedRecursiveLeaf, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["val"]; @@ -2946,152 +4314,102 @@ impl soroban_sdk::TryFromVal for soroban_sdk .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedNonPubStruct, + val: &&UsedRecursiveLeaf, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -enum UsedNonPubError { - Fail = 1, +pub struct UsedLeaf { + pub val: u32, } #[automatically_derived] -impl ::core::marker::Copy for UsedNonPubError {} -#[automatically_derived] -impl ::core::clone::Clone for UsedNonPubError { +impl ::core::clone::Clone for UsedLeaf { #[inline] - fn clone(&self) -> UsedNonPubError { - *self + fn clone(&self) -> UsedLeaf { + UsedLeaf { + val: ::core::clone::Clone::clone(&self.val), + } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedNonPubError { +impl ::core::fmt::Debug for UsedLeaf { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str(f, "Fail") + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedLeaf", "val", &&self.val) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedNonPubError { +impl ::core::cmp::Eq for UsedLeaf { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedNonPubError {} +impl ::core::marker::StructuralPartialEq for UsedLeaf {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedNonPubError { +impl ::core::cmp::PartialEq for UsedLeaf { #[inline] - fn eq(&self, other: &UsedNonPubError) -> bool { - true - } -} -impl TryFrom for UsedNonPubError { - type Error = soroban_sdk::Error; - #[inline(always)] - fn try_from(error: soroban_sdk::Error) -> Result { - if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { - let discriminant = error.get_code(); - Ok(match discriminant { - 1u32 => Self::Fail, - _ => return Err(error), - }) - } else { - Err(error) - } - } -} -impl TryFrom<&soroban_sdk::Error> for UsedNonPubError { - type Error = soroban_sdk::Error; - #[inline(always)] - fn try_from(error: &soroban_sdk::Error) -> Result { - <_ as TryFrom>::try_from(*error) - } -} -impl From for soroban_sdk::Error { - #[inline(always)] - fn from(val: UsedNonPubError) -> soroban_sdk::Error { - <_ as From<&UsedNonPubError>>::from(&val) - } -} -impl From<&UsedNonPubError> for soroban_sdk::Error { - #[inline(always)] - fn from(val: &UsedNonPubError) -> soroban_sdk::Error { - match val { - UsedNonPubError::Fail => soroban_sdk::Error::from_contract_error(1u32), - } - } -} -impl TryFrom for UsedNonPubError { - type Error = soroban_sdk::InvokeError; - #[inline(always)] - fn try_from(error: soroban_sdk::InvokeError) -> Result { - match error { - soroban_sdk::InvokeError::Abort => Err(error), - soroban_sdk::InvokeError::Contract(code) => Ok(match code { - 1u32 => Self::Fail, - _ => return Err(error), - }), - } - } -} -impl TryFrom<&soroban_sdk::InvokeError> for UsedNonPubError { - type Error = soroban_sdk::InvokeError; - #[inline(always)] - fn try_from(error: &soroban_sdk::InvokeError) -> Result { - <_ as TryFrom>::try_from(*error) - } -} -impl From for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: UsedNonPubError) -> soroban_sdk::InvokeError { - <_ as From<&UsedNonPubError>>::from(&val) + fn eq(&self, other: &UsedLeaf) -> bool { + self.val == other.val } } -impl From<&UsedNonPubError> for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: &UsedNonPubError) -> soroban_sdk::InvokeError { - match val { - UsedNonPubError::Fail => soroban_sdk::InvokeError::Contract(1u32), - } +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDLEAF: [u8; 44usize] = UsedLeaf::spec_xdr(); +impl UsedLeaf { + pub const fn spec_xdr() -> [u8; 44usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x08UsedLeaf\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::TryFromVal for UsedNonPubError { +impl soroban_sdk::TryFromVal for UsedLeaf { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::TryIntoVal; - let error: soroban_sdk::Error = val.try_into_val(env)?; - error.try_into().map_err(|_| soroban_sdk::ConversionError) + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedNonPubError, + val: &UsedLeaf, ) -> Result { - let error: soroban_sdk::Error = val.into(); - Ok(error.into()) + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedNonPubError, + val: &&UsedLeaf, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } mod wasm_imported { @@ -6666,7 +7984,9 @@ impl soroban_sdk::TryFromVal for soroban_s } #[allow(private_interfaces)] impl Contract { + pub fn __constructor(_env: Env, _meta: UsedConstructorMeta) {} pub fn with_param(_env: Env, _s: UsedParamStruct, _ie: UsedParamIntEnum) {} + pub fn with_context(_env: Env, _context: Context) {} pub fn with_return(_env: Env) -> UsedReturnEnum { UsedReturnEnum::A(1) } @@ -6680,6 +8000,13 @@ impl Contract { }; } } + pub fn with_panic_error_ref(env: Env, fail: bool) { + if fail { + { + (&env).panic_with_error(&UsedPanicErrorEnumRef::Boom); + }; + } + } pub fn with_assert_error(env: Env, ok: bool) { { if !(ok) { @@ -6697,11 +8024,13 @@ impl Contract { } } pub fn with_vec(_env: Env, _v: Vec) {} + pub fn with_vec_nested(_env: Env, _v: Vec) {} pub fn with_map(_env: Env, _m: Map) {} pub fn with_option(_env: Env, _o: Option) {} pub fn with_result(_env: Env) -> Result { Ok(UsedResultOk { data: 1 }) } + pub fn with_recursion(_env: Env, _r: UsedRecursiveRoot) {} pub fn publish_simple(env: Env) { UsedEventSimple { kind: Symbol::new(&env, "transfer"), @@ -6765,6 +8094,22 @@ impl Contract { } #[doc(hidden)] #[allow(non_snake_case)] +pub mod __Contract____constructor__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_FN___CONSTRUCTOR: [u8; 76usize] = + super::Contract::spec_xdr___constructor(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr___constructor() -> [u8; 76usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\r__constructor\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04meta\0\0\x07\xd0\0\0\0\x13UsedConstructorMeta\0\0\0\0\0" + } +} +#[doc(hidden)] +#[allow(non_snake_case)] pub mod __Contract__with_param__spec { #[doc(hidden)] #[allow(non_snake_case)] @@ -6780,6 +8125,21 @@ impl Contract { } #[doc(hidden)] #[allow(non_snake_case)] +pub mod __Contract__with_context__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_FN_WITH_CONTEXT: [u8; 64usize] = super::Contract::spec_xdr_with_context(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_context() -> [u8; 64usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0cwith_context\0\0\0\x01\0\0\0\0\0\0\0\x07context\0\0\0\x07\xd0\0\0\0\x07Context\0\0\0\0\0" + } +} +#[doc(hidden)] +#[allow(non_snake_case)] pub mod __Contract__with_return__spec { #[doc(hidden)] #[allow(non_snake_case)] @@ -6826,6 +8186,22 @@ impl Contract { } #[doc(hidden)] #[allow(non_snake_case)] +pub mod __Contract__with_panic_error_ref__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_FN_WITH_PANIC_ERROR_REF: [u8; 56usize] = + super::Contract::spec_xdr_with_panic_error_ref(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_panic_error_ref() -> [u8; 56usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x14with_panic_error_ref\0\0\0\x01\0\0\0\0\0\0\0\x04fail\0\0\0\x01\0\0\0\0" + } +} +#[doc(hidden)] +#[allow(non_snake_case)] pub mod __Contract__with_assert_error__spec { #[doc(hidden)] #[allow(non_snake_case)] @@ -6873,6 +8249,22 @@ impl Contract { } #[doc(hidden)] #[allow(non_snake_case)] +pub mod __Contract__with_vec_nested__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_FN_WITH_VEC_NESTED: [u8; 80usize] = + super::Contract::spec_xdr_with_vec_nested(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_vec_nested() -> [u8; 80usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0fwith_vec_nested\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x14UsedVecElementNested\0\0\0\0" + } +} +#[doc(hidden)] +#[allow(non_snake_case)] pub mod __Contract__with_map__spec { #[doc(hidden)] #[allow(non_snake_case)] @@ -6918,6 +8310,22 @@ impl Contract { } #[doc(hidden)] #[allow(non_snake_case)] +pub mod __Contract__with_recursion__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_FN_WITH_RECURSION: [u8; 76usize] = + super::Contract::spec_xdr_with_recursion(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_recursion() -> [u8; 76usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0ewith_recursion\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01r\0\0\0\0\0\x07\xd0\0\0\0\x11UsedRecursiveRoot\0\0\0\0\0\0\0" + } +} +#[doc(hidden)] +#[allow(non_snake_case)] pub mod __Contract__publish_simple__spec { #[doc(hidden)] #[allow(non_snake_case)] @@ -7131,11 +8539,36 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_param") }, - ::soroban_sdk::Vec::from_array( - &self.env, - [_s.into_val(&self.env), _ie.into_val(&self.env)], - ), + &{ soroban_sdk::Symbol::new(&self.env, "with_param") }, + ::soroban_sdk::Vec::from_array( + &self.env, + [_s.into_val(&self.env), _ie.into_val(&self.env)], + ), + ); + res + } + pub fn with_context(&self, _context: &Context) -> () { + use core::ops::Not; + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_context") }, + ::soroban_sdk::Vec::from_array(&self.env, [_context.into_val(&self.env)]), + ); + res + } + pub fn try_with_context( + &self, + _context: &Context, + ) -> Result< + Result<(), <() as soroban_sdk::TryFromVal>::Error>, + Result, + > { + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_context") }, + ::soroban_sdk::Vec::from_array(&self.env, [_context.into_val(&self.env)]), ); res } @@ -7215,6 +8648,31 @@ impl<'a> ContractClient<'a> { ); res } + pub fn with_panic_error_ref(&self, fail: &bool) -> () { + use core::ops::Not; + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_panic_error_ref") }, + ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), + ); + res + } + pub fn try_with_panic_error_ref( + &self, + fail: &bool, + ) -> Result< + Result<(), <() as soroban_sdk::TryFromVal>::Error>, + Result, + > { + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_panic_error_ref") }, + ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), + ); + res + } pub fn with_assert_error(&self, ok: &bool) -> () { use core::ops::Not; use soroban_sdk::{FromVal, IntoVal}; @@ -7298,6 +8756,31 @@ impl<'a> ContractClient<'a> { ); res } + pub fn with_vec_nested(&self, _v: &Vec) -> () { + use core::ops::Not; + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_vec_nested") }, + ::soroban_sdk::Vec::from_array(&self.env, [_v.into_val(&self.env)]), + ); + res + } + pub fn try_with_vec_nested( + &self, + _v: &Vec, + ) -> Result< + Result<(), <() as soroban_sdk::TryFromVal>::Error>, + Result, + > { + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_vec_nested") }, + ::soroban_sdk::Vec::from_array(&self.env, [_v.into_val(&self.env)]), + ); + res + } pub fn with_map(&self, _m: &Map) -> () { use core::ops::Not; use soroban_sdk::{FromVal, IntoVal}; @@ -7383,6 +8866,31 @@ impl<'a> ContractClient<'a> { ); res } + pub fn with_recursion(&self, _r: &UsedRecursiveRoot) -> () { + use core::ops::Not; + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_recursion") }, + ::soroban_sdk::Vec::from_array(&self.env, [_r.into_val(&self.env)]), + ); + res + } + pub fn try_with_recursion( + &self, + _r: &UsedRecursiveRoot, + ) -> Result< + Result<(), <() as soroban_sdk::TryFromVal>::Error>, + Result, + > { + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_recursion") }, + ::soroban_sdk::Vec::from_array(&self.env, [_r.into_val(&self.env)]), + ); + res + } pub fn publish_simple(&self) -> () { use core::ops::Not; use soroban_sdk::{FromVal, IntoVal}; @@ -7683,6 +9191,11 @@ impl<'a> ContractClient<'a> { } } impl ContractArgs { + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn __constructor<'i>(_meta: &'i UsedConstructorMeta) -> (&'i UsedConstructorMeta,) { + (_meta,) + } #[inline(always)] #[allow(clippy::unused_unit)] pub fn with_param<'i>( @@ -7693,6 +9206,11 @@ impl ContractArgs { } #[inline(always)] #[allow(clippy::unused_unit)] + pub fn with_context<'i>(_context: &'i Context) -> (&'i Context,) { + (_context,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] pub fn with_return<'i>() -> () { () } @@ -7708,6 +9226,11 @@ impl ContractArgs { } #[inline(always)] #[allow(clippy::unused_unit)] + pub fn with_panic_error_ref<'i>(fail: &'i bool) -> (&'i bool,) { + (fail,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] pub fn with_assert_error<'i>(ok: &'i bool) -> (&'i bool,) { (ok,) } @@ -7723,6 +9246,13 @@ impl ContractArgs { } #[inline(always)] #[allow(clippy::unused_unit)] + pub fn with_vec_nested<'i>( + _v: &'i Vec, + ) -> (&'i Vec,) { + (_v,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] pub fn with_map<'i>(_m: &'i Map) -> (&'i Map,) { (_m,) } @@ -7738,6 +9268,11 @@ impl ContractArgs { } #[inline(always)] #[allow(clippy::unused_unit)] + pub fn with_recursion<'i>(_r: &'i UsedRecursiveRoot) -> (&'i UsedRecursiveRoot,) { + (_r,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] pub fn publish_simple<'i>() -> () { () } @@ -7799,6 +9334,37 @@ impl ContractArgs { } #[doc(hidden)] #[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__constructor` instead")] +#[allow(deprecated)] +pub fn __Contract____constructor__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::__constructor( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__constructor` instead")] +#[export_name = "__constructor"] +pub extern "C" fn __Contract____constructor__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract____constructor__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] #[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_param` instead")] #[allow(deprecated)] pub fn __Contract__with_param__invoke_raw( @@ -7838,6 +9404,37 @@ pub extern "C" fn __Contract__with_param__invoke_raw_extern( } #[doc(hidden)] #[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_context` instead")] +#[allow(deprecated)] +pub fn __Contract__with_context__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::with_context( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_context` instead")] +#[export_name = "with_context"] +pub extern "C" fn __Contract__with_context__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__with_context__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] #[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_return` instead")] #[allow(deprecated)] pub fn __Contract__with_return__invoke_raw(env: soroban_sdk::Env) -> soroban_sdk::Val { @@ -7905,6 +9502,37 @@ pub extern "C" fn __Contract__with_panic_error__invoke_raw_extern( } #[doc(hidden)] #[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_panic_error_ref` instead")] +#[allow(deprecated)] +pub fn __Contract__with_panic_error_ref__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::with_panic_error_ref( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_panic_error_ref` instead")] +#[export_name = "with_panic_error_ref"] +pub extern "C" fn __Contract__with_panic_error_ref__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__with_panic_error_ref__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] #[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_assert_error` instead")] #[allow(deprecated)] pub fn __Contract__with_assert_error__invoke_raw( @@ -7998,6 +9626,37 @@ pub extern "C" fn __Contract__with_vec__invoke_raw_extern( } #[doc(hidden)] #[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_vec_nested` instead")] +#[allow(deprecated)] +pub fn __Contract__with_vec_nested__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::with_vec_nested( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_vec_nested` instead")] +#[export_name = "with_vec_nested"] +pub extern "C" fn __Contract__with_vec_nested__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__with_vec_nested__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] #[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_map` instead")] #[allow(deprecated)] pub fn __Contract__with_map__invoke_raw( @@ -8078,6 +9737,37 @@ pub extern "C" fn __Contract__with_result__invoke_raw_extern() -> soroban_sdk::V } #[doc(hidden)] #[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_recursion` instead")] +#[allow(deprecated)] +pub fn __Contract__with_recursion__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::with_recursion( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_recursion` instead")] +#[export_name = "with_recursion"] +pub extern "C" fn __Contract__with_recursion__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__with_recursion__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] #[deprecated(note = "use `ContractClient::new(&env, &contract_id).publish_simple` instead")] #[allow(deprecated)] pub fn __Contract__publish_simple__invoke_raw(env: soroban_sdk::Env) -> soroban_sdk::Val { @@ -8344,6 +10034,97 @@ pub extern "C" fn __Contract__publish_ref_event__invoke_raw_extern() -> soroban_ #[allow(deprecated)] __Contract__publish_ref_event__invoke_raw(soroban_sdk::Env::default()) } +impl CustomAccountInterface for Contract { + type Error = UsedAuthErrorEnum; + type Signature = CustomSignature; + fn __check_auth( + _env: Env, + _signature_payload: Hash<32>, + _signatures: Self::Signature, + _auth_contexts: Vec, + ) -> Result<(), UsedAuthErrorEnum> { + Ok(()) + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract____check_auth__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_FN___CHECK_AUTH: [u8; 192usize] = + super::Contract::spec_xdr___check_auth(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr___check_auth() -> [u8; 192usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0c__check_auth\0\0\0\x03\0\0\0\0\0\0\0\x11signature_payload\0\0\0\0\0\x03\xee\0\0\0 \0\0\0\0\0\0\0\nsignatures\0\0\0\0\x07\xd0\0\0\0\x0fCustomSignature\0\0\0\0\0\0\0\0\rauth_contexts\0\0\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x07Context\0\0\0\0\x01\0\0\x03\xe9\0\0\0\x02\0\0\x07\xd0\0\0\0\x11UsedAuthErrorEnum\0\0\0" + } +} +impl<'a> ContractClient<'a> {} +impl ContractArgs { + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn __check_auth<'i>( + _signature_payload: &'i Hash<32>, + _signatures: &'i CustomSignature, + _auth_contexts: &'i Vec, + ) -> ( + &'i Hash<32>, + &'i CustomSignature, + &'i Vec, + ) { + (_signature_payload, _signatures, _auth_contexts) + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__check_auth` instead")] +#[allow(deprecated)] +pub fn __Contract____check_auth__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, + arg_2: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::__check_auth( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_1), + ), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_2), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__check_auth` instead")] +#[export_name = "__check_auth"] +pub extern "C" fn __Contract____check_auth__invoke_raw_extern( + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, + arg_2: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract____check_auth__invoke_raw(soroban_sdk::Env::default(), arg_0, arg_1, arg_2) +} #[allow(dead_code)] fn non_contract_fn(_s: UnusedNonContractFnParam) -> UnusedNonContractFnReturn { UnusedNonContractFnReturn { x: 1 } diff --git a/tests-expanded/test_spec_shaking_v2_tests.rs b/tests-expanded/test_spec_shaking_v2_tests.rs index 379929979..438631efd 100644 --- a/tests-expanded/test_spec_shaking_v2_tests.rs +++ b/tests-expanded/test_spec_shaking_v2_tests.rs @@ -5,8 +5,8 @@ extern crate core; #[prelude_import] use core::prelude::rust_2021::*; use soroban_sdk::{ - assert_with_error, contract, contracterror, contractevent, contractimpl, contracttype, - panic_with_error, Env, Map, Symbol, Vec, + assert_with_error, auth::CustomAccountInterface, contract, contracterror, contractevent, + contractimpl, contracttype, crypto::Hash, panic_with_error, Env, Map, Symbol, Vec, }; pub struct Contract; ///ContractArgs is a type for building arg lists for functions defined in "Contract". @@ -192,14 +192,18 @@ impl UsedParamStruct { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fUsedParamStruct\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x04\0\0\0\0\0\0\0\x06nested\0\0\0\0\x07\xd0\0\0\0\x12UsedNestedInStruct\0\0" } } -impl soroban_sdk::SpecShakingMarker for UsedParamStruct { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedParamStruct { + const SPEC_TYPE_ID: [u8; 32] = *b"X\x03\xf6t\xc7\xd0\x01\"\x961\xf3\x1e\xad~\xda\xcc\xb4YQl\xb8N\x0f\x89&\x95m\x90\n\xab\xd4\xe3"; } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDPARAMSTRUCT: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 2, + *b"X\x03\xf6t\xc7\xd0\x01\"\x961\xf3\x1e\xad~\xda\xcc\xb4YQl\xb8N\x0f\x89&\x95m\x90\n\xab\xd4\xe3", + [::SPEC_TYPE_ID], +); impl soroban_sdk::TryFromVal for UsedParamStruct { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -567,304 +571,231 @@ const _: () = { } } }; -pub enum UsedReturnEnum { - A(u32), - B(i64), +pub struct UsedConstructorMeta { + pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedReturnEnum { +impl ::core::clone::Clone for UsedConstructorMeta { #[inline] - fn clone(&self) -> UsedReturnEnum { - match self { - UsedReturnEnum::A(__self_0) => UsedReturnEnum::A(::core::clone::Clone::clone(__self_0)), - UsedReturnEnum::B(__self_0) => UsedReturnEnum::B(::core::clone::Clone::clone(__self_0)), + fn clone(&self) -> UsedConstructorMeta { + UsedConstructorMeta { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedReturnEnum { +impl ::core::fmt::Debug for UsedConstructorMeta { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - match self { - UsedReturnEnum::A(__self_0) => { - ::core::fmt::Formatter::debug_tuple_field1_finish(f, "A", &__self_0) - } - UsedReturnEnum::B(__self_0) => { - ::core::fmt::Formatter::debug_tuple_field1_finish(f, "B", &__self_0) - } - } + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedConstructorMeta", + "val", + &&self.val, + ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedReturnEnum { +impl ::core::cmp::Eq for UsedConstructorMeta { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedReturnEnum {} +impl ::core::marker::StructuralPartialEq for UsedConstructorMeta {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedReturnEnum { +impl ::core::cmp::PartialEq for UsedConstructorMeta { #[inline] - fn eq(&self, other: &UsedReturnEnum) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr - && match (self, other) { - (UsedReturnEnum::A(__self_0), UsedReturnEnum::A(__arg1_0)) => __self_0 == __arg1_0, - (UsedReturnEnum::B(__self_0), UsedReturnEnum::B(__arg1_0)) => __self_0 == __arg1_0, - _ => unsafe { ::core::intrinsics::unreachable() }, - } - } -} -pub static __SPEC_XDR_TYPE_USEDRETURNENUM: [u8; 84usize] = UsedReturnEnum::spec_xdr(); -impl UsedReturnEnum { - pub const fn spec_xdr() -> [u8; 84usize] { - *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x0eUsedReturnEnum\0\0\0\0\0\x02\0\0\0\x01\0\0\0\0\0\0\0\x01A\0\0\0\0\0\0\x01\0\0\0\x04\0\0\0\x01\0\0\0\0\0\0\0\x01B\0\0\0\0\0\0\x01\0\0\0\x07" - } -} -impl soroban_sdk::SpecShakingMarker for UsedReturnEnum { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); + fn eq(&self, other: &UsedConstructorMeta) -> bool { + self.val == other.val } } -impl soroban_sdk::TryFromVal for UsedReturnEnum { +pub static __SPEC_XDR_TYPE_USEDCONSTRUCTORMETA: [u8; 56usize] = UsedConstructorMeta::spec_xdr(); +impl UsedConstructorMeta { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedConstructorMeta\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedConstructorMeta { + const SPEC_TYPE_ID: [u8; 32] = *b"6\xc8\x1co\xa3\xfa}e0\xac\x8c\x1c\x938\xca\xc9\xa2\x8c\x156\x97~\x0f\xb2GV\xad\xb7\x1a\x1bT\xaa"; +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDCONSTRUCTORMETA: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"6\xc8\x1co\xa3\xfa}e0\xac\x8c\x1c\x938\xca\xc9\xa2\x8c\x156\x97~\x0f\xb2GV\xad\xb7\x1a\x1bT\xaa", + [], +); +impl soroban_sdk::TryFromVal for UsedConstructorMeta { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; - const CASES: &'static [&'static str] = &["A", "B"]; - let vec: soroban_sdk::Vec = val.try_into_val(env)?; - let mut iter = vec.try_iter(); - let discriminant: soroban_sdk::Symbol = iter - .next() - .ok_or(soroban_sdk::ConversionError)?? - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?; - Ok( - match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) as usize - { - 0 => { - if iter.len() > 1usize { - return Err(soroban_sdk::ConversionError); - } - Self::A( - iter.next() - .ok_or(soroban_sdk::ConversionError)?? - .try_into_val(env)?, - ) - } - 1 => { - if iter.len() > 1usize { - return Err(soroban_sdk::ConversionError); - } - Self::B( - iter.next() - .ok_or(soroban_sdk::ConversionError)?? - .try_into_val(env)?, - ) - } - _ => Err(soroban_sdk::ConversionError {})?, - }, - ) + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedReturnEnum, + val: &UsedConstructorMeta, ) -> Result { - use soroban_sdk::{TryFromVal, TryIntoVal}; - match val { - UsedReturnEnum::A(ref value0) => { - let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( - soroban_sdk::Symbol::try_from_val(env, &"A")?.to_val(), - value0.try_into_val(env)?, - ); - tup.try_into_val(env).map_err(Into::into) - } - UsedReturnEnum::B(ref value0) => { - let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( - soroban_sdk::Symbol::try_from_val(env, &"B")?.to_val(), - value0.try_into_val(env)?, - ); - tup.try_into_val(env).map_err(Into::into) - } - } + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedReturnEnum, + val: &&UsedConstructorMeta, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) } } -impl soroban_sdk::TryFromVal for UsedReturnEnum { +impl soroban_sdk::TryFromVal for UsedConstructorMeta { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &soroban_sdk::xdr::ScVec, + val: &soroban_sdk::xdr::ScMap, ) -> Result { use soroban_sdk::xdr::Validate; use soroban_sdk::TryIntoVal; - let vec = val; - let mut iter = vec.iter(); - let discriminant: soroban_sdk::xdr::ScSymbol = iter - .next() - .ok_or(soroban_sdk::xdr::Error::Invalid)? - .clone() - .try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; - let discriminant_name: &str = &discriminant.to_utf8_string()?; - Ok(match discriminant_name { - "A" => { - if iter.len() > 1usize { - return Err(soroban_sdk::xdr::Error::Invalid); - } - let rv0: soroban_sdk::Val = iter - .next() - .ok_or(soroban_sdk::xdr::Error::Invalid)? - .try_into_val(env) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; - Self::A( - rv0.try_into_val(env) + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + val: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "val" + .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) - } - "B" => { - if iter.len() > 1usize { - return Err(soroban_sdk::xdr::Error::Invalid); - } - let rv0: soroban_sdk::Val = iter - .next() - .ok_or(soroban_sdk::xdr::Error::Invalid)? + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) .try_into_val(env) .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; - Self::B( - rv0.try_into_val(env) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - ) - } - _ => Err(soroban_sdk::xdr::Error::Invalid)?, + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, }) } } -impl soroban_sdk::TryFromVal for UsedReturnEnum { +impl soroban_sdk::TryFromVal for UsedConstructorMeta { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::xdr::ScVal, ) -> Result { - if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { - <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) } else { Err(soroban_sdk::xdr::Error::Invalid) } } } -impl TryFrom<&UsedReturnEnum> for soroban_sdk::xdr::ScVec { +impl TryFrom<&UsedConstructorMeta> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedReturnEnum) -> Result { + fn try_from(val: &UsedConstructorMeta) -> Result { extern crate alloc; - Ok(match val { - UsedReturnEnum::A(value0) => ( - soroban_sdk::xdr::ScSymbol( - "A".try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - ), - value0, - ) - .try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - UsedReturnEnum::B(value0) => ( - soroban_sdk::xdr::ScSymbol( - "B".try_into() + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "val" + .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - ), - value0, - ) - .try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - }) + ) + .into(), + val: (&val.val) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) } } -impl TryFrom for soroban_sdk::xdr::ScVec { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedReturnEnum) -> Result { + fn try_from(val: UsedConstructorMeta) -> Result { (&val).try_into() } } -impl TryFrom<&UsedReturnEnum> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedConstructorMeta> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedReturnEnum) -> Result { - Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + fn try_from(val: &UsedConstructorMeta) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedReturnEnum) -> Result { + fn try_from(val: UsedConstructorMeta) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub enum ArbitraryUsedReturnEnum { - A(::Prototype), - B(::Prototype), + pub struct ArbitraryUsedConstructorMeta { + val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedReturnEnum { + impl ::core::fmt::Debug for ArbitraryUsedConstructorMeta { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - match self { - ArbitraryUsedReturnEnum::A(__self_0) => { - ::core::fmt::Formatter::debug_tuple_field1_finish(f, "A", &__self_0) - } - ArbitraryUsedReturnEnum::B(__self_0) => { - ::core::fmt::Formatter::debug_tuple_field1_finish(f, "B", &__self_0) - } - } + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "ArbitraryUsedConstructorMeta", + "val", + &&self.val, + ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedReturnEnum { + impl ::core::clone::Clone for ArbitraryUsedConstructorMeta { #[inline] - fn clone(&self) -> ArbitraryUsedReturnEnum { - match self { - ArbitraryUsedReturnEnum::A(__self_0) => { - ArbitraryUsedReturnEnum::A(::core::clone::Clone::clone(__self_0)) - } - ArbitraryUsedReturnEnum::B(__self_0) => { - ArbitraryUsedReturnEnum::B(::core::clone::Clone::clone(__self_0)) - } + fn clone(&self) -> ArbitraryUsedConstructorMeta { + ArbitraryUsedConstructorMeta { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedReturnEnum { + impl ::core::cmp::Eq for ArbitraryUsedConstructorMeta { #[inline] #[doc(hidden)] #[coverage(off)] @@ -872,78 +803,37 @@ const _: () = { let _: ::core::cmp::AssertParamIsEq< ::Prototype, >; - let _: ::core::cmp::AssertParamIsEq< - ::Prototype, - >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedReturnEnum {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedConstructorMeta {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedReturnEnum { + impl ::core::cmp::PartialEq for ArbitraryUsedConstructorMeta { #[inline] - fn eq(&self, other: &ArbitraryUsedReturnEnum) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr - && match (self, other) { - ( - ArbitraryUsedReturnEnum::A(__self_0), - ArbitraryUsedReturnEnum::A(__arg1_0), - ) => __self_0 == __arg1_0, - ( - ArbitraryUsedReturnEnum::B(__self_0), - ArbitraryUsedReturnEnum::B(__arg1_0), - ) => __self_0 == __arg1_0, - _ => unsafe { ::core::intrinsics::unreachable() }, - } + fn eq(&self, other: &ArbitraryUsedConstructorMeta) -> bool { + self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedReturnEnum { + impl ::core::cmp::Ord for ArbitraryUsedConstructorMeta { #[inline] - fn cmp(&self, other: &ArbitraryUsedReturnEnum) -> ::core::cmp::Ordering { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { - ::core::cmp::Ordering::Equal => match (self, other) { - ( - ArbitraryUsedReturnEnum::A(__self_0), - ArbitraryUsedReturnEnum::A(__arg1_0), - ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), - ( - ArbitraryUsedReturnEnum::B(__self_0), - ArbitraryUsedReturnEnum::B(__arg1_0), - ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), - _ => unsafe { ::core::intrinsics::unreachable() }, - }, - cmp => cmp, - } + fn cmp(&self, other: &ArbitraryUsedConstructorMeta) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedReturnEnum { + impl ::core::cmp::PartialOrd for ArbitraryUsedConstructorMeta { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedReturnEnum, + other: &ArbitraryUsedConstructorMeta, ) -> ::core::option::Option<::core::cmp::Ordering> { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - match (self, other) { - (ArbitraryUsedReturnEnum::A(__self_0), ArbitraryUsedReturnEnum::A(__arg1_0)) => { - ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) - } - (ArbitraryUsedReturnEnum::B(__self_0), ArbitraryUsedReturnEnum::B(__arg1_0)) => { - ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) - } - _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), - } + ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedReturnEnum: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedConstructorMeta: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -977,11 +867,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedReturnEnum { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedConstructorMeta { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedReturnEnum.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedConstructorMeta.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -990,19 +880,12 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(u)?) * 2u64) >> 32 - { - 0u64 => ArbitraryUsedReturnEnum::A(arbitrary::Arbitrary::arbitrary(u)?), - 1u64 => ArbitraryUsedReturnEnum::B(arbitrary::Arbitrary::arbitrary(u)?), - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryUsedConstructorMeta { + val: arbitrary::Arbitrary::arbitrary(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedReturnEnum.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedConstructorMeta.with(|count| { count.set(count.get() - 1); }); } @@ -1013,7 +896,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedReturnEnum.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedConstructorMeta.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -1022,24 +905,12 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(&mut u)?) * 2u64) - >> 32 - { - 0u64 => ArbitraryUsedReturnEnum::A( - arbitrary::Arbitrary::arbitrary_take_rest(u)?, - ), - 1u64 => ArbitraryUsedReturnEnum::B( - arbitrary::Arbitrary::arbitrary_take_rest(u)?, - ), - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryUsedConstructorMeta { + val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedReturnEnum.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedConstructorMeta.with(|count| { count.set(count.get() - 1); }); } @@ -1047,258 +918,290 @@ const _: () = { } #[inline] fn size_hint(depth: usize) -> (usize, Option) { - arbitrary::size_hint::and( - ::size_hint(depth), - arbitrary::size_hint::recursion_guard(depth, |depth| { - arbitrary::size_hint::or_all( - &[ - arbitrary::size_hint::and_all( - &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( - depth, - ), - ], - ), - arbitrary::size_hint::and_all( - &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( - depth, - ), - ], - ), - ], - ) - }), - ) + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedReturnEnum { - type Prototype = ArbitraryUsedReturnEnum; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedConstructorMeta { + type Prototype = ArbitraryUsedConstructorMeta; } - impl soroban_sdk::TryFromVal for UsedReturnEnum { + impl soroban_sdk::TryFromVal + for UsedConstructorMeta + { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedReturnEnum, + v: &ArbitraryUsedConstructorMeta, ) -> std::result::Result { - Ok(match v { - ArbitraryUsedReturnEnum::A(field_0) => { - UsedReturnEnum::A(soroban_sdk::IntoVal::into_val(field_0, env)) - } - ArbitraryUsedReturnEnum::B(field_0) => { - UsedReturnEnum::B(soroban_sdk::IntoVal::into_val(field_0, env)) - } + Ok(UsedConstructorMeta { + val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -pub enum UsedParamIntEnum { - X = 1, - Y = 2, +pub struct Context { + pub val: u32, } #[automatically_derived] -impl ::core::marker::Copy for UsedParamIntEnum {} -#[automatically_derived] -impl ::core::clone::Clone for UsedParamIntEnum { +impl ::core::clone::Clone for Context { #[inline] - fn clone(&self) -> UsedParamIntEnum { - *self + fn clone(&self) -> Context { + Context { + val: ::core::clone::Clone::clone(&self.val), + } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedParamIntEnum { +impl ::core::fmt::Debug for Context { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( - f, - match self { - UsedParamIntEnum::X => "X", - UsedParamIntEnum::Y => "Y", - }, - ) + ::core::fmt::Formatter::debug_struct_field1_finish(f, "Context", "val", &&self.val) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedParamIntEnum { +impl ::core::cmp::Eq for Context { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedParamIntEnum {} +impl ::core::marker::StructuralPartialEq for Context {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedParamIntEnum { +impl ::core::cmp::PartialEq for Context { #[inline] - fn eq(&self, other: &UsedParamIntEnum) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr + fn eq(&self, other: &Context) -> bool { + self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDPARAMINTENUM: [u8; 68usize] = UsedParamIntEnum::spec_xdr(); -impl UsedParamIntEnum { - pub const fn spec_xdr() -> [u8; 68usize] { - *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x10UsedParamIntEnum\0\0\0\x02\0\0\0\0\0\0\0\x01X\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01Y\0\0\0\0\0\0\x02" +pub static __SPEC_XDR_TYPE_CONTEXT: [u8; 44usize] = Context::spec_xdr(); +impl Context { + pub const fn spec_xdr() -> [u8; 44usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x07Context\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UsedParamIntEnum { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() {} +impl soroban_sdk::spec_shaking::SpecTypeId for Context { + const SPEC_TYPE_ID: [u8; 32] = + *b"\x86\xf7:L*\xf3\x0b\x94\xd8\x8bM1m\x13\xed\x8fJ}\xb4\xc1\x15u\xd0\xd3\xb6Xe\nj6\x84\""; } -impl soroban_sdk::TryFromVal for UsedParamIntEnum { +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_CONTEXT: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\x86\xf7:L*\xf3\x0b\x94\xd8\x8bM1m\x13\xed\x8fJ}\xb4\xc1\x15u\xd0\xd3\xb6Xe\nj6\x84\"", + [], + ); +impl soroban_sdk::TryFromVal for Context { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::TryIntoVal; - let discriminant: u32 = val.try_into_val(env)?; - Ok(match discriminant { - 1u32 => Self::X, - 2u32 => Self::Y, - _ => Err(soroban_sdk::ConversionError {})?, + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedParamIntEnum, + val: &Context, ) -> Result { - Ok(match val { - UsedParamIntEnum::X => 1u32.into(), - UsedParamIntEnum::Y => 2u32.into(), - }) + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedParamIntEnum, + val: &&Context, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedParamIntEnum { +impl soroban_sdk::TryFromVal for Context { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &soroban_sdk::xdr::ScVal, + val: &soroban_sdk::xdr::ScMap, ) -> Result { - if let soroban_sdk::xdr::ScVal::U32(discriminant) = val { - Ok(match *discriminant { - 1u32 => Self::X, - 2u32 => Self::Y, - _ => Err(soroban_sdk::xdr::Error::Invalid)?, - }) - } else { - Err(soroban_sdk::xdr::Error::Invalid) + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); } + map.validate()?; + Ok(Self { + val: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "val" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) } } -impl TryInto for &UsedParamIntEnum { +impl soroban_sdk::TryFromVal for Context { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_into(self) -> Result { - Ok(match self { - UsedParamIntEnum::X => 1u32.into(), - UsedParamIntEnum::Y => 2u32.into(), - }) + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } } } -impl TryInto for UsedParamIntEnum { +impl TryFrom<&Context> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_into(self) -> Result { - Ok(match self { - UsedParamIntEnum::X => 1u32.into(), - UsedParamIntEnum::Y => 2u32.into(), - }) + fn try_from(val: &Context) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "val" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.val) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } +} +impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Context) -> Result { + (&val).try_into() + } +} +impl TryFrom<&Context> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &Context) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Context) -> Result { + (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub enum ArbitraryUsedParamIntEnum { - X, - Y, + pub struct ArbitraryContext { + val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedParamIntEnum { + impl ::core::fmt::Debug for ArbitraryContext { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( + ::core::fmt::Formatter::debug_struct_field1_finish( f, - match self { - ArbitraryUsedParamIntEnum::X => "X", - ArbitraryUsedParamIntEnum::Y => "Y", - }, + "ArbitraryContext", + "val", + &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedParamIntEnum { + impl ::core::clone::Clone for ArbitraryContext { #[inline] - fn clone(&self) -> ArbitraryUsedParamIntEnum { - match self { - ArbitraryUsedParamIntEnum::X => ArbitraryUsedParamIntEnum::X, - ArbitraryUsedParamIntEnum::Y => ArbitraryUsedParamIntEnum::Y, + fn clone(&self) -> ArbitraryContext { + ArbitraryContext { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedParamIntEnum { + impl ::core::cmp::Eq for ArbitraryContext { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedParamIntEnum {} + impl ::core::marker::StructuralPartialEq for ArbitraryContext {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedParamIntEnum { + impl ::core::cmp::PartialEq for ArbitraryContext { #[inline] - fn eq(&self, other: &ArbitraryUsedParamIntEnum) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr + fn eq(&self, other: &ArbitraryContext) -> bool { + self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedParamIntEnum { + impl ::core::cmp::Ord for ArbitraryContext { #[inline] - fn cmp(&self, other: &ArbitraryUsedParamIntEnum) -> ::core::cmp::Ordering { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) + fn cmp(&self, other: &ArbitraryContext) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedParamIntEnum { + impl ::core::cmp::PartialOrd for ArbitraryContext { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedParamIntEnum, + other: &ArbitraryContext, ) -> ::core::option::Option<::core::cmp::Ordering> { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr) + ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedParamIntEnum: ::std::thread::LocalKey< - std::cell::Cell, - > = { + const RECURSIVE_COUNT_ArbitraryContext: ::std::thread::LocalKey> = { #[inline] fn __init() -> std::cell::Cell { std::cell::Cell::new(0) @@ -1330,11 +1233,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedParamIntEnum { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryContext { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedParamIntEnum.with(|count| { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -1343,19 +1246,12 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(u)?) * 2u64) >> 32 - { - 0u64 => ArbitraryUsedParamIntEnum::X, - 1u64 => ArbitraryUsedParamIntEnum::Y, - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryContext { + val: arbitrary::Arbitrary::arbitrary(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedParamIntEnum.with(|count| { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { count.set(count.get() - 1); }); } @@ -1366,7 +1262,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedParamIntEnum.with(|count| { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -1375,20 +1271,12 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(&mut u)?) * 2u64) - >> 32 - { - 0u64 => ArbitraryUsedParamIntEnum::X, - 1u64 => ArbitraryUsedParamIntEnum::Y, - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryContext { + val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedParamIntEnum.with(|count| { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { count.set(count.get() - 1); }); } @@ -1396,600 +1284,4913 @@ const _: () = { } #[inline] fn size_hint(depth: usize) -> (usize, Option) { - arbitrary::size_hint::and( - ::size_hint(depth), - arbitrary::size_hint::recursion_guard(depth, |depth| { - arbitrary::size_hint::or_all(&[ - arbitrary::size_hint::and_all(&[]), - arbitrary::size_hint::and_all(&[]), - ]) - }), - ) + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedParamIntEnum { - type Prototype = ArbitraryUsedParamIntEnum; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for Context { + type Prototype = ArbitraryContext; } - impl soroban_sdk::TryFromVal for UsedParamIntEnum { + impl soroban_sdk::TryFromVal for Context { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedParamIntEnum, + v: &ArbitraryContext, ) -> std::result::Result { - Ok(match v { - ArbitraryUsedParamIntEnum::X => UsedParamIntEnum::X, - ArbitraryUsedParamIntEnum::Y => UsedParamIntEnum::Y, + Ok(Context { + val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -pub enum UsedErrorEnum { - NotFound = 1, - Invalid = 2, +pub enum UsedReturnEnum { + A(u32), + B(i64), } #[automatically_derived] -impl ::core::marker::Copy for UsedErrorEnum {} -#[automatically_derived] -impl ::core::clone::Clone for UsedErrorEnum { +impl ::core::clone::Clone for UsedReturnEnum { #[inline] - fn clone(&self) -> UsedErrorEnum { - *self + fn clone(&self) -> UsedReturnEnum { + match self { + UsedReturnEnum::A(__self_0) => UsedReturnEnum::A(::core::clone::Clone::clone(__self_0)), + UsedReturnEnum::B(__self_0) => UsedReturnEnum::B(::core::clone::Clone::clone(__self_0)), + } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedErrorEnum { +impl ::core::fmt::Debug for UsedReturnEnum { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( - f, - match self { - UsedErrorEnum::NotFound => "NotFound", - UsedErrorEnum::Invalid => "Invalid", - }, - ) + match self { + UsedReturnEnum::A(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "A", &__self_0) + } + UsedReturnEnum::B(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "B", &__self_0) + } + } } } #[automatically_derived] -impl ::core::cmp::Eq for UsedErrorEnum { +impl ::core::cmp::Eq for UsedReturnEnum { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedErrorEnum {} +impl ::core::marker::StructuralPartialEq for UsedReturnEnum {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedErrorEnum { +impl ::core::cmp::PartialEq for UsedReturnEnum { #[inline] - fn eq(&self, other: &UsedErrorEnum) -> bool { + fn eq(&self, other: &UsedReturnEnum) -> bool { let __self_discr = ::core::intrinsics::discriminant_value(self); let __arg1_discr = ::core::intrinsics::discriminant_value(other); __self_discr == __arg1_discr + && match (self, other) { + (UsedReturnEnum::A(__self_0), UsedReturnEnum::A(__arg1_0)) => __self_0 == __arg1_0, + (UsedReturnEnum::B(__self_0), UsedReturnEnum::B(__arg1_0)) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } } } -pub static __SPEC_XDR_TYPE_USEDERRORENUM: [u8; 76usize] = UsedErrorEnum::spec_xdr(); -impl UsedErrorEnum { - pub const fn spec_xdr() -> [u8; 76usize] { - *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\rUsedErrorEnum\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x08NotFound\0\0\0\x01\0\0\0\0\0\0\0\x07Invalid\0\0\0\0\x02" - } -} -impl soroban_sdk::SpecShakingMarker for UsedErrorEnum { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() {} -} -impl TryFrom for UsedErrorEnum { - type Error = soroban_sdk::Error; - #[inline(always)] - fn try_from(error: soroban_sdk::Error) -> Result { - if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { - let discriminant = error.get_code(); - Ok(match discriminant { - 1u32 => Self::NotFound, - 2u32 => Self::Invalid, - _ => return Err(error), - }) - } else { - Err(error) - } - } -} -impl TryFrom<&soroban_sdk::Error> for UsedErrorEnum { - type Error = soroban_sdk::Error; - #[inline(always)] - fn try_from(error: &soroban_sdk::Error) -> Result { - <_ as TryFrom>::try_from(*error) - } -} -impl From for soroban_sdk::Error { - #[inline(always)] - fn from(val: UsedErrorEnum) -> soroban_sdk::Error { - <_ as From<&UsedErrorEnum>>::from(&val) +pub static __SPEC_XDR_TYPE_USEDRETURNENUM: [u8; 84usize] = UsedReturnEnum::spec_xdr(); +impl UsedReturnEnum { + pub const fn spec_xdr() -> [u8; 84usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x0eUsedReturnEnum\0\0\0\0\0\x02\0\0\0\x01\0\0\0\0\0\0\0\x01A\0\0\0\0\0\0\x01\0\0\0\x04\0\0\0\x01\0\0\0\0\0\0\0\x01B\0\0\0\0\0\0\x01\0\0\0\x07" } } -impl From<&UsedErrorEnum> for soroban_sdk::Error { - #[inline(always)] - fn from(val: &UsedErrorEnum) -> soroban_sdk::Error { - match val { - UsedErrorEnum::NotFound => soroban_sdk::Error::from_contract_error(1u32), - UsedErrorEnum::Invalid => soroban_sdk::Error::from_contract_error(2u32), - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedReturnEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"\xe7\xcf\x9b1n\x15\x13\xfe+*\x08\xd9L\x80\xdd\xef0\x8e\xe4\xcc\x12tD\xe3<\x80\xfc\x0b\t\x7fgc"; } -impl TryFrom for UsedErrorEnum { - type Error = soroban_sdk::InvokeError; - #[inline(always)] - fn try_from(error: soroban_sdk::InvokeError) -> Result { - match error { - soroban_sdk::InvokeError::Abort => Err(error), - soroban_sdk::InvokeError::Contract(code) => Ok(match code { - 1u32 => Self::NotFound, - 2u32 => Self::Invalid, - _ => return Err(error), - }), - } - } -} -impl TryFrom<&soroban_sdk::InvokeError> for UsedErrorEnum { - type Error = soroban_sdk::InvokeError; - #[inline(always)] - fn try_from(error: &soroban_sdk::InvokeError) -> Result { - <_ as TryFrom>::try_from(*error) - } -} -impl From for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: UsedErrorEnum) -> soroban_sdk::InvokeError { - <_ as From<&UsedErrorEnum>>::from(&val) - } -} -impl From<&UsedErrorEnum> for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: &UsedErrorEnum) -> soroban_sdk::InvokeError { - match val { - UsedErrorEnum::NotFound => soroban_sdk::InvokeError::Contract(1u32), - UsedErrorEnum::Invalid => soroban_sdk::InvokeError::Contract(2u32), - } - } -} -impl soroban_sdk::TryFromVal for UsedErrorEnum { - type Error = soroban_sdk::ConversionError; +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDRETURNENUM: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\xe7\xcf\x9b1n\x15\x13\xfe+*\x08\xd9L\x80\xdd\xef0\x8e\xe4\xcc\x12tD\xe3<\x80\xfc\x0b\t\x7fgc", + [], +); +impl soroban_sdk::TryFromVal for UsedReturnEnum { + type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::TryIntoVal; - let error: soroban_sdk::Error = val.try_into_val(env)?; - error.try_into().map_err(|_| soroban_sdk::ConversionError) + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["A", "B"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::A( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::B( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedErrorEnum, + val: &UsedReturnEnum, ) -> Result { - let error: soroban_sdk::Error = val.into(); - Ok(error.into()) + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + UsedReturnEnum::A(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"A")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + UsedReturnEnum::B(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"B")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedErrorEnum, + val: &&UsedReturnEnum, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) - } -} -pub enum UsedPanicErrorEnum { - Boom = 1, -} -#[automatically_derived] -impl ::core::marker::Copy for UsedPanicErrorEnum {} -#[automatically_derived] -impl ::core::clone::Clone for UsedPanicErrorEnum { - #[inline] - fn clone(&self) -> UsedPanicErrorEnum { - *self - } -} -#[automatically_derived] -impl ::core::fmt::Debug for UsedPanicErrorEnum { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str(f, "Boom") - } -} -#[automatically_derived] -impl ::core::cmp::Eq for UsedPanicErrorEnum { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} -} -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedPanicErrorEnum {} -#[automatically_derived] -impl ::core::cmp::PartialEq for UsedPanicErrorEnum { - #[inline] - fn eq(&self, other: &UsedPanicErrorEnum) -> bool { - true - } -} -pub static __SPEC_XDR_TYPE_USEDPANICERRORENUM: [u8; 56usize] = UsedPanicErrorEnum::spec_xdr(); -impl UsedPanicErrorEnum { - pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x12UsedPanicErrorEnum\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04Boom\0\0\0\x01" + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::SpecShakingMarker for UsedPanicErrorEnum { - #[doc(hidden)] +impl soroban_sdk::TryFromVal for UsedReturnEnum { + type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn spec_shaking_marker() {} + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "A" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::A( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "B" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::B( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } } -impl TryFrom for UsedPanicErrorEnum { - type Error = soroban_sdk::Error; +impl soroban_sdk::TryFromVal for UsedReturnEnum { + type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(error: soroban_sdk::Error) -> Result { - if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { - let discriminant = error.get_code(); - Ok(match discriminant { - 1u32 => Self::Boom, - _ => return Err(error), - }) + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) } else { - Err(error) + Err(soroban_sdk::xdr::Error::Invalid) } } } -impl TryFrom<&soroban_sdk::Error> for UsedPanicErrorEnum { - type Error = soroban_sdk::Error; +impl TryFrom<&UsedReturnEnum> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(error: &soroban_sdk::Error) -> Result { - <_ as TryFrom>::try_from(*error) + fn try_from(val: &UsedReturnEnum) -> Result { + extern crate alloc; + Ok(match val { + UsedReturnEnum::A(value0) => ( + soroban_sdk::xdr::ScSymbol( + "A".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + UsedReturnEnum::B(value0) => ( + soroban_sdk::xdr::ScSymbol( + "B".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }) } } -impl From for soroban_sdk::Error { +impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn from(val: UsedPanicErrorEnum) -> soroban_sdk::Error { - <_ as From<&UsedPanicErrorEnum>>::from(&val) + fn try_from(val: UsedReturnEnum) -> Result { + (&val).try_into() } } -impl From<&UsedPanicErrorEnum> for soroban_sdk::Error { +impl TryFrom<&UsedReturnEnum> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn from(val: &UsedPanicErrorEnum) -> soroban_sdk::Error { - match val { - UsedPanicErrorEnum::Boom => soroban_sdk::Error::from_contract_error(1u32), - } + fn try_from(val: &UsedReturnEnum) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) } } -impl TryFrom for UsedPanicErrorEnum { - type Error = soroban_sdk::InvokeError; - #[inline(always)] - fn try_from(error: soroban_sdk::InvokeError) -> Result { - match error { - soroban_sdk::InvokeError::Abort => Err(error), - soroban_sdk::InvokeError::Contract(code) => Ok(match code { - 1u32 => Self::Boom, - _ => return Err(error), - }), - } - } -} -impl TryFrom<&soroban_sdk::InvokeError> for UsedPanicErrorEnum { - type Error = soroban_sdk::InvokeError; +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(error: &soroban_sdk::InvokeError) -> Result { - <_ as TryFrom>::try_from(*error) + fn try_from(val: UsedReturnEnum) -> Result { + (&val).try_into() } } -impl From for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: UsedPanicErrorEnum) -> soroban_sdk::InvokeError { - <_ as From<&UsedPanicErrorEnum>>::from(&val) +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryUsedReturnEnum { + A(::Prototype), + B(::Prototype), } -} -impl From<&UsedPanicErrorEnum> for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: &UsedPanicErrorEnum) -> soroban_sdk::InvokeError { - match val { - UsedPanicErrorEnum::Boom => soroban_sdk::InvokeError::Contract(1u32), + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUsedReturnEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryUsedReturnEnum::A(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "A", &__self_0) + } + ArbitraryUsedReturnEnum::B(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "B", &__self_0) + } + } } } -} -impl soroban_sdk::TryFromVal for UsedPanicErrorEnum { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &soroban_sdk::Val, - ) -> Result { - use soroban_sdk::TryIntoVal; - let error: soroban_sdk::Error = val.try_into_val(env)?; - error.try_into().map_err(|_| soroban_sdk::ConversionError) - } -} -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &UsedPanicErrorEnum, - ) -> Result { - let error: soroban_sdk::Error = val.into(); - Ok(error.into()) - } -} -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &&UsedPanicErrorEnum, - ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUsedReturnEnum { + #[inline] + fn clone(&self) -> ArbitraryUsedReturnEnum { + match self { + ArbitraryUsedReturnEnum::A(__self_0) => { + ArbitraryUsedReturnEnum::A(::core::clone::Clone::clone(__self_0)) + } + ArbitraryUsedReturnEnum::B(__self_0) => { + ArbitraryUsedReturnEnum::B(::core::clone::Clone::clone(__self_0)) + } + } + } } -} -pub enum UsedAssertErrorEnum { - Bad = 1, -} -#[automatically_derived] -impl ::core::marker::Copy for UsedAssertErrorEnum {} -#[automatically_derived] -impl ::core::clone::Clone for UsedAssertErrorEnum { - #[inline] - fn clone(&self) -> UsedAssertErrorEnum { - *self + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUsedReturnEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } } -} -#[automatically_derived] -impl ::core::fmt::Debug for UsedAssertErrorEnum { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str(f, "Bad") + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUsedReturnEnum {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUsedReturnEnum { + #[inline] + fn eq(&self, other: &ArbitraryUsedReturnEnum) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + ArbitraryUsedReturnEnum::A(__self_0), + ArbitraryUsedReturnEnum::A(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryUsedReturnEnum::B(__self_0), + ArbitraryUsedReturnEnum::B(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } } -} -#[automatically_derived] -impl ::core::cmp::Eq for UsedAssertErrorEnum { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} -} -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedAssertErrorEnum {} -#[automatically_derived] -impl ::core::cmp::PartialEq for UsedAssertErrorEnum { - #[inline] - fn eq(&self, other: &UsedAssertErrorEnum) -> bool { - true + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUsedReturnEnum { + #[inline] + fn cmp(&self, other: &ArbitraryUsedReturnEnum) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + ArbitraryUsedReturnEnum::A(__self_0), + ArbitraryUsedReturnEnum::A(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryUsedReturnEnum::B(__self_0), + ArbitraryUsedReturnEnum::B(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } } -} -pub static __SPEC_XDR_TYPE_USEDASSERTERRORENUM: [u8; 56usize] = UsedAssertErrorEnum::spec_xdr(); -impl UsedAssertErrorEnum { - pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x13UsedAssertErrorEnum\0\0\0\0\x01\0\0\0\0\0\0\0\x03Bad\0\0\0\0\x01" + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUsedReturnEnum { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUsedReturnEnum, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + (ArbitraryUsedReturnEnum::A(__self_0), ArbitraryUsedReturnEnum::A(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + (ArbitraryUsedReturnEnum::B(__self_0), ArbitraryUsedReturnEnum::B(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } } -} -impl soroban_sdk::SpecShakingMarker for UsedAssertErrorEnum { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() {} -} -impl TryFrom for UsedAssertErrorEnum { - type Error = soroban_sdk::Error; - #[inline(always)] - fn try_from(error: soroban_sdk::Error) -> Result { - if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { - let discriminant = error.get_code(); - Ok(match discriminant { - 1u32 => Self::Bad, - _ => return Err(error), + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUsedReturnEnum: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedReturnEnum { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedReturnEnum.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) * 2u64) >> 32 + { + 0u64 => ArbitraryUsedReturnEnum::A(arbitrary::Arbitrary::arbitrary(u)?), + 1u64 => ArbitraryUsedReturnEnum::B(arbitrary::Arbitrary::arbitrary(u)?), + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedReturnEnum.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedReturnEnum.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) * 2u64) + >> 32 + { + 0u64 => ArbitraryUsedReturnEnum::A( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 1u64 => ArbitraryUsedReturnEnum::B( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedReturnEnum.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedReturnEnum { + type Prototype = ArbitraryUsedReturnEnum; + } + impl soroban_sdk::TryFromVal for UsedReturnEnum { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedReturnEnum, + ) -> std::result::Result { + Ok(match v { + ArbitraryUsedReturnEnum::A(field_0) => { + UsedReturnEnum::A(soroban_sdk::IntoVal::into_val(field_0, env)) + } + ArbitraryUsedReturnEnum::B(field_0) => { + UsedReturnEnum::B(soroban_sdk::IntoVal::into_val(field_0, env)) + } + }) + } + } +}; +pub enum UsedParamIntEnum { + X = 1, + Y = 2, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedParamIntEnum {} +#[automatically_derived] +impl ::core::clone::Clone for UsedParamIntEnum { + #[inline] + fn clone(&self) -> UsedParamIntEnum { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedParamIntEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + UsedParamIntEnum::X => "X", + UsedParamIntEnum::Y => "Y", + }, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedParamIntEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedParamIntEnum {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedParamIntEnum { + #[inline] + fn eq(&self, other: &UsedParamIntEnum) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } +} +pub static __SPEC_XDR_TYPE_USEDPARAMINTENUM: [u8; 68usize] = UsedParamIntEnum::spec_xdr(); +impl UsedParamIntEnum { + pub const fn spec_xdr() -> [u8; 68usize] { + *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x10UsedParamIntEnum\0\0\0\x02\0\0\0\0\0\0\0\x01X\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01Y\0\0\0\0\0\0\x02" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedParamIntEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"\xc2\xf4N\xbf\xebqvp\xb8\xb6\xbe\t\x99\xef\xb0\xf8\xc1G\xfa;\x1c\xd1\x9bg\xb3\xdbS\x92\xf6\"-@"; +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDPARAMINTENUM: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\xc2\xf4N\xbf\xebqvp\xb8\xb6\xbe\t\x99\xef\xb0\xf8\xc1G\xfa;\x1c\xd1\x9bg\xb3\xdbS\x92\xf6\"-@", + [], +); +impl soroban_sdk::TryFromVal for UsedParamIntEnum { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let discriminant: u32 = val.try_into_val(env)?; + Ok(match discriminant { + 1u32 => Self::X, + 2u32 => Self::Y, + _ => Err(soroban_sdk::ConversionError {})?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedParamIntEnum, + ) -> Result { + Ok(match val { + UsedParamIntEnum::X => 1u32.into(), + UsedParamIntEnum::Y => 2u32.into(), + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedParamIntEnum, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +impl soroban_sdk::TryFromVal for UsedParamIntEnum { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::U32(discriminant) = val { + Ok(match *discriminant { + 1u32 => Self::X, + 2u32 => Self::Y, + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryInto for &UsedParamIntEnum { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_into(self) -> Result { + Ok(match self { + UsedParamIntEnum::X => 1u32.into(), + UsedParamIntEnum::Y => 2u32.into(), + }) + } +} +impl TryInto for UsedParamIntEnum { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_into(self) -> Result { + Ok(match self { + UsedParamIntEnum::X => 1u32.into(), + UsedParamIntEnum::Y => 2u32.into(), + }) + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryUsedParamIntEnum { + X, + Y, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUsedParamIntEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + ArbitraryUsedParamIntEnum::X => "X", + ArbitraryUsedParamIntEnum::Y => "Y", + }, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUsedParamIntEnum { + #[inline] + fn clone(&self) -> ArbitraryUsedParamIntEnum { + match self { + ArbitraryUsedParamIntEnum::X => ArbitraryUsedParamIntEnum::X, + ArbitraryUsedParamIntEnum::Y => ArbitraryUsedParamIntEnum::Y, + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUsedParamIntEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUsedParamIntEnum {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUsedParamIntEnum { + #[inline] + fn eq(&self, other: &ArbitraryUsedParamIntEnum) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUsedParamIntEnum { + #[inline] + fn cmp(&self, other: &ArbitraryUsedParamIntEnum) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUsedParamIntEnum { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUsedParamIntEnum, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr) + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUsedParamIntEnum: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedParamIntEnum { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedParamIntEnum.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) * 2u64) >> 32 + { + 0u64 => ArbitraryUsedParamIntEnum::X, + 1u64 => ArbitraryUsedParamIntEnum::Y, + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedParamIntEnum.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedParamIntEnum.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) * 2u64) + >> 32 + { + 0u64 => ArbitraryUsedParamIntEnum::X, + 1u64 => ArbitraryUsedParamIntEnum::Y, + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedParamIntEnum.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all(&[ + arbitrary::size_hint::and_all(&[]), + arbitrary::size_hint::and_all(&[]), + ]) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedParamIntEnum { + type Prototype = ArbitraryUsedParamIntEnum; + } + impl soroban_sdk::TryFromVal for UsedParamIntEnum { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedParamIntEnum, + ) -> std::result::Result { + Ok(match v { + ArbitraryUsedParamIntEnum::X => UsedParamIntEnum::X, + ArbitraryUsedParamIntEnum::Y => UsedParamIntEnum::Y, + }) + } + } +}; +pub enum UsedErrorEnum { + NotFound = 1, + Invalid = 2, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedErrorEnum {} +#[automatically_derived] +impl ::core::clone::Clone for UsedErrorEnum { + #[inline] + fn clone(&self) -> UsedErrorEnum { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedErrorEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + UsedErrorEnum::NotFound => "NotFound", + UsedErrorEnum::Invalid => "Invalid", + }, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedErrorEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedErrorEnum {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedErrorEnum { + #[inline] + fn eq(&self, other: &UsedErrorEnum) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } +} +pub static __SPEC_XDR_TYPE_USEDERRORENUM: [u8; 76usize] = UsedErrorEnum::spec_xdr(); +impl UsedErrorEnum { + pub const fn spec_xdr() -> [u8; 76usize] { + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\rUsedErrorEnum\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x08NotFound\0\0\0\x01\0\0\0\0\0\0\0\x07Invalid\0\0\0\0\x02" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedErrorEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"Hh\xdc\xaaa\x8d\xf7\re\xda\x8d\xd7\x15\x1b\xfb\x07v\x9e\x94}\x06\x18\x88\xf7{\xcc\xb0C\xcb\xa3\xb6~"; +} +impl soroban_sdk::spec_shaking::SpecShakingMarker for UsedErrorEnum { + #[doc(hidden)] + #[inline(always)] + fn spec_shaking_marker() {} +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDERRORENUM: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"Hh\xdc\xaaa\x8d\xf7\re\xda\x8d\xd7\x15\x1b\xfb\x07v\x9e\x94}\x06\x18\x88\xf7{\xcc\xb0C\xcb\xa3\xb6~", + [], +); +impl TryFrom for UsedErrorEnum { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: soroban_sdk::Error) -> Result { + if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { + let discriminant = error.get_code(); + Ok(match discriminant { + 1u32 => Self::NotFound, + 2u32 => Self::Invalid, + _ => return Err(error), + }) + } else { + Err(error) + } + } +} +impl TryFrom<&soroban_sdk::Error> for UsedErrorEnum { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: &soroban_sdk::Error) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::Error { + #[inline(always)] + fn from(val: UsedErrorEnum) -> soroban_sdk::Error { + <_ as From<&UsedErrorEnum>>::from(&val) + } +} +impl From<&UsedErrorEnum> for soroban_sdk::Error { + #[inline(always)] + fn from(val: &UsedErrorEnum) -> soroban_sdk::Error { + match val { + UsedErrorEnum::NotFound => soroban_sdk::Error::from_contract_error(1u32), + UsedErrorEnum::Invalid => soroban_sdk::Error::from_contract_error(2u32), + } + } +} +impl TryFrom for UsedErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: soroban_sdk::InvokeError) -> Result { + match error { + soroban_sdk::InvokeError::Abort => Err(error), + soroban_sdk::InvokeError::Contract(code) => Ok(match code { + 1u32 => Self::NotFound, + 2u32 => Self::Invalid, + _ => return Err(error), + }), + } + } +} +impl TryFrom<&soroban_sdk::InvokeError> for UsedErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: &soroban_sdk::InvokeError) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: UsedErrorEnum) -> soroban_sdk::InvokeError { + <_ as From<&UsedErrorEnum>>::from(&val) + } +} +impl From<&UsedErrorEnum> for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: &UsedErrorEnum) -> soroban_sdk::InvokeError { + match val { + UsedErrorEnum::NotFound => soroban_sdk::InvokeError::Contract(1u32), + UsedErrorEnum::Invalid => soroban_sdk::InvokeError::Contract(2u32), + } + } +} +impl soroban_sdk::TryFromVal for UsedErrorEnum { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let error: soroban_sdk::Error = val.try_into_val(env)?; + error.try_into().map_err(|_| soroban_sdk::ConversionError) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedErrorEnum, + ) -> Result { + let error: soroban_sdk::Error = val.into(); + Ok(error.into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedErrorEnum, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +pub enum UsedAuthErrorEnum { + NotFound = 1, + Invalid = 2, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedAuthErrorEnum {} +#[automatically_derived] +impl ::core::clone::Clone for UsedAuthErrorEnum { + #[inline] + fn clone(&self) -> UsedAuthErrorEnum { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedAuthErrorEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + UsedAuthErrorEnum::NotFound => "NotFound", + UsedAuthErrorEnum::Invalid => "Invalid", + }, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedAuthErrorEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedAuthErrorEnum {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedAuthErrorEnum { + #[inline] + fn eq(&self, other: &UsedAuthErrorEnum) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } +} +pub static __SPEC_XDR_TYPE_USEDAUTHERRORENUM: [u8; 80usize] = UsedAuthErrorEnum::spec_xdr(); +impl UsedAuthErrorEnum { + pub const fn spec_xdr() -> [u8; 80usize] { + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x11UsedAuthErrorEnum\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x08NotFound\0\0\0\x01\0\0\0\0\0\0\0\x07Invalid\0\0\0\0\x02" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedAuthErrorEnum { + const SPEC_TYPE_ID: [u8; 32] = + *b"=V\x92A(\x981\x88\xf58\xbe\x9e5*+\xf5>J\x9c\x88&\x1a\xd7\x86S\xdc\xf8\xffz'\xf5\xd3"; +} +impl soroban_sdk::spec_shaking::SpecShakingMarker for UsedAuthErrorEnum { + #[doc(hidden)] + #[inline(always)] + fn spec_shaking_marker() {} +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDAUTHERRORENUM: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"=V\x92A(\x981\x88\xf58\xbe\x9e5*+\xf5>J\x9c\x88&\x1a\xd7\x86S\xdc\xf8\xffz'\xf5\xd3", + [], + ); +impl TryFrom for UsedAuthErrorEnum { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: soroban_sdk::Error) -> Result { + if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { + let discriminant = error.get_code(); + Ok(match discriminant { + 1u32 => Self::NotFound, + 2u32 => Self::Invalid, + _ => return Err(error), + }) + } else { + Err(error) + } + } +} +impl TryFrom<&soroban_sdk::Error> for UsedAuthErrorEnum { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: &soroban_sdk::Error) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::Error { + #[inline(always)] + fn from(val: UsedAuthErrorEnum) -> soroban_sdk::Error { + <_ as From<&UsedAuthErrorEnum>>::from(&val) + } +} +impl From<&UsedAuthErrorEnum> for soroban_sdk::Error { + #[inline(always)] + fn from(val: &UsedAuthErrorEnum) -> soroban_sdk::Error { + match val { + UsedAuthErrorEnum::NotFound => soroban_sdk::Error::from_contract_error(1u32), + UsedAuthErrorEnum::Invalid => soroban_sdk::Error::from_contract_error(2u32), + } + } +} +impl TryFrom for UsedAuthErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: soroban_sdk::InvokeError) -> Result { + match error { + soroban_sdk::InvokeError::Abort => Err(error), + soroban_sdk::InvokeError::Contract(code) => Ok(match code { + 1u32 => Self::NotFound, + 2u32 => Self::Invalid, + _ => return Err(error), + }), + } + } +} +impl TryFrom<&soroban_sdk::InvokeError> for UsedAuthErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: &soroban_sdk::InvokeError) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: UsedAuthErrorEnum) -> soroban_sdk::InvokeError { + <_ as From<&UsedAuthErrorEnum>>::from(&val) + } +} +impl From<&UsedAuthErrorEnum> for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: &UsedAuthErrorEnum) -> soroban_sdk::InvokeError { + match val { + UsedAuthErrorEnum::NotFound => soroban_sdk::InvokeError::Contract(1u32), + UsedAuthErrorEnum::Invalid => soroban_sdk::InvokeError::Contract(2u32), + } + } +} +impl soroban_sdk::TryFromVal for UsedAuthErrorEnum { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let error: soroban_sdk::Error = val.try_into_val(env)?; + error.try_into().map_err(|_| soroban_sdk::ConversionError) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedAuthErrorEnum, + ) -> Result { + let error: soroban_sdk::Error = val.into(); + Ok(error.into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedAuthErrorEnum, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +pub enum UsedPanicErrorEnum { + Boom = 1, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedPanicErrorEnum {} +#[automatically_derived] +impl ::core::clone::Clone for UsedPanicErrorEnum { + #[inline] + fn clone(&self) -> UsedPanicErrorEnum { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedPanicErrorEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str(f, "Boom") + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedPanicErrorEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedPanicErrorEnum {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedPanicErrorEnum { + #[inline] + fn eq(&self, other: &UsedPanicErrorEnum) -> bool { + true + } +} +pub static __SPEC_XDR_TYPE_USEDPANICERRORENUM: [u8; 56usize] = UsedPanicErrorEnum::spec_xdr(); +impl UsedPanicErrorEnum { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x12UsedPanicErrorEnum\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04Boom\0\0\0\x01" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedPanicErrorEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"\r\xb76\xae\x93D\xef\x1aa\xb8\x95\x90\xd0\x15\xf7\x9aq]\x18w\x11\x92-\x99\x8e\n\x11\xfe\xe2sdQ"; +} +impl soroban_sdk::spec_shaking::SpecShakingMarker for UsedPanicErrorEnum { + #[doc(hidden)] + #[inline(always)] + fn spec_shaking_marker() {} +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDPANICERRORENUM: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\r\xb76\xae\x93D\xef\x1aa\xb8\x95\x90\xd0\x15\xf7\x9aq]\x18w\x11\x92-\x99\x8e\n\x11\xfe\xe2sdQ", + [], +); +impl TryFrom for UsedPanicErrorEnum { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: soroban_sdk::Error) -> Result { + if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { + let discriminant = error.get_code(); + Ok(match discriminant { + 1u32 => Self::Boom, + _ => return Err(error), + }) + } else { + Err(error) + } + } +} +impl TryFrom<&soroban_sdk::Error> for UsedPanicErrorEnum { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: &soroban_sdk::Error) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::Error { + #[inline(always)] + fn from(val: UsedPanicErrorEnum) -> soroban_sdk::Error { + <_ as From<&UsedPanicErrorEnum>>::from(&val) + } +} +impl From<&UsedPanicErrorEnum> for soroban_sdk::Error { + #[inline(always)] + fn from(val: &UsedPanicErrorEnum) -> soroban_sdk::Error { + match val { + UsedPanicErrorEnum::Boom => soroban_sdk::Error::from_contract_error(1u32), + } + } +} +impl TryFrom for UsedPanicErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: soroban_sdk::InvokeError) -> Result { + match error { + soroban_sdk::InvokeError::Abort => Err(error), + soroban_sdk::InvokeError::Contract(code) => Ok(match code { + 1u32 => Self::Boom, + _ => return Err(error), + }), + } + } +} +impl TryFrom<&soroban_sdk::InvokeError> for UsedPanicErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: &soroban_sdk::InvokeError) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: UsedPanicErrorEnum) -> soroban_sdk::InvokeError { + <_ as From<&UsedPanicErrorEnum>>::from(&val) + } +} +impl From<&UsedPanicErrorEnum> for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: &UsedPanicErrorEnum) -> soroban_sdk::InvokeError { + match val { + UsedPanicErrorEnum::Boom => soroban_sdk::InvokeError::Contract(1u32), + } + } +} +impl soroban_sdk::TryFromVal for UsedPanicErrorEnum { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let error: soroban_sdk::Error = val.try_into_val(env)?; + error.try_into().map_err(|_| soroban_sdk::ConversionError) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedPanicErrorEnum, + ) -> Result { + let error: soroban_sdk::Error = val.into(); + Ok(error.into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedPanicErrorEnum, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +pub enum UsedPanicErrorEnumRef { + Boom = 1, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedPanicErrorEnumRef {} +#[automatically_derived] +impl ::core::clone::Clone for UsedPanicErrorEnumRef { + #[inline] + fn clone(&self) -> UsedPanicErrorEnumRef { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedPanicErrorEnumRef { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str(f, "Boom") + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedPanicErrorEnumRef { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedPanicErrorEnumRef {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedPanicErrorEnumRef { + #[inline] + fn eq(&self, other: &UsedPanicErrorEnumRef) -> bool { + true + } +} +pub static __SPEC_XDR_TYPE_USEDPANICERRORENUMREF: [u8; 60usize] = UsedPanicErrorEnumRef::spec_xdr(); +impl UsedPanicErrorEnumRef { + pub const fn spec_xdr() -> [u8; 60usize] { + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x15UsedPanicErrorEnumRef\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04Boom\0\0\0\x01" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedPanicErrorEnumRef { + const SPEC_TYPE_ID: [u8; 32] = *b"!v\x9b\xbb<\xd2\x9f\xc9\xfd|\x8e\xd7\x8f`\x80\xf9M\x8e\xb8\x98*l\xbfx\xce\xaa\xa6\n;i\x96x"; +} +impl soroban_sdk::spec_shaking::SpecShakingMarker for UsedPanicErrorEnumRef { + #[doc(hidden)] + #[inline(always)] + fn spec_shaking_marker() {} +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDPANICERRORENUMREF: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"!v\x9b\xbb<\xd2\x9f\xc9\xfd|\x8e\xd7\x8f`\x80\xf9M\x8e\xb8\x98*l\xbfx\xce\xaa\xa6\n;i\x96x", + [], +); +impl TryFrom for UsedPanicErrorEnumRef { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: soroban_sdk::Error) -> Result { + if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { + let discriminant = error.get_code(); + Ok(match discriminant { + 1u32 => Self::Boom, + _ => return Err(error), + }) + } else { + Err(error) + } + } +} +impl TryFrom<&soroban_sdk::Error> for UsedPanicErrorEnumRef { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: &soroban_sdk::Error) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::Error { + #[inline(always)] + fn from(val: UsedPanicErrorEnumRef) -> soroban_sdk::Error { + <_ as From<&UsedPanicErrorEnumRef>>::from(&val) + } +} +impl From<&UsedPanicErrorEnumRef> for soroban_sdk::Error { + #[inline(always)] + fn from(val: &UsedPanicErrorEnumRef) -> soroban_sdk::Error { + match val { + UsedPanicErrorEnumRef::Boom => soroban_sdk::Error::from_contract_error(1u32), + } + } +} +impl TryFrom for UsedPanicErrorEnumRef { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: soroban_sdk::InvokeError) -> Result { + match error { + soroban_sdk::InvokeError::Abort => Err(error), + soroban_sdk::InvokeError::Contract(code) => Ok(match code { + 1u32 => Self::Boom, + _ => return Err(error), + }), + } + } +} +impl TryFrom<&soroban_sdk::InvokeError> for UsedPanicErrorEnumRef { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: &soroban_sdk::InvokeError) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: UsedPanicErrorEnumRef) -> soroban_sdk::InvokeError { + <_ as From<&UsedPanicErrorEnumRef>>::from(&val) + } +} +impl From<&UsedPanicErrorEnumRef> for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: &UsedPanicErrorEnumRef) -> soroban_sdk::InvokeError { + match val { + UsedPanicErrorEnumRef::Boom => soroban_sdk::InvokeError::Contract(1u32), + } + } +} +impl soroban_sdk::TryFromVal for UsedPanicErrorEnumRef { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let error: soroban_sdk::Error = val.try_into_val(env)?; + error.try_into().map_err(|_| soroban_sdk::ConversionError) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedPanicErrorEnumRef, + ) -> Result { + let error: soroban_sdk::Error = val.into(); + Ok(error.into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedPanicErrorEnumRef, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +pub enum UsedAssertErrorEnum { + Bad = 1, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedAssertErrorEnum {} +#[automatically_derived] +impl ::core::clone::Clone for UsedAssertErrorEnum { + #[inline] + fn clone(&self) -> UsedAssertErrorEnum { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedAssertErrorEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str(f, "Bad") + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedAssertErrorEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedAssertErrorEnum {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedAssertErrorEnum { + #[inline] + fn eq(&self, other: &UsedAssertErrorEnum) -> bool { + true + } +} +pub static __SPEC_XDR_TYPE_USEDASSERTERRORENUM: [u8; 56usize] = UsedAssertErrorEnum::spec_xdr(); +impl UsedAssertErrorEnum { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x13UsedAssertErrorEnum\0\0\0\0\x01\0\0\0\0\0\0\0\x03Bad\0\0\0\0\x01" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedAssertErrorEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"\x8b\x89\x1f#\xbd\x157\xf4Gx\xa2a\x0ehQ\xe4\xdd\x02O0\x0b\x96\xeb\x0f\xb6\0\xa3\x91)\xf9;\x19"; +} +impl soroban_sdk::spec_shaking::SpecShakingMarker for UsedAssertErrorEnum { + #[doc(hidden)] + #[inline(always)] + fn spec_shaking_marker() {} +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDASSERTERRORENUM: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\x8b\x89\x1f#\xbd\x157\xf4Gx\xa2a\x0ehQ\xe4\xdd\x02O0\x0b\x96\xeb\x0f\xb6\0\xa3\x91)\xf9;\x19", + [], +); +impl TryFrom for UsedAssertErrorEnum { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: soroban_sdk::Error) -> Result { + if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { + let discriminant = error.get_code(); + Ok(match discriminant { + 1u32 => Self::Bad, + _ => return Err(error), + }) + } else { + Err(error) + } + } +} +impl TryFrom<&soroban_sdk::Error> for UsedAssertErrorEnum { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: &soroban_sdk::Error) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::Error { + #[inline(always)] + fn from(val: UsedAssertErrorEnum) -> soroban_sdk::Error { + <_ as From<&UsedAssertErrorEnum>>::from(&val) + } +} +impl From<&UsedAssertErrorEnum> for soroban_sdk::Error { + #[inline(always)] + fn from(val: &UsedAssertErrorEnum) -> soroban_sdk::Error { + match val { + UsedAssertErrorEnum::Bad => soroban_sdk::Error::from_contract_error(1u32), + } + } +} +impl TryFrom for UsedAssertErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: soroban_sdk::InvokeError) -> Result { + match error { + soroban_sdk::InvokeError::Abort => Err(error), + soroban_sdk::InvokeError::Contract(code) => Ok(match code { + 1u32 => Self::Bad, + _ => return Err(error), + }), + } + } +} +impl TryFrom<&soroban_sdk::InvokeError> for UsedAssertErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: &soroban_sdk::InvokeError) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: UsedAssertErrorEnum) -> soroban_sdk::InvokeError { + <_ as From<&UsedAssertErrorEnum>>::from(&val) + } +} +impl From<&UsedAssertErrorEnum> for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: &UsedAssertErrorEnum) -> soroban_sdk::InvokeError { + match val { + UsedAssertErrorEnum::Bad => soroban_sdk::InvokeError::Contract(1u32), + } + } +} +impl soroban_sdk::TryFromVal for UsedAssertErrorEnum { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let error: soroban_sdk::Error = val.try_into_val(env)?; + error.try_into().map_err(|_| soroban_sdk::ConversionError) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedAssertErrorEnum, + ) -> Result { + let error: soroban_sdk::Error = val.into(); + Ok(error.into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedAssertErrorEnum, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +pub struct UsedNestedInStruct { + pub val: i64, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedNestedInStruct { + #[inline] + fn clone(&self) -> UsedNestedInStruct { + UsedNestedInStruct { + val: ::core::clone::Clone::clone(&self.val), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedNestedInStruct { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedNestedInStruct", + "val", + &&self.val, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedNestedInStruct { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedNestedInStruct {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedNestedInStruct { + #[inline] + fn eq(&self, other: &UsedNestedInStruct) -> bool { + self.val == other.val + } +} +pub static __SPEC_XDR_TYPE_USEDNESTEDINSTRUCT: [u8; 56usize] = UsedNestedInStruct::spec_xdr(); +impl UsedNestedInStruct { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedNestedInStruct\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x07" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedNestedInStruct { + const SPEC_TYPE_ID: [u8; 32] = *b"\x84\x08Y\xae\xa0\xf128\x93a\xcd\xa3\x96yv\rTB\xfb/\x85\xee\x8e?\x01\x9fp\x91\x01U\x12\x83"; +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDNESTEDINSTRUCT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\x84\x08Y\xae\xa0\xf128\x93a\xcd\xa3\x96yv\rTB\xfb/\x85\xee\x8e?\x01\x9fp\x91\x01U\x12\x83", + [], +); +impl soroban_sdk::TryFromVal for UsedNestedInStruct { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedNestedInStruct, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedNestedInStruct, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +impl soroban_sdk::TryFromVal for UsedNestedInStruct { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + val: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "val" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } +} +impl soroban_sdk::TryFromVal for UsedNestedInStruct { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryFrom<&UsedNestedInStruct> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedNestedInStruct) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "val" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.val) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } +} +impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedNestedInStruct) -> Result { + (&val).try_into() + } +} +impl TryFrom<&UsedNestedInStruct> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedNestedInStruct) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedNestedInStruct) -> Result { + (&val).try_into() + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryUsedNestedInStruct { + val: ::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUsedNestedInStruct { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "ArbitraryUsedNestedInStruct", + "val", + &&self.val, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUsedNestedInStruct { + #[inline] + fn clone(&self) -> ArbitraryUsedNestedInStruct { + ArbitraryUsedNestedInStruct { + val: ::core::clone::Clone::clone(&self.val), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUsedNestedInStruct { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUsedNestedInStruct {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUsedNestedInStruct { + #[inline] + fn eq(&self, other: &ArbitraryUsedNestedInStruct) -> bool { + self.val == other.val + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUsedNestedInStruct { + #[inline] + fn cmp(&self, other: &ArbitraryUsedNestedInStruct) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.val, &other.val) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUsedNestedInStruct { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUsedNestedInStruct, + ) -> ::core::option::Option<::core::cmp::Ordering> { + ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUsedNestedInStruct: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedNestedInStruct { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedNestedInStruct.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedNestedInStruct { + val: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedNestedInStruct.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedNestedInStruct.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedNestedInStruct { + val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedNestedInStruct.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedNestedInStruct { + type Prototype = ArbitraryUsedNestedInStruct; + } + impl soroban_sdk::TryFromVal for UsedNestedInStruct { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedNestedInStruct, + ) -> std::result::Result { + Ok(UsedNestedInStruct { + val: soroban_sdk::IntoVal::into_val(&v.val, env), + }) + } + } +}; +pub struct UsedVecElement { + pub data: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedVecElement { + #[inline] + fn clone(&self) -> UsedVecElement { + UsedVecElement { + data: ::core::clone::Clone::clone(&self.data), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedVecElement { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedVecElement", "data", &&self.data) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedVecElement { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedVecElement {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedVecElement { + #[inline] + fn eq(&self, other: &UsedVecElement) -> bool { + self.data == other.data + } +} +pub static __SPEC_XDR_TYPE_USEDVECELEMENT: [u8; 52usize] = UsedVecElement::spec_xdr(); +impl UsedVecElement { + pub const fn spec_xdr() -> [u8; 52usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0eUsedVecElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedVecElement { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xe2\x01y\xc9\x9a\xf8\xedt%\xbcu\xa0\x89 \xbc \x8e\xa2!\xe5H\xa5\xf6r\xa9DK6/\xe7]6"; +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDVECELEMENT: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xe2\x01y\xc9\x9a\xf8\xedt%\xbcu\xa0\x89 \xbc \x8e\xa2!\xe5H\xa5\xf6r\xa9DK6/\xe7]6", + [], + ); +impl soroban_sdk::TryFromVal for UsedVecElement { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + data: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedVecElement, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedVecElement, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +impl soroban_sdk::TryFromVal for UsedVecElement { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + data: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "data" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } +} +impl soroban_sdk::TryFromVal for UsedVecElement { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryFrom<&UsedVecElement> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedVecElement) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "data" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.data) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } +} +impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedVecElement) -> Result { + (&val).try_into() + } +} +impl TryFrom<&UsedVecElement> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedVecElement) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedVecElement) -> Result { + (&val).try_into() + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryUsedVecElement { + data: ::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUsedVecElement { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "ArbitraryUsedVecElement", + "data", + &&self.data, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUsedVecElement { + #[inline] + fn clone(&self) -> ArbitraryUsedVecElement { + ArbitraryUsedVecElement { + data: ::core::clone::Clone::clone(&self.data), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUsedVecElement { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUsedVecElement {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUsedVecElement { + #[inline] + fn eq(&self, other: &ArbitraryUsedVecElement) -> bool { + self.data == other.data + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUsedVecElement { + #[inline] + fn cmp(&self, other: &ArbitraryUsedVecElement) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.data, &other.data) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUsedVecElement { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUsedVecElement, + ) -> ::core::option::Option<::core::cmp::Ordering> { + ::core::cmp::PartialOrd::partial_cmp(&self.data, &other.data) + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUsedVecElement: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedVecElement { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedVecElement.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedVecElement { + data: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedVecElement.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedVecElement.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedVecElement { + data: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedVecElement.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedVecElement { + type Prototype = ArbitraryUsedVecElement; + } + impl soroban_sdk::TryFromVal for UsedVecElement { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedVecElement, + ) -> std::result::Result { + Ok(UsedVecElement { + data: soroban_sdk::IntoVal::into_val(&v.data, env), + }) + } + } +}; +pub enum UsedMapKey { + K1 = 1, + K2 = 2, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedMapKey {} +#[automatically_derived] +impl ::core::clone::Clone for UsedMapKey { + #[inline] + fn clone(&self) -> UsedMapKey { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedMapKey { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + UsedMapKey::K1 => "K1", + UsedMapKey::K2 => "K2", + }, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedMapKey { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedMapKey {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedMapKey { + #[inline] + fn eq(&self, other: &UsedMapKey) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } +} +pub static __SPEC_XDR_TYPE_USEDMAPKEY: [u8; 64usize] = UsedMapKey::spec_xdr(); +impl UsedMapKey { + pub const fn spec_xdr() -> [u8; 64usize] { + *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\nUsedMapKey\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02K1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02K2\0\0\0\0\0\x02" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedMapKey { + const SPEC_TYPE_ID: [u8; 32] = *b"[\xf4R\xdf\xdd\xb4\xb0\xbc\xe0\x96b:H\xc4\xda\xe4'\xee@\xd9\x1e\xf5!\x8aa\xf3hT$\xad\0\xcd"; +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDMAPKEY: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"[\xf4R\xdf\xdd\xb4\xb0\xbc\xe0\x96b:H\xc4\xda\xe4'\xee@\xd9\x1e\xf5!\x8aa\xf3hT$\xad\0\xcd", + [], +); +impl soroban_sdk::TryFromVal for UsedMapKey { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let discriminant: u32 = val.try_into_val(env)?; + Ok(match discriminant { + 1u32 => Self::K1, + 2u32 => Self::K2, + _ => Err(soroban_sdk::ConversionError {})?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedMapKey, + ) -> Result { + Ok(match val { + UsedMapKey::K1 => 1u32.into(), + UsedMapKey::K2 => 2u32.into(), + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedMapKey, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +impl soroban_sdk::TryFromVal for UsedMapKey { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::U32(discriminant) = val { + Ok(match *discriminant { + 1u32 => Self::K1, + 2u32 => Self::K2, + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryInto for &UsedMapKey { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_into(self) -> Result { + Ok(match self { + UsedMapKey::K1 => 1u32.into(), + UsedMapKey::K2 => 2u32.into(), + }) + } +} +impl TryInto for UsedMapKey { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_into(self) -> Result { + Ok(match self { + UsedMapKey::K1 => 1u32.into(), + UsedMapKey::K2 => 2u32.into(), + }) + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryUsedMapKey { + K1, + K2, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUsedMapKey { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + ArbitraryUsedMapKey::K1 => "K1", + ArbitraryUsedMapKey::K2 => "K2", + }, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUsedMapKey { + #[inline] + fn clone(&self) -> ArbitraryUsedMapKey { + match self { + ArbitraryUsedMapKey::K1 => ArbitraryUsedMapKey::K1, + ArbitraryUsedMapKey::K2 => ArbitraryUsedMapKey::K2, + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUsedMapKey { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUsedMapKey {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUsedMapKey { + #[inline] + fn eq(&self, other: &ArbitraryUsedMapKey) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUsedMapKey { + #[inline] + fn cmp(&self, other: &ArbitraryUsedMapKey) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUsedMapKey { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUsedMapKey, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr) + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUsedMapKey: ::std::thread::LocalKey> = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedMapKey { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedMapKey.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) * 2u64) >> 32 + { + 0u64 => ArbitraryUsedMapKey::K1, + 1u64 => ArbitraryUsedMapKey::K2, + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedMapKey.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedMapKey.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) * 2u64) + >> 32 + { + 0u64 => ArbitraryUsedMapKey::K1, + 1u64 => ArbitraryUsedMapKey::K2, + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedMapKey.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all(&[ + arbitrary::size_hint::and_all(&[]), + arbitrary::size_hint::and_all(&[]), + ]) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedMapKey { + type Prototype = ArbitraryUsedMapKey; + } + impl soroban_sdk::TryFromVal for UsedMapKey { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedMapKey, + ) -> std::result::Result { + Ok(match v { + ArbitraryUsedMapKey::K1 => UsedMapKey::K1, + ArbitraryUsedMapKey::K2 => UsedMapKey::K2, + }) + } + } +}; +pub struct UsedMapVal { + pub v: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedMapVal { + #[inline] + fn clone(&self) -> UsedMapVal { + UsedMapVal { + v: ::core::clone::Clone::clone(&self.v), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedMapVal { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedMapVal", "v", &&self.v) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedMapVal { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedMapVal {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedMapVal { + #[inline] + fn eq(&self, other: &UsedMapVal) -> bool { + self.v == other.v + } +} +pub static __SPEC_XDR_TYPE_USEDMAPVAL: [u8; 48usize] = UsedMapVal::spec_xdr(); +impl UsedMapVal { + pub const fn spec_xdr() -> [u8; 48usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\nUsedMapVal\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x04" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedMapVal { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xaaX8\xde\xef\xbb6%\xb2\xe5DxT\xd07Jk\x12\xd3\x97<\xc5b\x1c\x9f'\xd7\x85\x98\x1e\x1dX"; +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDMAPVAL: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xaaX8\xde\xef\xbb6%\xb2\xe5DxT\xd07Jk\x12\xd3\x97<\xc5b\x1c\x9f'\xd7\x85\x98\x1e\x1dX", + [], + ); +impl soroban_sdk::TryFromVal for UsedMapVal { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["v"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + v: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedMapVal, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["v"]; + let vals: [Val; 1usize] = [(&val.v).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedMapVal, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +impl soroban_sdk::TryFromVal for UsedMapVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + v: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "v".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } +} +impl soroban_sdk::TryFromVal for UsedMapVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryFrom<&UsedMapVal> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedMapVal) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "v".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.v) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } +} +impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedMapVal) -> Result { + (&val).try_into() + } +} +impl TryFrom<&UsedMapVal> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedMapVal) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedMapVal) -> Result { + (&val).try_into() + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryUsedMapVal { + v: ::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUsedMapVal { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "ArbitraryUsedMapVal", + "v", + &&self.v, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUsedMapVal { + #[inline] + fn clone(&self) -> ArbitraryUsedMapVal { + ArbitraryUsedMapVal { + v: ::core::clone::Clone::clone(&self.v), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUsedMapVal { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUsedMapVal {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUsedMapVal { + #[inline] + fn eq(&self, other: &ArbitraryUsedMapVal) -> bool { + self.v == other.v + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUsedMapVal { + #[inline] + fn cmp(&self, other: &ArbitraryUsedMapVal) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.v, &other.v) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUsedMapVal { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUsedMapVal, + ) -> ::core::option::Option<::core::cmp::Ordering> { + ::core::cmp::PartialOrd::partial_cmp(&self.v, &other.v) + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUsedMapVal: ::std::thread::LocalKey> = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedMapVal { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedMapVal.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedMapVal { + v: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedMapVal.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedMapVal.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedMapVal { + v: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedMapVal.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedMapVal { + type Prototype = ArbitraryUsedMapVal; + } + impl soroban_sdk::TryFromVal for UsedMapVal { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedMapVal, + ) -> std::result::Result { + Ok(UsedMapVal { + v: soroban_sdk::IntoVal::into_val(&v.v, env), + }) + } + } +}; +pub struct UsedOptionElement { + pub data: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedOptionElement { + #[inline] + fn clone(&self) -> UsedOptionElement { + UsedOptionElement { + data: ::core::clone::Clone::clone(&self.data), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedOptionElement { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedOptionElement", + "data", + &&self.data, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedOptionElement { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedOptionElement {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedOptionElement { + #[inline] + fn eq(&self, other: &UsedOptionElement) -> bool { + self.data == other.data + } +} +pub static __SPEC_XDR_TYPE_USEDOPTIONELEMENT: [u8; 56usize] = UsedOptionElement::spec_xdr(); +impl UsedOptionElement { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedOptionElement\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedOptionElement { + const SPEC_TYPE_ID: [u8; 32] = *b"\xb3/\x97\xd5\x06\xbd3Bb\xd9\xac\xadF\0\xb4v\xad\x10<\xc2\xfb\xaf\x97\xf4fy1\xc1,\xba\x07\xa9"; +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDOPTIONELEMENT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\xb3/\x97\xd5\x06\xbd3Bb\xd9\xac\xadF\0\xb4v\xad\x10<\xc2\xfb\xaf\x97\xf4fy1\xc1,\xba\x07\xa9", + [], +); +impl soroban_sdk::TryFromVal for UsedOptionElement { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + data: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedOptionElement, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedOptionElement, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +impl soroban_sdk::TryFromVal for UsedOptionElement { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + data: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "data" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } +} +impl soroban_sdk::TryFromVal for UsedOptionElement { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryFrom<&UsedOptionElement> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedOptionElement) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "data" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.data) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } +} +impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedOptionElement) -> Result { + (&val).try_into() + } +} +impl TryFrom<&UsedOptionElement> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedOptionElement) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedOptionElement) -> Result { + (&val).try_into() + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryUsedOptionElement { + data: ::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUsedOptionElement { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "ArbitraryUsedOptionElement", + "data", + &&self.data, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUsedOptionElement { + #[inline] + fn clone(&self) -> ArbitraryUsedOptionElement { + ArbitraryUsedOptionElement { + data: ::core::clone::Clone::clone(&self.data), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUsedOptionElement { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUsedOptionElement {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUsedOptionElement { + #[inline] + fn eq(&self, other: &ArbitraryUsedOptionElement) -> bool { + self.data == other.data + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUsedOptionElement { + #[inline] + fn cmp(&self, other: &ArbitraryUsedOptionElement) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.data, &other.data) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUsedOptionElement { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUsedOptionElement, + ) -> ::core::option::Option<::core::cmp::Ordering> { + ::core::cmp::PartialOrd::partial_cmp(&self.data, &other.data) + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUsedOptionElement: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedOptionElement { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedOptionElement.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedOptionElement { + data: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedOptionElement.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedOptionElement.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedOptionElement { + data: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedOptionElement.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedOptionElement { + type Prototype = ArbitraryUsedOptionElement; + } + impl soroban_sdk::TryFromVal for UsedOptionElement { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedOptionElement, + ) -> std::result::Result { + Ok(UsedOptionElement { + data: soroban_sdk::IntoVal::into_val(&v.data, env), + }) + } + } +}; +pub struct UsedResultOk { + pub data: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedResultOk { + #[inline] + fn clone(&self) -> UsedResultOk { + UsedResultOk { + data: ::core::clone::Clone::clone(&self.data), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedResultOk { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedResultOk", "data", &&self.data) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedResultOk { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedResultOk {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedResultOk { + #[inline] + fn eq(&self, other: &UsedResultOk) -> bool { + self.data == other.data + } +} +pub static __SPEC_XDR_TYPE_USEDRESULTOK: [u8; 48usize] = UsedResultOk::spec_xdr(); +impl UsedResultOk { + pub const fn spec_xdr() -> [u8; 48usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0cUsedResultOk\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedResultOk { + const SPEC_TYPE_ID: [u8; 32] = *b"k\xe4zxB\xd1+\x02\xad\x01R\xc2\xd1\xb9:\x9d\x8e\xb2\xfb~\xee\xf9\x80\x156\x90 \x02\\x\xe2\xe1"; +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDRESULTOK: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"k\xe4zxB\xd1+\x02\xad\x01R\xc2\xd1\xb9:\x9d\x8e\xb2\xfb~\xee\xf9\x80\x156\x90 \x02\\x\xe2\xe1", + [], +); +impl soroban_sdk::TryFromVal for UsedResultOk { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + data: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedResultOk, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedResultOk, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +impl soroban_sdk::TryFromVal for UsedResultOk { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + data: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "data" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } +} +impl soroban_sdk::TryFromVal for UsedResultOk { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryFrom<&UsedResultOk> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedResultOk) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "data" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.data) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } +} +impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedResultOk) -> Result { + (&val).try_into() + } +} +impl TryFrom<&UsedResultOk> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedResultOk) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedResultOk) -> Result { + (&val).try_into() + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryUsedResultOk { + data: ::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUsedResultOk { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "ArbitraryUsedResultOk", + "data", + &&self.data, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUsedResultOk { + #[inline] + fn clone(&self) -> ArbitraryUsedResultOk { + ArbitraryUsedResultOk { + data: ::core::clone::Clone::clone(&self.data), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUsedResultOk { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUsedResultOk {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUsedResultOk { + #[inline] + fn eq(&self, other: &ArbitraryUsedResultOk) -> bool { + self.data == other.data + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUsedResultOk { + #[inline] + fn cmp(&self, other: &ArbitraryUsedResultOk) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.data, &other.data) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUsedResultOk { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUsedResultOk, + ) -> ::core::option::Option<::core::cmp::Ordering> { + ::core::cmp::PartialOrd::partial_cmp(&self.data, &other.data) + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUsedResultOk: ::std::thread::LocalKey> = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedResultOk { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedResultOk.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedResultOk { + data: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedResultOk.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedResultOk.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUsedResultOk { + data: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedResultOk.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedResultOk { + type Prototype = ArbitraryUsedResultOk; + } + impl soroban_sdk::TryFromVal for UsedResultOk { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedResultOk, + ) -> std::result::Result { + Ok(UsedResultOk { + data: soroban_sdk::IntoVal::into_val(&v.data, env), + }) + } + } +}; +pub struct CustomSignature { + pub nonce: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for CustomSignature { + #[inline] + fn clone(&self) -> CustomSignature { + CustomSignature { + nonce: ::core::clone::Clone::clone(&self.nonce), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for CustomSignature { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "CustomSignature", + "nonce", + &&self.nonce, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for CustomSignature { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for CustomSignature {} +#[automatically_derived] +impl ::core::cmp::PartialEq for CustomSignature { + #[inline] + fn eq(&self, other: &CustomSignature) -> bool { + self.nonce == other.nonce + } +} +pub static __SPEC_XDR_TYPE_CUSTOMSIGNATURE: [u8; 56usize] = CustomSignature::spec_xdr(); +impl CustomSignature { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fCustomSignature\0\0\0\0\x01\0\0\0\0\0\0\0\x05nonce\0\0\0\0\0\0\x04" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for CustomSignature { + const SPEC_TYPE_ID: [u8; 32] = *b"6\xb3\x0f\xc2\xa9\r\x8a\xe1\xb2\xd9\x87Gc\x0ed\x89\xe7i\\\xef\x88\x07\xfc\"\xd8\x10\x97*$\xbc]&"; +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_CUSTOMSIGNATURE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"6\xb3\x0f\xc2\xa9\r\x8a\xe1\xb2\xd9\x87Gc\x0ed\x89\xe7i\\\xef\x88\x07\xfc\"\xd8\x10\x97*$\xbc]&", + [], +); +impl soroban_sdk::TryFromVal for CustomSignature { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["nonce"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + nonce: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &CustomSignature, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["nonce"]; + let vals: [Val; 1usize] = [(&val.nonce) + .try_into_val(env) + .map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&CustomSignature, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +impl soroban_sdk::TryFromVal for CustomSignature { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + nonce: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "nonce" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } +} +impl soroban_sdk::TryFromVal for CustomSignature { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryFrom<&CustomSignature> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &CustomSignature) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "nonce" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.nonce) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } +} +impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: CustomSignature) -> Result { + (&val).try_into() + } +} +impl TryFrom<&CustomSignature> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &CustomSignature) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: CustomSignature) -> Result { + (&val).try_into() + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryCustomSignature { + nonce: ::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryCustomSignature { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "ArbitraryCustomSignature", + "nonce", + &&self.nonce, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryCustomSignature { + #[inline] + fn clone(&self) -> ArbitraryCustomSignature { + ArbitraryCustomSignature { + nonce: ::core::clone::Clone::clone(&self.nonce), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryCustomSignature { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryCustomSignature {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryCustomSignature { + #[inline] + fn eq(&self, other: &ArbitraryCustomSignature) -> bool { + self.nonce == other.nonce + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryCustomSignature { + #[inline] + fn cmp(&self, other: &ArbitraryCustomSignature) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.nonce, &other.nonce) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryCustomSignature { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryCustomSignature, + ) -> ::core::option::Option<::core::cmp::Ordering> { + ::core::cmp::PartialOrd::partial_cmp(&self.nonce, &other.nonce) + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryCustomSignature: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryCustomSignature { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCustomSignature.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryCustomSignature { + nonce: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCustomSignature.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCustomSignature.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryCustomSignature { + nonce: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCustomSignature.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for CustomSignature { + type Prototype = ArbitraryCustomSignature; + } + impl soroban_sdk::TryFromVal for CustomSignature { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryCustomSignature, + ) -> std::result::Result { + Ok(CustomSignature { + nonce: soroban_sdk::IntoVal::into_val(&v.nonce, env), + }) + } + } +}; +pub struct UsedEventSimple { + pub kind: Symbol, + pub amount: i128, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventSimple { + #[inline] + fn clone(&self) -> UsedEventSimple { + UsedEventSimple { + kind: ::core::clone::Clone::clone(&self.kind), + amount: ::core::clone::Clone::clone(&self.amount), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventSimple { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UsedEventSimple", + "kind", + &self.kind, + "amount", + &&self.amount, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventSimple { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventSimple {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventSimple { + #[inline] + fn eq(&self, other: &UsedEventSimple) -> bool { + self.amount == other.amount && self.kind == other.kind + } +} +pub static __SPEC_XDR_EVENT_USEDEVENTSIMPLE: [u8; 112usize] = UsedEventSimple::spec_xdr(); +impl UsedEventSimple { + pub const fn spec_xdr() -> [u8; 112usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x0fUsedEventSimple\0\0\0\0\x01\0\0\0\x11used_event_simple\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" + } +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_EVENT_USEDEVENTSIMPLE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 1, + *b"v1\x0eP\xa9C\xc7*\xce\xf5\x10\x1d\xb2\xaeFR|\n\x1e\x88\x8bB~\x8e\xc3\xb8\xdf\x1b\xd1\x0cx\xeb", + [], +); +impl soroban_sdk::Event for UsedEventSimple { + fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { + use soroban_sdk::IntoVal; + (&{ soroban_sdk::Symbol::new(env, "used_event_simple") }, { + let v: soroban_sdk::Val = self.kind.into_val(env); + v + }) + .into_val(env) + } + fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { + use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; + const KEYS: [&'static str; 1usize] = ["amount"]; + let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; + env.map_new_from_slices(&KEYS, &vals) + .unwrap_infallible() + .into() + } +} +impl UsedEventSimple { + pub fn publish(&self, env: &soroban_sdk::Env) { + <_ as soroban_sdk::Event>::publish(self, env); + } +} +pub enum UsedEventTopicType { + Transfer = 1, + Mint = 2, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedEventTopicType {} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventTopicType { + #[inline] + fn clone(&self) -> UsedEventTopicType { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventTopicType { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + UsedEventTopicType::Transfer => "Transfer", + UsedEventTopicType::Mint => "Mint", + }, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventTopicType { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventTopicType {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventTopicType { + #[inline] + fn eq(&self, other: &UsedEventTopicType) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } +} +pub static __SPEC_XDR_TYPE_USEDEVENTTOPICTYPE: [u8; 76usize] = UsedEventTopicType::spec_xdr(); +impl UsedEventTopicType { + pub const fn spec_xdr() -> [u8; 76usize] { + *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventTopicType\0\0\0\0\0\x02\0\0\0\0\0\0\0\x08Transfer\0\0\0\x01\0\0\0\0\0\0\0\x04Mint\0\0\0\x02" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedEventTopicType { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xf5\xd4\x9b\xa3\xccI\x13\xf7\xbf7!\xf53\"u\xb3a\xe3\x1e0\xcdc?P5Zh\xdb\xcc\xb5\x81\xf6"; +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDEVENTTOPICTYPE: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xf5\xd4\x9b\xa3\xccI\x13\xf7\xbf7!\xf53\"u\xb3a\xe3\x1e0\xcdc?P5Zh\xdb\xcc\xb5\x81\xf6", + [], + ); +impl soroban_sdk::TryFromVal for UsedEventTopicType { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let discriminant: u32 = val.try_into_val(env)?; + Ok(match discriminant { + 1u32 => Self::Transfer, + 2u32 => Self::Mint, + _ => Err(soroban_sdk::ConversionError {})?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedEventTopicType, + ) -> Result { + Ok(match val { + UsedEventTopicType::Transfer => 1u32.into(), + UsedEventTopicType::Mint => 2u32.into(), + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedEventTopicType, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +impl soroban_sdk::TryFromVal for UsedEventTopicType { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::U32(discriminant) = val { + Ok(match *discriminant { + 1u32 => Self::Transfer, + 2u32 => Self::Mint, + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryInto for &UsedEventTopicType { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_into(self) -> Result { + Ok(match self { + UsedEventTopicType::Transfer => 1u32.into(), + UsedEventTopicType::Mint => 2u32.into(), + }) + } +} +impl TryInto for UsedEventTopicType { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_into(self) -> Result { + Ok(match self { + UsedEventTopicType::Transfer => 1u32.into(), + UsedEventTopicType::Mint => 2u32.into(), + }) + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryUsedEventTopicType { + Transfer, + Mint, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUsedEventTopicType { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + ArbitraryUsedEventTopicType::Transfer => "Transfer", + ArbitraryUsedEventTopicType::Mint => "Mint", + }, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUsedEventTopicType { + #[inline] + fn clone(&self) -> ArbitraryUsedEventTopicType { + match self { + ArbitraryUsedEventTopicType::Transfer => ArbitraryUsedEventTopicType::Transfer, + ArbitraryUsedEventTopicType::Mint => ArbitraryUsedEventTopicType::Mint, + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUsedEventTopicType { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventTopicType {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUsedEventTopicType { + #[inline] + fn eq(&self, other: &ArbitraryUsedEventTopicType) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUsedEventTopicType { + #[inline] + fn cmp(&self, other: &ArbitraryUsedEventTopicType) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUsedEventTopicType { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUsedEventTopicType, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr) + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUsedEventTopicType: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventTopicType { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedEventTopicType.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) * 2u64) >> 32 + { + 0u64 => ArbitraryUsedEventTopicType::Transfer, + 1u64 => ArbitraryUsedEventTopicType::Mint, + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedEventTopicType.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedEventTopicType.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) * 2u64) + >> 32 + { + 0u64 => ArbitraryUsedEventTopicType::Transfer, + 1u64 => ArbitraryUsedEventTopicType::Mint, + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedEventTopicType.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all(&[ + arbitrary::size_hint::and_all(&[]), + arbitrary::size_hint::and_all(&[]), + ]) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventTopicType { + type Prototype = ArbitraryUsedEventTopicType; + } + impl soroban_sdk::TryFromVal for UsedEventTopicType { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedEventTopicType, + ) -> std::result::Result { + Ok(match v { + ArbitraryUsedEventTopicType::Transfer => UsedEventTopicType::Transfer, + ArbitraryUsedEventTopicType::Mint => UsedEventTopicType::Mint, }) - } else { - Err(error) } } +}; +pub struct UsedEventWithTopicType { + pub kind: UsedEventTopicType, + pub amount: i128, } -impl TryFrom<&soroban_sdk::Error> for UsedAssertErrorEnum { - type Error = soroban_sdk::Error; - #[inline(always)] - fn try_from(error: &soroban_sdk::Error) -> Result { - <_ as TryFrom>::try_from(*error) - } -} -impl From for soroban_sdk::Error { - #[inline(always)] - fn from(val: UsedAssertErrorEnum) -> soroban_sdk::Error { - <_ as From<&UsedAssertErrorEnum>>::from(&val) - } -} -impl From<&UsedAssertErrorEnum> for soroban_sdk::Error { - #[inline(always)] - fn from(val: &UsedAssertErrorEnum) -> soroban_sdk::Error { - match val { - UsedAssertErrorEnum::Bad => soroban_sdk::Error::from_contract_error(1u32), +#[automatically_derived] +impl ::core::clone::Clone for UsedEventWithTopicType { + #[inline] + fn clone(&self) -> UsedEventWithTopicType { + UsedEventWithTopicType { + kind: ::core::clone::Clone::clone(&self.kind), + amount: ::core::clone::Clone::clone(&self.amount), } } } -impl TryFrom for UsedAssertErrorEnum { - type Error = soroban_sdk::InvokeError; - #[inline(always)] - fn try_from(error: soroban_sdk::InvokeError) -> Result { - match error { - soroban_sdk::InvokeError::Abort => Err(error), - soroban_sdk::InvokeError::Contract(code) => Ok(match code { - 1u32 => Self::Bad, - _ => return Err(error), - }), - } +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventWithTopicType { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UsedEventWithTopicType", + "kind", + &self.kind, + "amount", + &&self.amount, + ) } } -impl TryFrom<&soroban_sdk::InvokeError> for UsedAssertErrorEnum { - type Error = soroban_sdk::InvokeError; - #[inline(always)] - fn try_from(error: &soroban_sdk::InvokeError) -> Result { - <_ as TryFrom>::try_from(*error) +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventWithTopicType { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } -impl From for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: UsedAssertErrorEnum) -> soroban_sdk::InvokeError { - <_ as From<&UsedAssertErrorEnum>>::from(&val) +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventWithTopicType {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventWithTopicType { + #[inline] + fn eq(&self, other: &UsedEventWithTopicType) -> bool { + self.amount == other.amount && self.kind == other.kind } } -impl From<&UsedAssertErrorEnum> for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: &UsedAssertErrorEnum) -> soroban_sdk::InvokeError { - match val { - UsedAssertErrorEnum::Bad => soroban_sdk::InvokeError::Contract(1u32), - } +pub static __SPEC_XDR_EVENT_USEDEVENTWITHTOPICTYPE: [u8; 152usize] = + UsedEventWithTopicType::spec_xdr(); +impl UsedEventWithTopicType { + pub const fn spec_xdr() -> [u8; 152usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x16UsedEventWithTopicType\0\0\0\0\0\x01\0\0\0\x1aused_event_with_topic_type\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\x07\xd0\0\0\0\x12UsedEventTopicType\0\0\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" } } -impl soroban_sdk::TryFromVal for UsedAssertErrorEnum { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &soroban_sdk::Val, - ) -> Result { - use soroban_sdk::TryIntoVal; - let error: soroban_sdk::Error = val.try_into_val(env)?; - error.try_into().map_err(|_| soroban_sdk::ConversionError) +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_EVENT_USEDEVENTWITHTOPICTYPE: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 1, + *b"q^\xe2&\x9di\x9d\x0e\xea\x19\xc6\xe7{\xdd\xcf\xfc\xf1\xe5\x81\x94u\xd0\x08A\x93\xc9\"\xee\xbe\xa0h\xef", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::Event for UsedEventWithTopicType { + fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { + use soroban_sdk::IntoVal; + ( + &{ soroban_sdk::Symbol::new(env, "used_event_with_topic_type") }, + { + let v: soroban_sdk::Val = self.kind.into_val(env); + v + }, + ) + .into_val(env) } -} -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &UsedAssertErrorEnum, - ) -> Result { - let error: soroban_sdk::Error = val.into(); - Ok(error.into()) + fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { + use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; + const KEYS: [&'static str; 1usize] = ["amount"]; + let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; + env.map_new_from_slices(&KEYS, &vals) + .unwrap_infallible() + .into() } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &&UsedAssertErrorEnum, - ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) +impl UsedEventWithTopicType { + pub fn publish(&self, env: &soroban_sdk::Env) { + <_ as soroban_sdk::Event>::publish(self, env); } } -pub struct UsedNestedInStruct { - pub val: i64, +pub struct UsedEventDataType { + pub x: u32, + pub y: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedNestedInStruct { +impl ::core::clone::Clone for UsedEventDataType { #[inline] - fn clone(&self) -> UsedNestedInStruct { - UsedNestedInStruct { - val: ::core::clone::Clone::clone(&self.val), + fn clone(&self) -> UsedEventDataType { + UsedEventDataType { + x: ::core::clone::Clone::clone(&self.x), + y: ::core::clone::Clone::clone(&self.y), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedNestedInStruct { +impl ::core::fmt::Debug for UsedEventDataType { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( + ::core::fmt::Formatter::debug_struct_field2_finish( f, - "UsedNestedInStruct", - "val", - &&self.val, + "UsedEventDataType", + "x", + &self.x, + "y", + &&self.y, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedNestedInStruct { +impl ::core::cmp::Eq for UsedEventDataType { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedNestedInStruct {} +impl ::core::marker::StructuralPartialEq for UsedEventDataType {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedNestedInStruct { +impl ::core::cmp::PartialEq for UsedEventDataType { #[inline] - fn eq(&self, other: &UsedNestedInStruct) -> bool { - self.val == other.val + fn eq(&self, other: &UsedEventDataType) -> bool { + self.x == other.x && self.y == other.y } } -pub static __SPEC_XDR_TYPE_USEDNESTEDINSTRUCT: [u8; 56usize] = UsedNestedInStruct::spec_xdr(); -impl UsedNestedInStruct { - pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedNestedInStruct\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x07" +pub static __SPEC_XDR_TYPE_USEDEVENTDATATYPE: [u8; 72usize] = UsedEventDataType::spec_xdr(); +impl UsedEventDataType { + pub const fn spec_xdr() -> [u8; 72usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedEventDataType\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x04\0\0\0\0\0\0\0\x01y\0\0\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UsedNestedInStruct { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedEventDataType { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xc2 \x1b\xdc\xc8gxZ{C<0\";\xe6w\xb4\xf6l\xfa|\xbe\x9b\xfc\x9612\x9e0\x02\x89\x0e"; } -impl soroban_sdk::TryFromVal for UsedNestedInStruct { +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDEVENTDATATYPE: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xc2 \x1b\xdc\xc8gxZ{C<0\";\xe6w\xb4\xf6l\xfa|\xbe\x9b\xfc\x9612\x9e0\x02\x89\x0e", + [], + ); +impl soroban_sdk::TryFromVal for UsedEventDataType { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + const KEYS: [&'static str; 2usize] = ["x", "y"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - val: vals[0] + x: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + y: vals[1] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedNestedInStruct, + val: &UsedEventDataType, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + const KEYS: [&'static str; 2usize] = ["x", "y"]; + let vals: [Val; 2usize] = [ + (&val.x).try_into_val(env).map_err(|_| ConversionError)?, + (&val.y).try_into_val(env).map_err(|_| ConversionError)?, + ]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedNestedInStruct, + val: &&UsedEventDataType, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedNestedInStruct { +impl soroban_sdk::TryFromVal for UsedEventDataType { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -1999,15 +6200,29 @@ impl soroban_sdk::TryFromVal for Used use soroban_sdk::xdr::Validate; use soroban_sdk::TryIntoVal; let map = val; - if map.len() != 1usize { + if map.len() != 2usize { return Err(soroban_sdk::xdr::Error::Invalid); } map.validate()?; Ok(Self { - val: { + x: { let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "val" - .try_into() + "x".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + y: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "y".try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(); @@ -2023,7 +6238,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedNestedInStruct { +impl soroban_sdk::TryFromVal for UsedEventDataType { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -2037,115 +6252,139 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedNestedInStruct> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedEventDataType> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedNestedInStruct) -> Result { + fn try_from(val: &UsedEventDataType) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ soroban_sdk::xdr::ScMapEntry { key: soroban_sdk::xdr::ScSymbol( - "val" - .try_into() + "x".try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(), - val: (&val.val) + val: (&val.x) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "y".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.y) .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, }, ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedNestedInStruct) -> Result { + fn try_from(val: UsedEventDataType) -> Result { (&val).try_into() } } -impl TryFrom<&UsedNestedInStruct> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedEventDataType> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedNestedInStruct) -> Result { + fn try_from(val: &UsedEventDataType) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedNestedInStruct) -> Result { + fn try_from(val: UsedEventDataType) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedNestedInStruct { - val: ::Prototype, + pub struct ArbitraryUsedEventDataType { + x: ::Prototype, + y: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedNestedInStruct { + impl ::core::fmt::Debug for ArbitraryUsedEventDataType { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( + ::core::fmt::Formatter::debug_struct_field2_finish( f, - "ArbitraryUsedNestedInStruct", - "val", - &&self.val, + "ArbitraryUsedEventDataType", + "x", + &self.x, + "y", + &&self.y, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedNestedInStruct { + impl ::core::clone::Clone for ArbitraryUsedEventDataType { #[inline] - fn clone(&self) -> ArbitraryUsedNestedInStruct { - ArbitraryUsedNestedInStruct { - val: ::core::clone::Clone::clone(&self.val), + fn clone(&self) -> ArbitraryUsedEventDataType { + ArbitraryUsedEventDataType { + x: ::core::clone::Clone::clone(&self.x), + y: ::core::clone::Clone::clone(&self.y), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedNestedInStruct { + impl ::core::cmp::Eq for ArbitraryUsedEventDataType { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq< - ::Prototype, + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedNestedInStruct {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventDataType {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedNestedInStruct { + impl ::core::cmp::PartialEq for ArbitraryUsedEventDataType { #[inline] - fn eq(&self, other: &ArbitraryUsedNestedInStruct) -> bool { - self.val == other.val + fn eq(&self, other: &ArbitraryUsedEventDataType) -> bool { + self.x == other.x && self.y == other.y } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedNestedInStruct { + impl ::core::cmp::Ord for ArbitraryUsedEventDataType { #[inline] - fn cmp(&self, other: &ArbitraryUsedNestedInStruct) -> ::core::cmp::Ordering { - ::core::cmp::Ord::cmp(&self.val, &other.val) + fn cmp(&self, other: &ArbitraryUsedEventDataType) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.x, &other.x) { + ::core::cmp::Ordering::Equal => ::core::cmp::Ord::cmp(&self.y, &other.y), + cmp => cmp, + } } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedNestedInStruct { + impl ::core::cmp::PartialOrd for ArbitraryUsedEventDataType { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedNestedInStruct, + other: &ArbitraryUsedEventDataType, ) -> ::core::option::Option<::core::cmp::Ordering> { - ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) + match ::core::cmp::PartialOrd::partial_cmp(&self.x, &other.x) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.y, &other.y) + } + cmp => cmp, + } } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedNestedInStruct: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedEventDataType: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -2179,11 +6418,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedNestedInStruct { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventDataType { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedNestedInStruct.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataType.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -2192,12 +6431,13 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedNestedInStruct { - val: arbitrary::Arbitrary::arbitrary(u)?, + Ok(ArbitraryUsedEventDataType { + x: arbitrary::Arbitrary::arbitrary(u)?, + y: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedNestedInStruct.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataType.with(|count| { count.set(count.get() - 1); }); } @@ -2208,7 +6448,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedNestedInStruct.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataType.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -2217,12 +6457,13 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedNestedInStruct { - val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + Ok(ArbitraryUsedEventDataType { + x: arbitrary::Arbitrary::arbitrary(&mut u)?, + y: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedNestedInStruct.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataType.with(|count| { count.set(count.get() - 1); }); } @@ -2233,7 +6474,10 @@ const _: () = { arbitrary::size_hint::recursion_guard(depth, |depth| { arbitrary::size_hint::and_all( &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + <::Prototype as arbitrary::Arbitrary>::size_hint( depth, ), ], @@ -2242,116 +6486,220 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedNestedInStruct { - type Prototype = ArbitraryUsedNestedInStruct; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventDataType { + type Prototype = ArbitraryUsedEventDataType; } - impl soroban_sdk::TryFromVal for UsedNestedInStruct { + impl soroban_sdk::TryFromVal for UsedEventDataType { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedNestedInStruct, + v: &ArbitraryUsedEventDataType, ) -> std::result::Result { - Ok(UsedNestedInStruct { - val: soroban_sdk::IntoVal::into_val(&v.val, env), + Ok(UsedEventDataType { + x: soroban_sdk::IntoVal::into_val(&v.x, env), + y: soroban_sdk::IntoVal::into_val(&v.y, env), }) } } }; -pub struct UsedVecElement { - pub data: u32, +pub struct UsedEventWithDataType { + pub kind: Symbol, + pub payload: UsedEventDataType, } #[automatically_derived] -impl ::core::clone::Clone for UsedVecElement { +impl ::core::clone::Clone for UsedEventWithDataType { #[inline] - fn clone(&self) -> UsedVecElement { - UsedVecElement { - data: ::core::clone::Clone::clone(&self.data), + fn clone(&self) -> UsedEventWithDataType { + UsedEventWithDataType { + kind: ::core::clone::Clone::clone(&self.kind), + payload: ::core::clone::Clone::clone(&self.payload), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedVecElement { +impl ::core::fmt::Debug for UsedEventWithDataType { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedVecElement", "data", &&self.data) + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UsedEventWithDataType", + "kind", + &self.kind, + "payload", + &&self.payload, + ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedVecElement { +impl ::core::cmp::Eq for UsedEventWithDataType { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedVecElement {} +impl ::core::marker::StructuralPartialEq for UsedEventWithDataType {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedVecElement { +impl ::core::cmp::PartialEq for UsedEventWithDataType { #[inline] - fn eq(&self, other: &UsedVecElement) -> bool { - self.data == other.data + fn eq(&self, other: &UsedEventWithDataType) -> bool { + self.kind == other.kind && self.payload == other.payload } } -pub static __SPEC_XDR_TYPE_USEDVECELEMENT: [u8; 52usize] = UsedVecElement::spec_xdr(); -impl UsedVecElement { - pub const fn spec_xdr() -> [u8; 52usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0eUsedVecElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" +pub static __SPEC_XDR_EVENT_USEDEVENTWITHDATATYPE: [u8; 152usize] = + UsedEventWithDataType::spec_xdr(); +impl UsedEventWithDataType { + pub const fn spec_xdr() -> [u8; 152usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x15UsedEventWithDataType\0\0\0\0\0\0\x01\0\0\0\x19used_event_with_data_type\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x11UsedEventDataType\0\0\0\0\0\0\0\0\0\0\x02" + } +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_EVENT_USEDEVENTWITHDATATYPE: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 1, + *b"q\xa3z;6\xa6R\x01\xa6-V\x13\x03\xcc\xff\x03\x84\x1f\xfb\xbe`v\xba\x0e\xe9\xd3\x0f\xf8$#t0", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::Event for UsedEventWithDataType { + fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { + use soroban_sdk::IntoVal; + ( + &{ soroban_sdk::Symbol::new(env, "used_event_with_data_type") }, + { + let v: soroban_sdk::Val = self.kind.into_val(env); + v + }, + ) + .into_val(env) + } + fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { + use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; + const KEYS: [&'static str; 1usize] = ["payload"]; + let vals: [soroban_sdk::Val; 1usize] = [self.payload.into_val(env)]; + env.map_new_from_slices(&KEYS, &vals) + .unwrap_infallible() + .into() + } +} +impl UsedEventWithDataType { + pub fn publish(&self, env: &soroban_sdk::Env) { + <_ as soroban_sdk::Event>::publish(self, env); + } +} +pub struct UsedEventTopicOuter { + pub inner: UsedEventTopicInner, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventTopicOuter { + #[inline] + fn clone(&self) -> UsedEventTopicOuter { + UsedEventTopicOuter { + inner: ::core::clone::Clone::clone(&self.inner), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventTopicOuter { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedEventTopicOuter", + "inner", + &&self.inner, + ) } } -impl soroban_sdk::SpecShakingMarker for UsedVecElement { +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventTopicOuter { + #[inline] #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; } } -impl soroban_sdk::TryFromVal for UsedVecElement { +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventTopicOuter {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventTopicOuter { + #[inline] + fn eq(&self, other: &UsedEventTopicOuter) -> bool { + self.inner == other.inner + } +} +pub static __SPEC_XDR_TYPE_USEDEVENTTOPICOUTER: [u8; 84usize] = UsedEventTopicOuter::spec_xdr(); +impl UsedEventTopicOuter { + pub const fn spec_xdr() -> [u8; 84usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedEventTopicOuter\0\0\0\0\x01\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x13UsedEventTopicInner\0" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedEventTopicOuter { + const SPEC_TYPE_ID: [u8; 32] = *b"\x94\xc7w/_\xebXc\xa9\x03\x88\x02\x07^\x08\xa2\x8e_\x97\xfe\x1a\x86o\x86\xf0h\x0e\xd5Q],\xce"; +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDEVENTTOPICOUTER: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 2, + *b"\x94\xc7w/_\xebXc\xa9\x03\x88\x02\x07^\x08\xa2\x8e_\x97\xfe\x1a\x86o\x86\xf0h\x0e\xd5Q],\xce", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::TryFromVal for UsedEventTopicOuter { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; + const KEYS: [&'static str; 1usize] = ["inner"]; let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - data: vals[0] + inner: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedVecElement, + val: &UsedEventTopicOuter, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; - let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; + const KEYS: [&'static str; 1usize] = ["inner"]; + let vals: [Val; 1usize] = [(&val.inner) + .try_into_val(env) + .map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedVecElement, + val: &&UsedEventTopicOuter, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) } } -impl soroban_sdk::TryFromVal for UsedVecElement { +impl soroban_sdk::TryFromVal for UsedEventTopicOuter { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -2366,9 +6714,9 @@ impl soroban_sdk::TryFromVal for Used } map.validate()?; Ok(Self { - data: { + inner: { let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "data" + "inner" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) @@ -2385,7 +6733,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedVecElement { +impl soroban_sdk::TryFromVal for UsedEventTopicOuter { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -2399,115 +6747,116 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedVecElement> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedEventTopicOuter> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedVecElement) -> Result { + fn try_from(val: &UsedEventTopicOuter) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ soroban_sdk::xdr::ScMapEntry { key: soroban_sdk::xdr::ScSymbol( - "data" + "inner" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(), - val: (&val.data) + val: (&val.inner) .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, }, ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedVecElement) -> Result { + fn try_from(val: UsedEventTopicOuter) -> Result { (&val).try_into() } } -impl TryFrom<&UsedVecElement> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedEventTopicOuter> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedVecElement) -> Result { + fn try_from(val: &UsedEventTopicOuter) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedVecElement) -> Result { + fn try_from(val: UsedEventTopicOuter) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedVecElement { - data: ::Prototype, + pub struct ArbitraryUsedEventTopicOuter { + inner: + ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedVecElement { + impl ::core::fmt::Debug for ArbitraryUsedEventTopicOuter { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedVecElement", - "data", - &&self.data, + "ArbitraryUsedEventTopicOuter", + "inner", + &&self.inner, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedVecElement { + impl ::core::clone::Clone for ArbitraryUsedEventTopicOuter { #[inline] - fn clone(&self) -> ArbitraryUsedVecElement { - ArbitraryUsedVecElement { - data: ::core::clone::Clone::clone(&self.data), + fn clone(&self) -> ArbitraryUsedEventTopicOuter { + ArbitraryUsedEventTopicOuter { + inner: ::core::clone::Clone::clone(&self.inner), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedVecElement { + impl ::core::cmp::Eq for ArbitraryUsedEventTopicOuter { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq< - ::Prototype, + ::Prototype, >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedVecElement {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventTopicOuter {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedVecElement { + impl ::core::cmp::PartialEq for ArbitraryUsedEventTopicOuter { #[inline] - fn eq(&self, other: &ArbitraryUsedVecElement) -> bool { - self.data == other.data + fn eq(&self, other: &ArbitraryUsedEventTopicOuter) -> bool { + self.inner == other.inner } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedVecElement { + impl ::core::cmp::Ord for ArbitraryUsedEventTopicOuter { #[inline] - fn cmp(&self, other: &ArbitraryUsedVecElement) -> ::core::cmp::Ordering { - ::core::cmp::Ord::cmp(&self.data, &other.data) + fn cmp(&self, other: &ArbitraryUsedEventTopicOuter) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.inner, &other.inner) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedVecElement { + impl ::core::cmp::PartialOrd for ArbitraryUsedEventTopicOuter { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedVecElement, + other: &ArbitraryUsedEventTopicOuter, ) -> ::core::option::Option<::core::cmp::Ordering> { - ::core::cmp::PartialOrd::partial_cmp(&self.data, &other.data) + ::core::cmp::PartialOrd::partial_cmp(&self.inner, &other.inner) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedVecElement: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -2541,11 +6890,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedVecElement { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventTopicOuter { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedVecElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -2554,12 +6903,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedVecElement { - data: arbitrary::Arbitrary::arbitrary(u)?, + Ok(ArbitraryUsedEventTopicOuter { + inner: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedVecElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter.with(|count| { count.set(count.get() - 1); }); } @@ -2570,7 +6919,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedVecElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -2579,12 +6928,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedVecElement { - data: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + Ok(ArbitraryUsedEventTopicOuter { + inner: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedVecElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter.with(|count| { count.set(count.get() - 1); }); } @@ -2595,7 +6944,7 @@ const _: () = { arbitrary::size_hint::recursion_guard(depth, |depth| { arbitrary::size_hint::and_all( &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( + <::Prototype as arbitrary::Arbitrary>::size_hint( depth, ), ], @@ -2604,225 +6953,288 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedVecElement { - type Prototype = ArbitraryUsedVecElement; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventTopicOuter { + type Prototype = ArbitraryUsedEventTopicOuter; } - impl soroban_sdk::TryFromVal for UsedVecElement { + impl soroban_sdk::TryFromVal + for UsedEventTopicOuter + { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedVecElement, + v: &ArbitraryUsedEventTopicOuter, ) -> std::result::Result { - Ok(UsedVecElement { - data: soroban_sdk::IntoVal::into_val(&v.data, env), + Ok(UsedEventTopicOuter { + inner: soroban_sdk::IntoVal::into_val(&v.inner, env), }) } } }; -pub enum UsedMapKey { - K1 = 1, - K2 = 2, +pub struct UsedEventTopicInner { + pub val: u32, } #[automatically_derived] -impl ::core::marker::Copy for UsedMapKey {} -#[automatically_derived] -impl ::core::clone::Clone for UsedMapKey { +impl ::core::clone::Clone for UsedEventTopicInner { #[inline] - fn clone(&self) -> UsedMapKey { - *self + fn clone(&self) -> UsedEventTopicInner { + UsedEventTopicInner { + val: ::core::clone::Clone::clone(&self.val), + } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedMapKey { +impl ::core::fmt::Debug for UsedEventTopicInner { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( + ::core::fmt::Formatter::debug_struct_field1_finish( f, - match self { - UsedMapKey::K1 => "K1", - UsedMapKey::K2 => "K2", - }, + "UsedEventTopicInner", + "val", + &&self.val, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedMapKey { +impl ::core::cmp::Eq for UsedEventTopicInner { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedMapKey {} +impl ::core::marker::StructuralPartialEq for UsedEventTopicInner {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedMapKey { +impl ::core::cmp::PartialEq for UsedEventTopicInner { #[inline] - fn eq(&self, other: &UsedMapKey) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr + fn eq(&self, other: &UsedEventTopicInner) -> bool { + self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDMAPKEY: [u8; 64usize] = UsedMapKey::spec_xdr(); -impl UsedMapKey { - pub const fn spec_xdr() -> [u8; 64usize] { - *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\nUsedMapKey\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02K1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02K2\0\0\0\0\0\x02" +pub static __SPEC_XDR_TYPE_USEDEVENTTOPICINNER: [u8; 56usize] = UsedEventTopicInner::spec_xdr(); +impl UsedEventTopicInner { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedEventTopicInner\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UsedMapKey { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() {} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedEventTopicInner { + const SPEC_TYPE_ID: [u8; 32] = *b"6\x83?\xf0\xcdW\xb1/\x84\x83\xf4\xb9w\xfcY1^\xd2iW\x04\xf2\x84\xb9\n\x15 \xc2\x16\xce\x95\x08"; } -impl soroban_sdk::TryFromVal for UsedMapKey { +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDEVENTTOPICINNER: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"6\x83?\xf0\xcdW\xb1/\x84\x83\xf4\xb9w\xfcY1^\xd2iW\x04\xf2\x84\xb9\n\x15 \xc2\x16\xce\x95\x08", + [], +); +impl soroban_sdk::TryFromVal for UsedEventTopicInner { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedEventTopicInner, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedEventTopicInner, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +impl soroban_sdk::TryFromVal for UsedEventTopicInner { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; use soroban_sdk::TryIntoVal; - let discriminant: u32 = val.try_into_val(env)?; - Ok(match discriminant { - 1u32 => Self::K1, - 2u32 => Self::K2, - _ => Err(soroban_sdk::ConversionError {})?, + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + val: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "val" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; +impl soroban_sdk::TryFromVal for UsedEventTopicInner { + type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedMapKey, - ) -> Result { - Ok(match val { - UsedMapKey::K1 => 1u32.into(), - UsedMapKey::K2 => 2u32.into(), - }) + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; +impl TryFrom<&UsedEventTopicInner> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &&UsedMapKey, - ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + fn try_from(val: &UsedEventTopicInner) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "val" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.val) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) } } -impl soroban_sdk::TryFromVal for UsedMapKey { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &soroban_sdk::xdr::ScVal, - ) -> Result { - if let soroban_sdk::xdr::ScVal::U32(discriminant) = val { - Ok(match *discriminant { - 1u32 => Self::K1, - 2u32 => Self::K2, - _ => Err(soroban_sdk::xdr::Error::Invalid)?, - }) - } else { - Err(soroban_sdk::xdr::Error::Invalid) - } + fn try_from(val: UsedEventTopicInner) -> Result { + (&val).try_into() } } -impl TryInto for &UsedMapKey { +impl TryFrom<&UsedEventTopicInner> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_into(self) -> Result { - Ok(match self { - UsedMapKey::K1 => 1u32.into(), - UsedMapKey::K2 => 2u32.into(), - }) + fn try_from(val: &UsedEventTopicInner) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryInto for UsedMapKey { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_into(self) -> Result { - Ok(match self { - UsedMapKey::K1 => 1u32.into(), - UsedMapKey::K2 => 2u32.into(), - }) + fn try_from(val: UsedEventTopicInner) -> Result { + (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub enum ArbitraryUsedMapKey { - K1, - K2, + pub struct ArbitraryUsedEventTopicInner { + val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedMapKey { + impl ::core::fmt::Debug for ArbitraryUsedEventTopicInner { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( + ::core::fmt::Formatter::debug_struct_field1_finish( f, - match self { - ArbitraryUsedMapKey::K1 => "K1", - ArbitraryUsedMapKey::K2 => "K2", - }, + "ArbitraryUsedEventTopicInner", + "val", + &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedMapKey { + impl ::core::clone::Clone for ArbitraryUsedEventTopicInner { #[inline] - fn clone(&self) -> ArbitraryUsedMapKey { - match self { - ArbitraryUsedMapKey::K1 => ArbitraryUsedMapKey::K1, - ArbitraryUsedMapKey::K2 => ArbitraryUsedMapKey::K2, + fn clone(&self) -> ArbitraryUsedEventTopicInner { + ArbitraryUsedEventTopicInner { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedMapKey { + impl ::core::cmp::Eq for ArbitraryUsedEventTopicInner { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedMapKey {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventTopicInner {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedMapKey { + impl ::core::cmp::PartialEq for ArbitraryUsedEventTopicInner { #[inline] - fn eq(&self, other: &ArbitraryUsedMapKey) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr + fn eq(&self, other: &ArbitraryUsedEventTopicInner) -> bool { + self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedMapKey { + impl ::core::cmp::Ord for ArbitraryUsedEventTopicInner { #[inline] - fn cmp(&self, other: &ArbitraryUsedMapKey) -> ::core::cmp::Ordering { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) + fn cmp(&self, other: &ArbitraryUsedEventTopicInner) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedMapKey { + impl ::core::cmp::PartialOrd for ArbitraryUsedEventTopicInner { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedMapKey, + other: &ArbitraryUsedEventTopicInner, ) -> ::core::option::Option<::core::cmp::Ordering> { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr) + ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedMapKey: ::std::thread::LocalKey> = { + const RECURSIVE_COUNT_ArbitraryUsedEventTopicInner: ::std::thread::LocalKey< + std::cell::Cell, + > = { #[inline] fn __init() -> std::cell::Cell { std::cell::Cell::new(0) @@ -2854,11 +7266,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedMapKey { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventTopicInner { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedMapKey.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventTopicInner.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -2867,19 +7279,12 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(u)?) * 2u64) >> 32 - { - 0u64 => ArbitraryUsedMapKey::K1, - 1u64 => ArbitraryUsedMapKey::K2, - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryUsedEventTopicInner { + val: arbitrary::Arbitrary::arbitrary(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedMapKey.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventTopicInner.with(|count| { count.set(count.get() - 1); }); } @@ -2890,7 +7295,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedMapKey.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventTopicInner.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -2899,20 +7304,12 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(&mut u)?) * 2u64) - >> 32 - { - 0u64 => ArbitraryUsedMapKey::K1, - 1u64 => ArbitraryUsedMapKey::K2, - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryUsedEventTopicInner { + val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedMapKey.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventTopicInner.with(|count| { count.set(count.get() - 1); }); } @@ -2920,129 +7317,231 @@ const _: () = { } #[inline] fn size_hint(depth: usize) -> (usize, Option) { - arbitrary::size_hint::and( - ::size_hint(depth), - arbitrary::size_hint::recursion_guard(depth, |depth| { - arbitrary::size_hint::or_all(&[ - arbitrary::size_hint::and_all(&[]), - arbitrary::size_hint::and_all(&[]), - ]) - }), - ) + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedMapKey { - type Prototype = ArbitraryUsedMapKey; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventTopicInner { + type Prototype = ArbitraryUsedEventTopicInner; + } + impl soroban_sdk::TryFromVal + for UsedEventTopicInner + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedEventTopicInner, + ) -> std::result::Result { + Ok(UsedEventTopicInner { + val: soroban_sdk::IntoVal::into_val(&v.val, env), + }) + } + } +}; +pub struct UsedEventWithNestedTopic { + pub info: UsedEventTopicOuter, + pub amount: i128, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventWithNestedTopic { + #[inline] + fn clone(&self) -> UsedEventWithNestedTopic { + UsedEventWithNestedTopic { + info: ::core::clone::Clone::clone(&self.info), + amount: ::core::clone::Clone::clone(&self.amount), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventWithNestedTopic { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UsedEventWithNestedTopic", + "info", + &self.info, + "amount", + &&self.amount, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventWithNestedTopic { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventWithNestedTopic {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventWithNestedTopic { + #[inline] + fn eq(&self, other: &UsedEventWithNestedTopic) -> bool { + self.amount == other.amount && self.info == other.info } - impl soroban_sdk::TryFromVal for UsedMapKey { - type Error = soroban_sdk::ConversionError; - fn try_from_val( - env: &soroban_sdk::Env, - v: &ArbitraryUsedMapKey, - ) -> std::result::Result { - Ok(match v { - ArbitraryUsedMapKey::K1 => UsedMapKey::K1, - ArbitraryUsedMapKey::K2 => UsedMapKey::K2, - }) - } +} +pub static __SPEC_XDR_EVENT_USEDEVENTWITHNESTEDTOPIC: [u8; 152usize] = + UsedEventWithNestedTopic::spec_xdr(); +impl UsedEventWithNestedTopic { + pub const fn spec_xdr() -> [u8; 152usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x18UsedEventWithNestedTopic\0\0\0\x01\0\0\0\x1cused_event_with_nested_topic\0\0\0\x02\0\0\0\0\0\0\0\x04info\0\0\x07\xd0\0\0\0\x13UsedEventTopicOuter\0\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" } -}; -pub struct UsedMapVal { - pub v: u32, +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_EVENT_USEDEVENTWITHNESTEDTOPIC: [u8; 74usize] = + soroban_sdk::spec_shaking::encode_graph_record::<74usize, 1usize>( + 1, + *b"\xe3\xf2\x9b5%a\xfb\xd6pv\xcf\xd0q\x91\x9f\xae\x8d\x9d\x8dLKjc\xed&r;W\x13f\x8c\xba", + [::SPEC_TYPE_ID], + ); +impl soroban_sdk::Event for UsedEventWithNestedTopic { + fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { + use soroban_sdk::IntoVal; + ( + &{ soroban_sdk::Symbol::new(env, "used_event_with_nested_topic") }, + { + let v: soroban_sdk::Val = self.info.into_val(env); + v + }, + ) + .into_val(env) + } + fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { + use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; + const KEYS: [&'static str; 1usize] = ["amount"]; + let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; + env.map_new_from_slices(&KEYS, &vals) + .unwrap_infallible() + .into() + } +} +impl UsedEventWithNestedTopic { + pub fn publish(&self, env: &soroban_sdk::Env) { + <_ as soroban_sdk::Event>::publish(self, env); + } +} +pub struct UsedEventDataOuter { + pub inner: UsedEventDataInner, } #[automatically_derived] -impl ::core::clone::Clone for UsedMapVal { +impl ::core::clone::Clone for UsedEventDataOuter { #[inline] - fn clone(&self) -> UsedMapVal { - UsedMapVal { - v: ::core::clone::Clone::clone(&self.v), + fn clone(&self) -> UsedEventDataOuter { + UsedEventDataOuter { + inner: ::core::clone::Clone::clone(&self.inner), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedMapVal { +impl ::core::fmt::Debug for UsedEventDataOuter { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedMapVal", "v", &&self.v) + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedEventDataOuter", + "inner", + &&self.inner, + ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedMapVal { +impl ::core::cmp::Eq for UsedEventDataOuter { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedMapVal {} +impl ::core::marker::StructuralPartialEq for UsedEventDataOuter {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedMapVal { +impl ::core::cmp::PartialEq for UsedEventDataOuter { #[inline] - fn eq(&self, other: &UsedMapVal) -> bool { - self.v == other.v + fn eq(&self, other: &UsedEventDataOuter) -> bool { + self.inner == other.inner } } -pub static __SPEC_XDR_TYPE_USEDMAPVAL: [u8; 48usize] = UsedMapVal::spec_xdr(); -impl UsedMapVal { - pub const fn spec_xdr() -> [u8; 48usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\nUsedMapVal\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDEVENTDATAOUTER: [u8; 84usize] = UsedEventDataOuter::spec_xdr(); +impl UsedEventDataOuter { + pub const fn spec_xdr() -> [u8; 84usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventDataOuter\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x12UsedEventDataInner\0\0" } } -impl soroban_sdk::SpecShakingMarker for UsedMapVal { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedEventDataOuter { + const SPEC_TYPE_ID: [u8; 32] = *b"'\xf2\xa2\xb9\xd0)\xc0u \x17\xc1\xe1\xcc5t\"\x83\xad\x90)\x86\xd5j\x85\x1cD\xc9\x0f|\xb2\x01\x1a"; } -impl soroban_sdk::TryFromVal for UsedMapVal { +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDEVENTDATAOUTER: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 2, + *b"'\xf2\xa2\xb9\xd0)\xc0u \x17\xc1\xe1\xcc5t\"\x83\xad\x90)\x86\xd5j\x85\x1cD\xc9\x0f|\xb2\x01\x1a", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::TryFromVal for UsedEventDataOuter { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["v"]; + const KEYS: [&'static str; 1usize] = ["inner"]; let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - v: vals[0] + inner: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedMapVal, + val: &UsedEventDataOuter, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["v"]; - let vals: [Val; 1usize] = [(&val.v).try_into_val(env).map_err(|_| ConversionError)?]; + const KEYS: [&'static str; 1usize] = ["inner"]; + let vals: [Val; 1usize] = [(&val.inner) + .try_into_val(env) + .map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedMapVal, + val: &&UsedEventDataOuter, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) } } -impl soroban_sdk::TryFromVal for UsedMapVal { +impl soroban_sdk::TryFromVal for UsedEventDataOuter { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -3057,9 +7556,10 @@ impl soroban_sdk::TryFromVal for Used } map.validate()?; Ok(Self { - v: { + inner: { let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "v".try_into() + "inner" + .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(); @@ -3075,7 +7575,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedMapVal { +impl soroban_sdk::TryFromVal for UsedEventDataOuter { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -3089,114 +7589,118 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedMapVal> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedEventDataOuter> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedMapVal) -> Result { + fn try_from(val: &UsedEventDataOuter) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ soroban_sdk::xdr::ScMapEntry { key: soroban_sdk::xdr::ScSymbol( - "v".try_into() + "inner" + .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(), - val: (&val.v) + val: (&val.inner) .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, }, ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedMapVal) -> Result { + fn try_from(val: UsedEventDataOuter) -> Result { (&val).try_into() } } -impl TryFrom<&UsedMapVal> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedEventDataOuter> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedMapVal) -> Result { + fn try_from(val: &UsedEventDataOuter) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedMapVal) -> Result { + fn try_from(val: UsedEventDataOuter) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedMapVal { - v: ::Prototype, + pub struct ArbitraryUsedEventDataOuter { + inner: + ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedMapVal { + impl ::core::fmt::Debug for ArbitraryUsedEventDataOuter { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedMapVal", - "v", - &&self.v, + "ArbitraryUsedEventDataOuter", + "inner", + &&self.inner, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedMapVal { + impl ::core::clone::Clone for ArbitraryUsedEventDataOuter { #[inline] - fn clone(&self) -> ArbitraryUsedMapVal { - ArbitraryUsedMapVal { - v: ::core::clone::Clone::clone(&self.v), + fn clone(&self) -> ArbitraryUsedEventDataOuter { + ArbitraryUsedEventDataOuter { + inner: ::core::clone::Clone::clone(&self.inner), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedMapVal { + impl ::core::cmp::Eq for ArbitraryUsedEventDataOuter { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq< - ::Prototype, + ::Prototype, >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedMapVal {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventDataOuter {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedMapVal { + impl ::core::cmp::PartialEq for ArbitraryUsedEventDataOuter { #[inline] - fn eq(&self, other: &ArbitraryUsedMapVal) -> bool { - self.v == other.v + fn eq(&self, other: &ArbitraryUsedEventDataOuter) -> bool { + self.inner == other.inner } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedMapVal { + impl ::core::cmp::Ord for ArbitraryUsedEventDataOuter { #[inline] - fn cmp(&self, other: &ArbitraryUsedMapVal) -> ::core::cmp::Ordering { - ::core::cmp::Ord::cmp(&self.v, &other.v) + fn cmp(&self, other: &ArbitraryUsedEventDataOuter) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.inner, &other.inner) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedMapVal { + impl ::core::cmp::PartialOrd for ArbitraryUsedEventDataOuter { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedMapVal, + other: &ArbitraryUsedEventDataOuter, ) -> ::core::option::Option<::core::cmp::Ordering> { - ::core::cmp::PartialOrd::partial_cmp(&self.v, &other.v) + ::core::cmp::PartialOrd::partial_cmp(&self.inner, &other.inner) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedMapVal: ::std::thread::LocalKey> = { + const RECURSIVE_COUNT_ArbitraryUsedEventDataOuter: ::std::thread::LocalKey< + std::cell::Cell, + > = { #[inline] fn __init() -> std::cell::Cell { std::cell::Cell::new(0) @@ -3228,11 +7732,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedMapVal { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventDataOuter { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedMapVal.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataOuter.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -3241,12 +7745,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedMapVal { - v: arbitrary::Arbitrary::arbitrary(u)?, + Ok(ArbitraryUsedEventDataOuter { + inner: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedMapVal.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataOuter.with(|count| { count.set(count.get() - 1); }); } @@ -3257,7 +7761,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedMapVal.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataOuter.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -3266,12 +7770,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedMapVal { - v: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + Ok(ArbitraryUsedEventDataOuter { + inner: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedMapVal.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataOuter.with(|count| { count.set(count.get() - 1); }); } @@ -3282,7 +7786,7 @@ const _: () = { arbitrary::size_hint::recursion_guard(depth, |depth| { arbitrary::size_hint::and_all( &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( + <::Prototype as arbitrary::Arbitrary>::size_hint( depth, ), ], @@ -3291,47 +7795,47 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedMapVal { - type Prototype = ArbitraryUsedMapVal; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventDataOuter { + type Prototype = ArbitraryUsedEventDataOuter; } - impl soroban_sdk::TryFromVal for UsedMapVal { + impl soroban_sdk::TryFromVal for UsedEventDataOuter { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedMapVal, + v: &ArbitraryUsedEventDataOuter, ) -> std::result::Result { - Ok(UsedMapVal { - v: soroban_sdk::IntoVal::into_val(&v.v, env), + Ok(UsedEventDataOuter { + inner: soroban_sdk::IntoVal::into_val(&v.inner, env), }) } } }; -pub struct UsedOptionElement { - pub data: u32, +pub struct UsedEventDataInner { + pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedOptionElement { +impl ::core::clone::Clone for UsedEventDataInner { #[inline] - fn clone(&self) -> UsedOptionElement { - UsedOptionElement { - data: ::core::clone::Clone::clone(&self.data), + fn clone(&self) -> UsedEventDataInner { + UsedEventDataInner { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedOptionElement { +impl ::core::fmt::Debug for UsedEventDataInner { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedOptionElement", - "data", - &&self.data, + "UsedEventDataInner", + "val", + &&self.val, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedOptionElement { +impl ::core::cmp::Eq for UsedEventDataInner { #[inline] #[doc(hidden)] #[coverage(off)] @@ -3340,72 +7844,79 @@ impl ::core::cmp::Eq for UsedOptionElement { } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedOptionElement {} +impl ::core::marker::StructuralPartialEq for UsedEventDataInner {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedOptionElement { +impl ::core::cmp::PartialEq for UsedEventDataInner { #[inline] - fn eq(&self, other: &UsedOptionElement) -> bool { - self.data == other.data + fn eq(&self, other: &UsedEventDataInner) -> bool { + self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDOPTIONELEMENT: [u8; 56usize] = UsedOptionElement::spec_xdr(); -impl UsedOptionElement { +pub static __SPEC_XDR_TYPE_USEDEVENTDATAINNER: [u8; 56usize] = UsedEventDataInner::spec_xdr(); +impl UsedEventDataInner { pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedOptionElement\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventDataInner\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UsedOptionElement { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedEventDataInner { + const SPEC_TYPE_ID: [u8; 32] = *b"\x0c\xf0\xf6w\xfd\x1a\x1b\x94\x8e\xdb9\xf07\x16K{\xce\xe5no\xb5>\x94\xf3\xa9\x15\x8b\x93\xda*\xc1\x84"; } -impl soroban_sdk::TryFromVal for UsedOptionElement { +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDEVENTDATAINNER: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\x0c\xf0\xf6w\xfd\x1a\x1b\x94\x8e\xdb9\xf07\x16K{\xce\xe5no\xb5>\x94\xf3\xa9\x15\x8b\x93\xda*\xc1\x84", + [], +); +impl soroban_sdk::TryFromVal for UsedEventDataInner { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; + const KEYS: [&'static str; 1usize] = ["val"]; let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - data: vals[0] + val: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedOptionElement, + val: &UsedEventDataInner, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; - let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedOptionElement, + val: &&UsedEventDataInner, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) } } -impl soroban_sdk::TryFromVal for UsedOptionElement { +impl soroban_sdk::TryFromVal for UsedEventDataInner { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -3420,9 +7931,9 @@ impl soroban_sdk::TryFromVal for Used } map.validate()?; Ok(Self { - data: { + val: { let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "data" + "val" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) @@ -3439,7 +7950,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedOptionElement { +impl soroban_sdk::TryFromVal for UsedEventDataInner { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -3453,77 +7964,77 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedOptionElement> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedEventDataInner> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedOptionElement) -> Result { + fn try_from(val: &UsedEventDataInner) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ soroban_sdk::xdr::ScMapEntry { key: soroban_sdk::xdr::ScSymbol( - "data" + "val" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(), - val: (&val.data) + val: (&val.val) .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, }, ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedOptionElement) -> Result { + fn try_from(val: UsedEventDataInner) -> Result { (&val).try_into() } } -impl TryFrom<&UsedOptionElement> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedEventDataInner> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedOptionElement) -> Result { + fn try_from(val: &UsedEventDataInner) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedOptionElement) -> Result { + fn try_from(val: UsedEventDataInner) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedOptionElement { - data: ::Prototype, + pub struct ArbitraryUsedEventDataInner { + val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedOptionElement { + impl ::core::fmt::Debug for ArbitraryUsedEventDataInner { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedOptionElement", - "data", - &&self.data, + "ArbitraryUsedEventDataInner", + "val", + &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedOptionElement { + impl ::core::clone::Clone for ArbitraryUsedEventDataInner { #[inline] - fn clone(&self) -> ArbitraryUsedOptionElement { - ArbitraryUsedOptionElement { - data: ::core::clone::Clone::clone(&self.data), + fn clone(&self) -> ArbitraryUsedEventDataInner { + ArbitraryUsedEventDataInner { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedOptionElement { + impl ::core::cmp::Eq for ArbitraryUsedEventDataInner { #[inline] #[doc(hidden)] #[coverage(off)] @@ -3534,34 +8045,34 @@ const _: () = { } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedOptionElement {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventDataInner {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedOptionElement { + impl ::core::cmp::PartialEq for ArbitraryUsedEventDataInner { #[inline] - fn eq(&self, other: &ArbitraryUsedOptionElement) -> bool { - self.data == other.data + fn eq(&self, other: &ArbitraryUsedEventDataInner) -> bool { + self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedOptionElement { + impl ::core::cmp::Ord for ArbitraryUsedEventDataInner { #[inline] - fn cmp(&self, other: &ArbitraryUsedOptionElement) -> ::core::cmp::Ordering { - ::core::cmp::Ord::cmp(&self.data, &other.data) + fn cmp(&self, other: &ArbitraryUsedEventDataInner) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedOptionElement { + impl ::core::cmp::PartialOrd for ArbitraryUsedEventDataInner { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedOptionElement, + other: &ArbitraryUsedEventDataInner, ) -> ::core::option::Option<::core::cmp::Ordering> { - ::core::cmp::PartialOrd::partial_cmp(&self.data, &other.data) + ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedOptionElement: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedEventDataInner: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -3595,11 +8106,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedOptionElement { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventDataInner { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedOptionElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataInner.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -3608,12 +8119,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedOptionElement { - data: arbitrary::Arbitrary::arbitrary(u)?, + Ok(ArbitraryUsedEventDataInner { + val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedOptionElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataInner.with(|count| { count.set(count.get() - 1); }); } @@ -3624,7 +8135,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedOptionElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataInner.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -3633,12 +8144,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedOptionElement { - data: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + Ok(ArbitraryUsedEventDataInner { + val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedOptionElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedEventDataInner.with(|count| { count.set(count.get() - 1); }); } @@ -3658,272 +8169,323 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedOptionElement { - type Prototype = ArbitraryUsedOptionElement; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventDataInner { + type Prototype = ArbitraryUsedEventDataInner; } - impl soroban_sdk::TryFromVal for UsedOptionElement { + impl soroban_sdk::TryFromVal for UsedEventDataInner { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedOptionElement, + v: &ArbitraryUsedEventDataInner, ) -> std::result::Result { - Ok(UsedOptionElement { - data: soroban_sdk::IntoVal::into_val(&v.data, env), + Ok(UsedEventDataInner { + val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -pub struct UsedResultOk { - pub data: u32, +pub struct UsedEventWithNestedData { + pub kind: Symbol, + pub payload: UsedEventDataOuter, } #[automatically_derived] -impl ::core::clone::Clone for UsedResultOk { +impl ::core::clone::Clone for UsedEventWithNestedData { #[inline] - fn clone(&self) -> UsedResultOk { - UsedResultOk { - data: ::core::clone::Clone::clone(&self.data), + fn clone(&self) -> UsedEventWithNestedData { + UsedEventWithNestedData { + kind: ::core::clone::Clone::clone(&self.kind), + payload: ::core::clone::Clone::clone(&self.payload), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedResultOk { +impl ::core::fmt::Debug for UsedEventWithNestedData { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedResultOk", "data", &&self.data) + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UsedEventWithNestedData", + "kind", + &self.kind, + "payload", + &&self.payload, + ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedResultOk { +impl ::core::cmp::Eq for UsedEventWithNestedData { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedResultOk {} +impl ::core::marker::StructuralPartialEq for UsedEventWithNestedData {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedResultOk { +impl ::core::cmp::PartialEq for UsedEventWithNestedData { #[inline] - fn eq(&self, other: &UsedResultOk) -> bool { - self.data == other.data + fn eq(&self, other: &UsedEventWithNestedData) -> bool { + self.kind == other.kind && self.payload == other.payload } } -pub static __SPEC_XDR_TYPE_USEDRESULTOK: [u8; 48usize] = UsedResultOk::spec_xdr(); -impl UsedResultOk { - pub const fn spec_xdr() -> [u8; 48usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0cUsedResultOk\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" +pub static __SPEC_XDR_EVENT_USEDEVENTWITHNESTEDDATA: [u8; 152usize] = + UsedEventWithNestedData::spec_xdr(); +impl UsedEventWithNestedData { + pub const fn spec_xdr() -> [u8; 152usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x17UsedEventWithNestedData\0\0\0\0\x01\0\0\0\x1bused_event_with_nested_data\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x12UsedEventDataOuter\0\0\0\0\0\0\0\0\0\x02" + } +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_EVENT_USEDEVENTWITHNESTEDDATA: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 1, + *b" \xfbl\x04B\x82\xc0\xb4.\xec\xfdE\xa0\x8d\xca\xea\xd9\"\xc2\xf1\xcf\xe4-\xe2|\x1b&\x9eF\xc1e0", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::Event for UsedEventWithNestedData { + fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { + use soroban_sdk::IntoVal; + ( + &{ soroban_sdk::Symbol::new(env, "used_event_with_nested_data") }, + { + let v: soroban_sdk::Val = self.kind.into_val(env); + v + }, + ) + .into_val(env) + } + fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { + use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; + const KEYS: [&'static str; 1usize] = ["payload"]; + let vals: [soroban_sdk::Val; 1usize] = [self.payload.into_val(env)]; + env.map_new_from_slices(&KEYS, &vals) + .unwrap_infallible() + .into() + } +} +impl UsedEventWithNestedData { + pub fn publish(&self, env: &soroban_sdk::Env) { + <_ as soroban_sdk::Event>::publish(self, env); + } +} +pub enum UsedRefTopicType { + Send = 1, + Recv = 2, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedRefTopicType {} +#[automatically_derived] +impl ::core::clone::Clone for UsedRefTopicType { + #[inline] + fn clone(&self) -> UsedRefTopicType { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedRefTopicType { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + UsedRefTopicType::Send => "Send", + UsedRefTopicType::Recv => "Recv", + }, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedRefTopicType { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedRefTopicType {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedRefTopicType { + #[inline] + fn eq(&self, other: &UsedRefTopicType) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } +} +pub static __SPEC_XDR_TYPE_USEDREFTOPICTYPE: [u8; 68usize] = UsedRefTopicType::spec_xdr(); +impl UsedRefTopicType { + pub const fn spec_xdr() -> [u8; 68usize] { + *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x10UsedRefTopicType\0\0\0\x02\0\0\0\0\0\0\0\x04Send\0\0\0\x01\0\0\0\0\0\0\0\x04Recv\0\0\0\x02" } } -impl soroban_sdk::SpecShakingMarker for UsedResultOk { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedRefTopicType { + const SPEC_TYPE_ID: [u8; 32] = *b"@\xb9LO\xf9\xd1\xe8\xe2\xbb\x94X\x08\xab\x8a\xaf\x95(\xcd\x91\x1f\x96\xce\t\xff\x86|\xb4\xb6\x84K\xed "; } -impl soroban_sdk::TryFromVal for UsedResultOk { +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDREFTOPICTYPE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"@\xb9LO\xf9\xd1\xe8\xe2\xbb\x94X\x08\xab\x8a\xaf\x95(\xcd\x91\x1f\x96\xce\t\xff\x86|\xb4\xb6\x84K\xed ", + [], +); +impl soroban_sdk::TryFromVal for UsedRefTopicType { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; - let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; - let map: MapObject = val.try_into().map_err(|_| ConversionError)?; - env.map_unpack_to_slice(map, &KEYS, &mut vals) - .map_err(|_| ConversionError)?; - Ok(Self { - data: vals[0] - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?, + use soroban_sdk::TryIntoVal; + let discriminant: u32 = val.try_into_val(env)?; + Ok(match discriminant { + 1u32 => Self::Send, + 2u32 => Self::Recv, + _ => Err(soroban_sdk::ConversionError {})?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedResultOk, + val: &UsedRefTopicType, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; - let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; - Ok(env - .map_new_from_slices(&KEYS, &vals) - .map_err(|_| ConversionError)? - .into()) + Ok(match val { + UsedRefTopicType::Send => 1u32.into(), + UsedRefTopicType::Recv => 2u32.into(), + }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedResultOk, + val: &&UsedRefTopicType, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) - } -} -impl soroban_sdk::TryFromVal for UsedResultOk { - type Error = soroban_sdk::xdr::Error; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &soroban_sdk::xdr::ScMap, - ) -> Result { - use soroban_sdk::xdr::Validate; - use soroban_sdk::TryIntoVal; - let map = val; - if map.len() != 1usize { - return Err(soroban_sdk::xdr::Error::Invalid); - } - map.validate()?; - Ok(Self { - data: { - let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "data" - .try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - ) - .into(); - let idx = map - .binary_search_by_key(&key, |entry| entry.key.clone()) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; - let rv: soroban_sdk::Val = (&map[idx].val.clone()) - .try_into_val(env) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; - rv.try_into_val(env) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)? - }, - }) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedResultOk { +impl soroban_sdk::TryFromVal for UsedRefTopicType { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::xdr::ScVal, ) -> Result { - if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { - <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + if let soroban_sdk::xdr::ScVal::U32(discriminant) = val { + Ok(match *discriminant { + 1u32 => Self::Send, + 2u32 => Self::Recv, + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) } else { Err(soroban_sdk::xdr::Error::Invalid) } } } -impl TryFrom<&UsedResultOk> for soroban_sdk::xdr::ScMap { - type Error = soroban_sdk::xdr::Error; - #[inline(always)] - fn try_from(val: &UsedResultOk) -> Result { - extern crate alloc; - use soroban_sdk::TryFromVal; - soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ - soroban_sdk::xdr::ScMapEntry { - key: soroban_sdk::xdr::ScSymbol( - "data" - .try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - ) - .into(), - val: (&val.data) - .try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - }, - ]))) - } -} -impl TryFrom for soroban_sdk::xdr::ScMap { - type Error = soroban_sdk::xdr::Error; - #[inline(always)] - fn try_from(val: UsedResultOk) -> Result { - (&val).try_into() - } -} -impl TryFrom<&UsedResultOk> for soroban_sdk::xdr::ScVal { +impl TryInto for &UsedRefTopicType { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedResultOk) -> Result { - Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + fn try_into(self) -> Result { + Ok(match self { + UsedRefTopicType::Send => 1u32.into(), + UsedRefTopicType::Recv => 2u32.into(), + }) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryInto for UsedRefTopicType { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedResultOk) -> Result { - (&val).try_into() + fn try_into(self) -> Result { + Ok(match self { + UsedRefTopicType::Send => 1u32.into(), + UsedRefTopicType::Recv => 2u32.into(), + }) } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedResultOk { - data: ::Prototype, + pub enum ArbitraryUsedRefTopicType { + Send, + Recv, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedResultOk { + impl ::core::fmt::Debug for ArbitraryUsedRefTopicType { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( + ::core::fmt::Formatter::write_str( f, - "ArbitraryUsedResultOk", - "data", - &&self.data, + match self { + ArbitraryUsedRefTopicType::Send => "Send", + ArbitraryUsedRefTopicType::Recv => "Recv", + }, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedResultOk { + impl ::core::clone::Clone for ArbitraryUsedRefTopicType { #[inline] - fn clone(&self) -> ArbitraryUsedResultOk { - ArbitraryUsedResultOk { - data: ::core::clone::Clone::clone(&self.data), + fn clone(&self) -> ArbitraryUsedRefTopicType { + match self { + ArbitraryUsedRefTopicType::Send => ArbitraryUsedRefTopicType::Send, + ArbitraryUsedRefTopicType::Recv => ArbitraryUsedRefTopicType::Recv, } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedResultOk { + impl ::core::cmp::Eq for ArbitraryUsedRefTopicType { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq< - ::Prototype, - >; - } + fn assert_receiver_is_total_eq(&self) -> () {} } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedResultOk {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedRefTopicType {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedResultOk { + impl ::core::cmp::PartialEq for ArbitraryUsedRefTopicType { #[inline] - fn eq(&self, other: &ArbitraryUsedResultOk) -> bool { - self.data == other.data + fn eq(&self, other: &ArbitraryUsedRefTopicType) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedResultOk { + impl ::core::cmp::Ord for ArbitraryUsedRefTopicType { #[inline] - fn cmp(&self, other: &ArbitraryUsedResultOk) -> ::core::cmp::Ordering { - ::core::cmp::Ord::cmp(&self.data, &other.data) + fn cmp(&self, other: &ArbitraryUsedRefTopicType) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedResultOk { + impl ::core::cmp::PartialOrd for ArbitraryUsedRefTopicType { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedResultOk, + other: &ArbitraryUsedRefTopicType, ) -> ::core::option::Option<::core::cmp::Ordering> { - ::core::cmp::PartialOrd::partial_cmp(&self.data, &other.data) + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedResultOk: ::std::thread::LocalKey> = { + const RECURSIVE_COUNT_ArbitraryUsedRefTopicType: ::std::thread::LocalKey< + std::cell::Cell, + > = { #[inline] fn __init() -> std::cell::Cell { std::cell::Cell::new(0) @@ -3955,11 +8517,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedResultOk { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedRefTopicType { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedResultOk.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefTopicType.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -3968,12 +8530,19 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedResultOk { - data: arbitrary::Arbitrary::arbitrary(u)?, - }) + Ok( + match (u64::from(::arbitrary(u)?) * 2u64) >> 32 + { + 0u64 => ArbitraryUsedRefTopicType::Send, + 1u64 => ArbitraryUsedRefTopicType::Recv, + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedResultOk.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefTopicType.with(|count| { count.set(count.get() - 1); }); } @@ -3984,7 +8553,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedResultOk.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefTopicType.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -3993,12 +8562,20 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedResultOk { - data: arbitrary::Arbitrary::arbitrary_take_rest(u)?, - }) + Ok( + match (u64::from(::arbitrary(&mut u)?) * 2u64) + >> 32 + { + 0u64 => ArbitraryUsedRefTopicType::Send, + 1u64 => ArbitraryUsedRefTopicType::Recv, + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedResultOk.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefTopicType.with(|count| { count.set(count.get() - 1); }); } @@ -4006,324 +8583,298 @@ const _: () = { } #[inline] fn size_hint(depth: usize) -> (usize, Option) { - arbitrary::size_hint::recursion_guard(depth, |depth| { - arbitrary::size_hint::and_all( - &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( - depth, - ), - ], - ) - }) + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all(&[ + arbitrary::size_hint::and_all(&[]), + arbitrary::size_hint::and_all(&[]), + ]) + }), + ) } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedResultOk { - type Prototype = ArbitraryUsedResultOk; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedRefTopicType { + type Prototype = ArbitraryUsedRefTopicType; } - impl soroban_sdk::TryFromVal for UsedResultOk { + impl soroban_sdk::TryFromVal for UsedRefTopicType { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedResultOk, + v: &ArbitraryUsedRefTopicType, ) -> std::result::Result { - Ok(UsedResultOk { - data: soroban_sdk::IntoVal::into_val(&v.data, env), + Ok(match v { + ArbitraryUsedRefTopicType::Send => UsedRefTopicType::Send, + ArbitraryUsedRefTopicType::Recv => UsedRefTopicType::Recv, }) } } }; -pub struct UsedEventSimple { - pub kind: Symbol, - pub amount: i128, +pub struct UsedRefDataType { + pub nested: UsedRefDataInner, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventSimple { +impl ::core::clone::Clone for UsedRefDataType { #[inline] - fn clone(&self) -> UsedEventSimple { - UsedEventSimple { - kind: ::core::clone::Clone::clone(&self.kind), - amount: ::core::clone::Clone::clone(&self.amount), + fn clone(&self) -> UsedRefDataType { + UsedRefDataType { + nested: ::core::clone::Clone::clone(&self.nested), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventSimple { +impl ::core::fmt::Debug for UsedRefDataType { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( + ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedEventSimple", - "kind", - &self.kind, - "amount", - &&self.amount, + "UsedRefDataType", + "nested", + &&self.nested, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventSimple { +impl ::core::cmp::Eq for UsedRefDataType { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; - } -} -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventSimple {} -#[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventSimple { - #[inline] - fn eq(&self, other: &UsedEventSimple) -> bool { - self.amount == other.amount && self.kind == other.kind - } -} -pub static __SPEC_XDR_EVENT_USEDEVENTSIMPLE: [u8; 112usize] = UsedEventSimple::spec_xdr(); -impl UsedEventSimple { - pub const fn spec_xdr() -> [u8; 112usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x0fUsedEventSimple\0\0\0\0\x01\0\0\0\x11used_event_simple\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" - } -} -impl soroban_sdk::SpecShakingMarker for UsedEventSimple { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } -} -impl soroban_sdk::Event for UsedEventSimple { - fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { - use soroban_sdk::IntoVal; - (&{ soroban_sdk::Symbol::new(env, "used_event_simple") }, { - let v: soroban_sdk::Val = self.kind.into_val(env); - v - }) - .into_val(env) - } - fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { - use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["amount"]; - let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; - env.map_new_from_slices(&KEYS, &vals) - .unwrap_infallible() - .into() - } -} -impl UsedEventSimple { - pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); - <_ as soroban_sdk::Event>::publish(self, env); - } -} -pub enum UsedEventTopicType { - Transfer = 1, - Mint = 2, -} -#[automatically_derived] -impl ::core::marker::Copy for UsedEventTopicType {} -#[automatically_derived] -impl ::core::clone::Clone for UsedEventTopicType { - #[inline] - fn clone(&self) -> UsedEventTopicType { - *self - } -} -#[automatically_derived] -impl ::core::fmt::Debug for UsedEventTopicType { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( - f, - match self { - UsedEventTopicType::Transfer => "Transfer", - UsedEventTopicType::Mint => "Mint", - }, - ) + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventTopicType { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} -} -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventTopicType {} +impl ::core::marker::StructuralPartialEq for UsedRefDataType {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventTopicType { +impl ::core::cmp::PartialEq for UsedRefDataType { #[inline] - fn eq(&self, other: &UsedEventTopicType) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr + fn eq(&self, other: &UsedRefDataType) -> bool { + self.nested == other.nested } } -pub static __SPEC_XDR_TYPE_USEDEVENTTOPICTYPE: [u8; 76usize] = UsedEventTopicType::spec_xdr(); -impl UsedEventTopicType { +pub static __SPEC_XDR_TYPE_USEDREFDATATYPE: [u8; 76usize] = UsedRefDataType::spec_xdr(); +impl UsedRefDataType { pub const fn spec_xdr() -> [u8; 76usize] { - *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventTopicType\0\0\0\0\0\x02\0\0\0\0\0\0\0\x08Transfer\0\0\0\x01\0\0\0\0\0\0\0\x04Mint\0\0\0\x02" + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fUsedRefDataType\0\0\0\0\x01\0\0\0\0\0\0\0\x06nested\0\0\0\0\x07\xd0\0\0\0\x10UsedRefDataInner" } } -impl soroban_sdk::SpecShakingMarker for UsedEventTopicType { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() {} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedRefDataType { + const SPEC_TYPE_ID: [u8; 32] = *b"'\xbd_A\r\x9a\x89\x02l\x941T>\xcd\xc3\xafg\xb6\x01\xa4D\x15\xa9\xf5\xfd\x1d\r\xfe\xb8\xe90A"; } -impl soroban_sdk::TryFromVal for UsedEventTopicType { +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDREFDATATYPE: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 2, + *b"'\xbd_A\r\x9a\x89\x02l\x941T>\xcd\xc3\xafg\xb6\x01\xa4D\x15\xa9\xf5\xfd\x1d\r\xfe\xb8\xe90A", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::TryFromVal for UsedRefDataType { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::TryIntoVal; - let discriminant: u32 = val.try_into_val(env)?; - Ok(match discriminant { - 1u32 => Self::Transfer, - 2u32 => Self::Mint, - _ => Err(soroban_sdk::ConversionError {})?, + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["nested"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + nested: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventTopicType, + val: &UsedRefDataType, ) -> Result { - Ok(match val { - UsedEventTopicType::Transfer => 1u32.into(), - UsedEventTopicType::Mint => 2u32.into(), - }) + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["nested"]; + let vals: [Val; 1usize] = [(&val.nested) + .try_into_val(env) + .map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventTopicType, + val: &&UsedRefDataType, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedEventTopicType { +impl soroban_sdk::TryFromVal for UsedRefDataType { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + nested: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "nested" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } +} +impl soroban_sdk::TryFromVal for UsedRefDataType { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::xdr::ScVal, ) -> Result { - if let soroban_sdk::xdr::ScVal::U32(discriminant) = val { - Ok(match *discriminant { - 1u32 => Self::Transfer, - 2u32 => Self::Mint, - _ => Err(soroban_sdk::xdr::Error::Invalid)?, - }) + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) } else { Err(soroban_sdk::xdr::Error::Invalid) } } } -impl TryInto for &UsedEventTopicType { +impl TryFrom<&UsedRefDataType> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_into(self) -> Result { - Ok(match self { - UsedEventTopicType::Transfer => 1u32.into(), - UsedEventTopicType::Mint => 2u32.into(), - }) + fn try_from(val: &UsedRefDataType) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "nested" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.nested) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } +} +impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedRefDataType) -> Result { + (&val).try_into() + } +} +impl TryFrom<&UsedRefDataType> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedRefDataType) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryInto for UsedEventTopicType { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_into(self) -> Result { - Ok(match self { - UsedEventTopicType::Transfer => 1u32.into(), - UsedEventTopicType::Mint => 2u32.into(), - }) + fn try_from(val: UsedRefDataType) -> Result { + (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub enum ArbitraryUsedEventTopicType { - Transfer, - Mint, + pub struct ArbitraryUsedRefDataType { + nested: + ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedEventTopicType { + impl ::core::fmt::Debug for ArbitraryUsedRefDataType { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( + ::core::fmt::Formatter::debug_struct_field1_finish( f, - match self { - ArbitraryUsedEventTopicType::Transfer => "Transfer", - ArbitraryUsedEventTopicType::Mint => "Mint", - }, + "ArbitraryUsedRefDataType", + "nested", + &&self.nested, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedEventTopicType { + impl ::core::clone::Clone for ArbitraryUsedRefDataType { #[inline] - fn clone(&self) -> ArbitraryUsedEventTopicType { - match self { - ArbitraryUsedEventTopicType::Transfer => ArbitraryUsedEventTopicType::Transfer, - ArbitraryUsedEventTopicType::Mint => ArbitraryUsedEventTopicType::Mint, + fn clone(&self) -> ArbitraryUsedRefDataType { + ArbitraryUsedRefDataType { + nested: ::core::clone::Clone::clone(&self.nested), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedEventTopicType { + impl ::core::cmp::Eq for ArbitraryUsedRefDataType { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventTopicType {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedRefDataType {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedEventTopicType { + impl ::core::cmp::PartialEq for ArbitraryUsedRefDataType { #[inline] - fn eq(&self, other: &ArbitraryUsedEventTopicType) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr + fn eq(&self, other: &ArbitraryUsedRefDataType) -> bool { + self.nested == other.nested } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedEventTopicType { + impl ::core::cmp::Ord for ArbitraryUsedRefDataType { #[inline] - fn cmp(&self, other: &ArbitraryUsedEventTopicType) -> ::core::cmp::Ordering { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) + fn cmp(&self, other: &ArbitraryUsedRefDataType) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.nested, &other.nested) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedEventTopicType { + impl ::core::cmp::PartialOrd for ArbitraryUsedRefDataType { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedEventTopicType, + other: &ArbitraryUsedRefDataType, ) -> ::core::option::Option<::core::cmp::Ordering> { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr) + ::core::cmp::PartialOrd::partial_cmp(&self.nested, &other.nested) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedEventTopicType: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedRefDataType: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -4357,11 +8908,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventTopicType { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedRefDataType { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefDataType.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -4370,19 +8921,12 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(u)?) * 2u64) >> 32 - { - 0u64 => ArbitraryUsedEventTopicType::Transfer, - 1u64 => ArbitraryUsedEventTopicType::Mint, - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryUsedRefDataType { + nested: arbitrary::Arbitrary::arbitrary(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefDataType.with(|count| { count.set(count.get() - 1); }); } @@ -4393,7 +8937,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefDataType.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -4402,20 +8946,12 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(&mut u)?) * 2u64) - >> 32 - { - 0u64 => ArbitraryUsedEventTopicType::Transfer, - 1u64 => ArbitraryUsedEventTopicType::Mint, - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryUsedRefDataType { + nested: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefDataType.with(|count| { count.set(count.get() - 1); }); } @@ -4423,153 +8959,54 @@ const _: () = { } #[inline] fn size_hint(depth: usize) -> (usize, Option) { - arbitrary::size_hint::and( - ::size_hint(depth), - arbitrary::size_hint::recursion_guard(depth, |depth| { - arbitrary::size_hint::or_all(&[ - arbitrary::size_hint::and_all(&[]), - arbitrary::size_hint::and_all(&[]), - ]) - }), - ) + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventTopicType { - type Prototype = ArbitraryUsedEventTopicType; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedRefDataType { + type Prototype = ArbitraryUsedRefDataType; } - impl soroban_sdk::TryFromVal for UsedEventTopicType { + impl soroban_sdk::TryFromVal for UsedRefDataType { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedEventTopicType, + v: &ArbitraryUsedRefDataType, ) -> std::result::Result { - Ok(match v { - ArbitraryUsedEventTopicType::Transfer => UsedEventTopicType::Transfer, - ArbitraryUsedEventTopicType::Mint => UsedEventTopicType::Mint, + Ok(UsedRefDataType { + nested: soroban_sdk::IntoVal::into_val(&v.nested, env), }) } } }; -pub struct UsedEventWithTopicType { - pub kind: UsedEventTopicType, - pub amount: i128, -} -#[automatically_derived] -impl ::core::clone::Clone for UsedEventWithTopicType { - #[inline] - fn clone(&self) -> UsedEventWithTopicType { - UsedEventWithTopicType { - kind: ::core::clone::Clone::clone(&self.kind), - amount: ::core::clone::Clone::clone(&self.amount), - } - } -} -#[automatically_derived] -impl ::core::fmt::Debug for UsedEventWithTopicType { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( - f, - "UsedEventWithTopicType", - "kind", - &self.kind, - "amount", - &&self.amount, - ) - } -} -#[automatically_derived] -impl ::core::cmp::Eq for UsedEventWithTopicType { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; - } -} -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventWithTopicType {} -#[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventWithTopicType { - #[inline] - fn eq(&self, other: &UsedEventWithTopicType) -> bool { - self.amount == other.amount && self.kind == other.kind - } -} -pub static __SPEC_XDR_EVENT_USEDEVENTWITHTOPICTYPE: [u8; 152usize] = - UsedEventWithTopicType::spec_xdr(); -impl UsedEventWithTopicType { - pub const fn spec_xdr() -> [u8; 152usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x16UsedEventWithTopicType\0\0\0\0\0\x01\0\0\0\x1aused_event_with_topic_type\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\x07\xd0\0\0\0\x12UsedEventTopicType\0\0\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" - } -} -impl soroban_sdk::SpecShakingMarker for UsedEventWithTopicType { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } -} -impl soroban_sdk::Event for UsedEventWithTopicType { - fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { - use soroban_sdk::IntoVal; - ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_topic_type") }, - { - let v: soroban_sdk::Val = self.kind.into_val(env); - v - }, - ) - .into_val(env) - } - fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { - use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["amount"]; - let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; - env.map_new_from_slices(&KEYS, &vals) - .unwrap_infallible() - .into() - } -} -impl UsedEventWithTopicType { - pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); - <_ as soroban_sdk::Event>::publish(self, env); - } -} -pub struct UsedEventDataType { - pub x: u32, - pub y: u32, +pub struct UsedRefDataInner { + pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventDataType { +impl ::core::clone::Clone for UsedRefDataInner { #[inline] - fn clone(&self) -> UsedEventDataType { - UsedEventDataType { - x: ::core::clone::Clone::clone(&self.x), - y: ::core::clone::Clone::clone(&self.y), + fn clone(&self) -> UsedRefDataInner { + UsedRefDataInner { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventDataType { +impl ::core::fmt::Debug for UsedRefDataInner { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( - f, - "UsedEventDataType", - "x", - &self.x, - "y", - &&self.y, - ) + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedRefDataInner", "val", &&self.val) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventDataType { +impl ::core::cmp::Eq for UsedRefDataInner { #[inline] #[doc(hidden)] #[coverage(off)] @@ -4578,79 +9015,76 @@ impl ::core::cmp::Eq for UsedEventDataType { } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventDataType {} +impl ::core::marker::StructuralPartialEq for UsedRefDataInner {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventDataType { +impl ::core::cmp::PartialEq for UsedRefDataInner { #[inline] - fn eq(&self, other: &UsedEventDataType) -> bool { - self.x == other.x && self.y == other.y + fn eq(&self, other: &UsedRefDataInner) -> bool { + self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDEVENTDATATYPE: [u8; 72usize] = UsedEventDataType::spec_xdr(); -impl UsedEventDataType { - pub const fn spec_xdr() -> [u8; 72usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedEventDataType\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x04\0\0\0\0\0\0\0\x01y\0\0\0\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDREFDATAINNER: [u8; 52usize] = UsedRefDataInner::spec_xdr(); +impl UsedRefDataInner { + pub const fn spec_xdr() -> [u8; 52usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedRefDataInner\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UsedEventDataType { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedRefDataInner { + const SPEC_TYPE_ID: [u8; 32] = + *b"K\xdf'8m/\xe8\x1dr\xe0'{3\xa9\xe0\\\x0c\xeb\xc4\xe3\xb3\nA\xfey\xf4\x11\x13\xd2\x08{~"; } -impl soroban_sdk::TryFromVal for UsedEventDataType { +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDREFDATAINNER: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"K\xdf'8m/\xe8\x1dr\xe0'{3\xa9\xe0\\\x0c\xeb\xc4\xe3\xb3\nA\xfey\xf4\x11\x13\xd2\x08{~", + [], + ); +impl soroban_sdk::TryFromVal for UsedRefDataInner { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 2usize] = ["x", "y"]; - let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - x: vals[0] - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?, - y: vals[1] + val: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventDataType, + val: &UsedRefDataInner, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 2usize] = ["x", "y"]; - let vals: [Val; 2usize] = [ - (&val.x).try_into_val(env).map_err(|_| ConversionError)?, - (&val.y).try_into_val(env).map_err(|_| ConversionError)?, - ]; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventDataType, + val: &&UsedRefDataInner, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedEventDataType { +impl soroban_sdk::TryFromVal for UsedRefDataInner { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -4660,29 +9094,15 @@ impl soroban_sdk::TryFromVal for Used use soroban_sdk::xdr::Validate; use soroban_sdk::TryIntoVal; let map = val; - if map.len() != 2usize { + if map.len() != 1usize { return Err(soroban_sdk::xdr::Error::Invalid); } map.validate()?; Ok(Self { - x: { - let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "x".try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - ) - .into(); - let idx = map - .binary_search_by_key(&key, |entry| entry.key.clone()) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; - let rv: soroban_sdk::Val = (&map[idx].val.clone()) - .try_into_val(env) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; - rv.try_into_val(env) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)? - }, - y: { + val: { let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "y".try_into() + "val" + .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(); @@ -4698,7 +9118,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedEventDataType { +impl soroban_sdk::TryFromVal for UsedRefDataInner { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -4712,90 +9132,77 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedEventDataType> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedRefDataInner> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventDataType) -> Result { + fn try_from(val: &UsedRefDataInner) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ soroban_sdk::xdr::ScMapEntry { key: soroban_sdk::xdr::ScSymbol( - "x".try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - ) - .into(), - val: (&val.x) - .try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - }, - soroban_sdk::xdr::ScMapEntry { - key: soroban_sdk::xdr::ScSymbol( - "y".try_into() + "val" + .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(), - val: (&val.y) + val: (&val.val) .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, }, ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventDataType) -> Result { + fn try_from(val: UsedRefDataInner) -> Result { (&val).try_into() } } -impl TryFrom<&UsedEventDataType> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedRefDataInner> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventDataType) -> Result { + fn try_from(val: &UsedRefDataInner) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventDataType) -> Result { + fn try_from(val: UsedRefDataInner) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedEventDataType { - x: ::Prototype, - y: ::Prototype, + pub struct ArbitraryUsedRefDataInner { + val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedEventDataType { + impl ::core::fmt::Debug for ArbitraryUsedRefDataInner { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( + ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedEventDataType", - "x", - &self.x, - "y", - &&self.y, + "ArbitraryUsedRefDataInner", + "val", + &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedEventDataType { + impl ::core::clone::Clone for ArbitraryUsedRefDataInner { #[inline] - fn clone(&self) -> ArbitraryUsedEventDataType { - ArbitraryUsedEventDataType { - x: ::core::clone::Clone::clone(&self.x), - y: ::core::clone::Clone::clone(&self.y), + fn clone(&self) -> ArbitraryUsedRefDataInner { + ArbitraryUsedRefDataInner { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedEventDataType { + impl ::core::cmp::Eq for ArbitraryUsedRefDataInner { #[inline] #[doc(hidden)] #[coverage(off)] @@ -4803,48 +9210,37 @@ const _: () = { let _: ::core::cmp::AssertParamIsEq< ::Prototype, >; - let _: ::core::cmp::AssertParamIsEq< - ::Prototype, - >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventDataType {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedRefDataInner {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedEventDataType { + impl ::core::cmp::PartialEq for ArbitraryUsedRefDataInner { #[inline] - fn eq(&self, other: &ArbitraryUsedEventDataType) -> bool { - self.x == other.x && self.y == other.y + fn eq(&self, other: &ArbitraryUsedRefDataInner) -> bool { + self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedEventDataType { + impl ::core::cmp::Ord for ArbitraryUsedRefDataInner { #[inline] - fn cmp(&self, other: &ArbitraryUsedEventDataType) -> ::core::cmp::Ordering { - match ::core::cmp::Ord::cmp(&self.x, &other.x) { - ::core::cmp::Ordering::Equal => ::core::cmp::Ord::cmp(&self.y, &other.y), - cmp => cmp, - } + fn cmp(&self, other: &ArbitraryUsedRefDataInner) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedEventDataType { + impl ::core::cmp::PartialOrd for ArbitraryUsedRefDataInner { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedEventDataType, + other: &ArbitraryUsedRefDataInner, ) -> ::core::option::Option<::core::cmp::Ordering> { - match ::core::cmp::PartialOrd::partial_cmp(&self.x, &other.x) { - ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { - ::core::cmp::PartialOrd::partial_cmp(&self.y, &other.y) - } - cmp => cmp, - } + ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedEventDataType: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedRefDataInner: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -4878,11 +9274,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventDataType { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedRefDataInner { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefDataInner.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -4891,13 +9287,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventDataType { - x: arbitrary::Arbitrary::arbitrary(u)?, - y: arbitrary::Arbitrary::arbitrary(u)?, + Ok(ArbitraryUsedRefDataInner { + val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefDataInner.with(|count| { count.set(count.get() - 1); }); } @@ -4908,7 +9303,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefDataInner.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -4917,13 +9312,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventDataType { - x: arbitrary::Arbitrary::arbitrary(&mut u)?, - y: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + Ok(ArbitraryUsedRefDataInner { + val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRefDataInner.with(|count| { count.set(count.get() - 1); }); } @@ -4937,52 +9331,48 @@ const _: () = { <::Prototype as arbitrary::Arbitrary>::size_hint( depth, ), - <::Prototype as arbitrary::Arbitrary>::size_hint( - depth, - ), ], ) }) } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventDataType { - type Prototype = ArbitraryUsedEventDataType; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedRefDataInner { + type Prototype = ArbitraryUsedRefDataInner; } - impl soroban_sdk::TryFromVal for UsedEventDataType { + impl soroban_sdk::TryFromVal for UsedRefDataInner { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedEventDataType, + v: &ArbitraryUsedRefDataInner, ) -> std::result::Result { - Ok(UsedEventDataType { - x: soroban_sdk::IntoVal::into_val(&v.x, env), - y: soroban_sdk::IntoVal::into_val(&v.y, env), + Ok(UsedRefDataInner { + val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -pub struct UsedEventWithDataType { - pub kind: Symbol, - pub payload: UsedEventDataType, +pub struct UsedEventWithRefs<'a> { + pub kind: &'a UsedRefTopicType, + pub payload: &'a UsedRefDataType, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventWithDataType { +impl<'a> ::core::clone::Clone for UsedEventWithRefs<'a> { #[inline] - fn clone(&self) -> UsedEventWithDataType { - UsedEventWithDataType { + fn clone(&self) -> UsedEventWithRefs<'a> { + UsedEventWithRefs { kind: ::core::clone::Clone::clone(&self.kind), payload: ::core::clone::Clone::clone(&self.payload), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventWithDataType { +impl<'a> ::core::fmt::Debug for UsedEventWithRefs<'a> { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field2_finish( f, - "UsedEventWithDataType", + "UsedEventWithRefs", "kind", &self.kind, "payload", @@ -4991,44 +9381,45 @@ impl ::core::fmt::Debug for UsedEventWithDataType { } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventWithDataType { +impl<'a> ::core::cmp::Eq for UsedEventWithRefs<'a> { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq<&'a UsedRefTopicType>; + let _: ::core::cmp::AssertParamIsEq<&'a UsedRefDataType>; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventWithDataType {} +impl<'a> ::core::marker::StructuralPartialEq for UsedEventWithRefs<'a> {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventWithDataType { +impl<'a> ::core::cmp::PartialEq for UsedEventWithRefs<'a> { #[inline] - fn eq(&self, other: &UsedEventWithDataType) -> bool { + fn eq(&self, other: &UsedEventWithRefs<'a>) -> bool { self.kind == other.kind && self.payload == other.payload } } -pub static __SPEC_XDR_EVENT_USEDEVENTWITHDATATYPE: [u8; 152usize] = - UsedEventWithDataType::spec_xdr(); -impl UsedEventWithDataType { - pub const fn spec_xdr() -> [u8; 152usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x15UsedEventWithDataType\0\0\0\0\0\0\x01\0\0\0\x19used_event_with_data_type\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x11UsedEventDataType\0\0\0\0\0\0\0\0\0\0\x02" - } -} -impl soroban_sdk::SpecShakingMarker for UsedEventWithDataType { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); +pub static __SPEC_XDR_EVENT_USEDEVENTWITHREFS: [u8; 156usize] = UsedEventWithRefs::spec_xdr(); +impl<'a> UsedEventWithRefs<'a> { + pub const fn spec_xdr() -> [u8; 156usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x11UsedEventWithRefs\0\0\0\0\0\0\x01\0\0\0\x14used_event_with_refs\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\x07\xd0\0\0\0\x10UsedRefTopicType\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x0fUsedRefDataType\0\0\0\0\0\0\0\0\x02" } } -impl soroban_sdk::Event for UsedEventWithDataType { +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_EVENT_USEDEVENTWITHREFS: [u8; 106usize] = + soroban_sdk::spec_shaking::encode_graph_record::<106usize, 2usize>( + 1, + *b"[Q+\xe9\xde\xd5\xf2>`4p2\xd1G\xec\xe6\xac\x1a\x85\x03{\x04W3\x14\xde|\xac\xdc\x9bl\x99", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); +impl<'a> soroban_sdk::Event for UsedEventWithRefs<'a> { fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { use soroban_sdk::IntoVal; ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_data_type") }, + &{ soroban_sdk::Symbol::new(env, "used_event_with_refs") }, { let v: soroban_sdk::Val = self.kind.into_val(env); v @@ -5045,116 +9436,110 @@ impl soroban_sdk::Event for UsedEventWithDataType { .into() } } -impl UsedEventWithDataType { +impl<'a> UsedEventWithRefs<'a> { pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); <_ as soroban_sdk::Event>::publish(self, env); } } -pub struct UsedEventTopicOuter { - pub inner: UsedEventTopicInner, +pub struct UsedTupleElement { + pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventTopicOuter { +impl ::core::clone::Clone for UsedTupleElement { #[inline] - fn clone(&self) -> UsedEventTopicOuter { - UsedEventTopicOuter { - inner: ::core::clone::Clone::clone(&self.inner), + fn clone(&self) -> UsedTupleElement { + UsedTupleElement { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventTopicOuter { +impl ::core::fmt::Debug for UsedTupleElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( - f, - "UsedEventTopicOuter", - "inner", - &&self.inner, - ) + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedTupleElement", "val", &&self.val) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventTopicOuter { +impl ::core::cmp::Eq for UsedTupleElement { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventTopicOuter {} +impl ::core::marker::StructuralPartialEq for UsedTupleElement {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventTopicOuter { +impl ::core::cmp::PartialEq for UsedTupleElement { #[inline] - fn eq(&self, other: &UsedEventTopicOuter) -> bool { - self.inner == other.inner + fn eq(&self, other: &UsedTupleElement) -> bool { + self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDEVENTTOPICOUTER: [u8; 84usize] = UsedEventTopicOuter::spec_xdr(); -impl UsedEventTopicOuter { - pub const fn spec_xdr() -> [u8; 84usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedEventTopicOuter\0\0\0\0\x01\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x13UsedEventTopicInner\0" +pub static __SPEC_XDR_TYPE_USEDTUPLEELEMENT: [u8; 52usize] = UsedTupleElement::spec_xdr(); +impl UsedTupleElement { + pub const fn spec_xdr() -> [u8; 52usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedTupleElement\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UsedEventTopicOuter { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedTupleElement { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xde\x1dMa\x01\xec\xb0A\nT\x8b\x1e\xbb\x88\x034\xcfwRz\x7f\x1b\x05\xc2b1\xe7r8{\xce\xc7"; } -impl soroban_sdk::TryFromVal for UsedEventTopicOuter { +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDTUPLEELEMENT: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xde\x1dMa\x01\xec\xb0A\nT\x8b\x1e\xbb\x88\x034\xcfwRz\x7f\x1b\x05\xc2b1\xe7r8{\xce\xc7", + [], + ); +impl soroban_sdk::TryFromVal for UsedTupleElement { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["inner"]; + const KEYS: [&'static str; 1usize] = ["val"]; let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - inner: vals[0] + val: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventTopicOuter, + val: &UsedTupleElement, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["inner"]; - let vals: [Val; 1usize] = [(&val.inner) - .try_into_val(env) - .map_err(|_| ConversionError)?]; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventTopicOuter, + val: &&UsedTupleElement, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedEventTopicOuter { +impl soroban_sdk::TryFromVal for UsedTupleElement { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -5169,9 +9554,9 @@ impl soroban_sdk::TryFromVal for Used } map.validate()?; Ok(Self { - inner: { + val: { let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "inner" + "val" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) @@ -5188,7 +9573,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedEventTopicOuter { +impl soroban_sdk::TryFromVal for UsedTupleElement { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -5202,116 +9587,115 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedEventTopicOuter> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedTupleElement> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventTopicOuter) -> Result { + fn try_from(val: &UsedTupleElement) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ soroban_sdk::xdr::ScMapEntry { key: soroban_sdk::xdr::ScSymbol( - "inner" + "val" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(), - val: (&val.inner) + val: (&val.val) .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, }, ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventTopicOuter) -> Result { + fn try_from(val: UsedTupleElement) -> Result { (&val).try_into() } } -impl TryFrom<&UsedEventTopicOuter> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedTupleElement> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventTopicOuter) -> Result { + fn try_from(val: &UsedTupleElement) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventTopicOuter) -> Result { + fn try_from(val: UsedTupleElement) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedEventTopicOuter { - inner: - ::Prototype, + pub struct ArbitraryUsedTupleElement { + val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedEventTopicOuter { + impl ::core::fmt::Debug for ArbitraryUsedTupleElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedEventTopicOuter", - "inner", - &&self.inner, + "ArbitraryUsedTupleElement", + "val", + &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedEventTopicOuter { + impl ::core::clone::Clone for ArbitraryUsedTupleElement { #[inline] - fn clone(&self) -> ArbitraryUsedEventTopicOuter { - ArbitraryUsedEventTopicOuter { - inner: ::core::clone::Clone::clone(&self.inner), + fn clone(&self) -> ArbitraryUsedTupleElement { + ArbitraryUsedTupleElement { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedEventTopicOuter { + impl ::core::cmp::Eq for ArbitraryUsedTupleElement { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq< - ::Prototype, + ::Prototype, >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventTopicOuter {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedTupleElement {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedEventTopicOuter { + impl ::core::cmp::PartialEq for ArbitraryUsedTupleElement { #[inline] - fn eq(&self, other: &ArbitraryUsedEventTopicOuter) -> bool { - self.inner == other.inner + fn eq(&self, other: &ArbitraryUsedTupleElement) -> bool { + self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedEventTopicOuter { + impl ::core::cmp::Ord for ArbitraryUsedTupleElement { #[inline] - fn cmp(&self, other: &ArbitraryUsedEventTopicOuter) -> ::core::cmp::Ordering { - ::core::cmp::Ord::cmp(&self.inner, &other.inner) + fn cmp(&self, other: &ArbitraryUsedTupleElement) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedEventTopicOuter { + impl ::core::cmp::PartialOrd for ArbitraryUsedTupleElement { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedEventTopicOuter, + other: &ArbitraryUsedTupleElement, ) -> ::core::option::Option<::core::cmp::Ordering> { - ::core::cmp::PartialOrd::partial_cmp(&self.inner, &other.inner) + ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedTupleElement: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -5345,11 +9729,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventTopicOuter { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedTupleElement { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedTupleElement.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -5358,12 +9742,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventTopicOuter { - inner: arbitrary::Arbitrary::arbitrary(u)?, + Ok(ArbitraryUsedTupleElement { + val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedTupleElement.with(|count| { count.set(count.get() - 1); }); } @@ -5374,7 +9758,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedTupleElement.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -5383,12 +9767,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventTopicOuter { - inner: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + Ok(ArbitraryUsedTupleElement { + val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicOuter.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedTupleElement.with(|count| { count.set(count.get() - 1); }); } @@ -5399,7 +9783,7 @@ const _: () = { arbitrary::size_hint::recursion_guard(depth, |depth| { arbitrary::size_hint::and_all( &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( + <::Prototype as arbitrary::Arbitrary>::size_hint( depth, ), ], @@ -5408,49 +9792,47 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventTopicOuter { - type Prototype = ArbitraryUsedEventTopicOuter; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedTupleElement { + type Prototype = ArbitraryUsedTupleElement; } - impl soroban_sdk::TryFromVal - for UsedEventTopicOuter - { + impl soroban_sdk::TryFromVal for UsedTupleElement { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedEventTopicOuter, + v: &ArbitraryUsedTupleElement, ) -> std::result::Result { - Ok(UsedEventTopicOuter { - inner: soroban_sdk::IntoVal::into_val(&v.inner, env), + Ok(UsedTupleElement { + val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -pub struct UsedEventTopicInner { +pub struct UsedTupleReturnElement { pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventTopicInner { +impl ::core::clone::Clone for UsedTupleReturnElement { #[inline] - fn clone(&self) -> UsedEventTopicInner { - UsedEventTopicInner { + fn clone(&self) -> UsedTupleReturnElement { + UsedTupleReturnElement { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventTopicInner { +impl ::core::fmt::Debug for UsedTupleReturnElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedEventTopicInner", + "UsedTupleReturnElement", "val", &&self.val, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventTopicInner { +impl ::core::cmp::Eq for UsedTupleReturnElement { #[inline] #[doc(hidden)] #[coverage(off)] @@ -5459,28 +9841,34 @@ impl ::core::cmp::Eq for UsedEventTopicInner { } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventTopicInner {} +impl ::core::marker::StructuralPartialEq for UsedTupleReturnElement {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventTopicInner { +impl ::core::cmp::PartialEq for UsedTupleReturnElement { #[inline] - fn eq(&self, other: &UsedEventTopicInner) -> bool { + fn eq(&self, other: &UsedTupleReturnElement) -> bool { self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDEVENTTOPICINNER: [u8; 56usize] = UsedEventTopicInner::spec_xdr(); -impl UsedEventTopicInner { - pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedEventTopicInner\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDTUPLERETURNELEMENT: [u8; 60usize] = + UsedTupleReturnElement::spec_xdr(); +impl UsedTupleReturnElement { + pub const fn spec_xdr() -> [u8; 60usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x16UsedTupleReturnElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UsedEventTopicInner { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedTupleReturnElement { + const SPEC_TYPE_ID: [u8; 32] = *b"Y\xa66\xb3\xecxE\x13\xdaZ\xbe\xa2r?J\xa2D\xc2\xd8\xb5\x1d8\xd1tn\x9d\x10\x86\x04\x1a\xf2\x1b"; } -impl soroban_sdk::TryFromVal for UsedEventTopicInner { +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDTUPLERETURNELEMENT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"Y\xa66\xb3\xecxE\x13\xdaZ\xbe\xa2r?J\xa2D\xc2\xd8\xb5\x1d8\xd1tn\x9d\x10\x86\x04\x1a\xf2\x1b", + [], +); +impl soroban_sdk::TryFromVal for UsedTupleReturnElement { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -5499,11 +9887,11 @@ impl soroban_sdk::TryFromVal for UsedEventTo }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventTopicInner, + val: &UsedTupleReturnElement, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["val"]; @@ -5514,19 +9902,19 @@ impl soroban_sdk::TryFromVal for soroban_ .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventTopicInner, + val: &&UsedTupleReturnElement, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( + <_ as soroban_sdk::TryFromVal>::try_from_val( env, *val, ) } } -impl soroban_sdk::TryFromVal for UsedEventTopicInner { +impl soroban_sdk::TryFromVal for UsedTupleReturnElement { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -5560,7 +9948,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedEventTopicInner { +impl soroban_sdk::TryFromVal for UsedTupleReturnElement { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -5574,10 +9962,10 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedEventTopicInner> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedTupleReturnElement> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventTopicInner) -> Result { + fn try_from(val: &UsedTupleReturnElement) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ @@ -5595,56 +9983,56 @@ impl TryFrom<&UsedEventTopicInner> for soroban_sdk::xdr::ScMap { ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventTopicInner) -> Result { + fn try_from(val: UsedTupleReturnElement) -> Result { (&val).try_into() } } -impl TryFrom<&UsedEventTopicInner> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedTupleReturnElement> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventTopicInner) -> Result { + fn try_from(val: &UsedTupleReturnElement) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventTopicInner) -> Result { + fn try_from(val: UsedTupleReturnElement) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedEventTopicInner { + pub struct ArbitraryUsedTupleReturnElement { val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedEventTopicInner { + impl ::core::fmt::Debug for ArbitraryUsedTupleReturnElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedEventTopicInner", + "ArbitraryUsedTupleReturnElement", "val", &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedEventTopicInner { + impl ::core::clone::Clone for ArbitraryUsedTupleReturnElement { #[inline] - fn clone(&self) -> ArbitraryUsedEventTopicInner { - ArbitraryUsedEventTopicInner { + fn clone(&self) -> ArbitraryUsedTupleReturnElement { + ArbitraryUsedTupleReturnElement { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedEventTopicInner { + impl ::core::cmp::Eq for ArbitraryUsedTupleReturnElement { #[inline] #[doc(hidden)] #[coverage(off)] @@ -5655,34 +10043,34 @@ const _: () = { } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventTopicInner {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedTupleReturnElement {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedEventTopicInner { + impl ::core::cmp::PartialEq for ArbitraryUsedTupleReturnElement { #[inline] - fn eq(&self, other: &ArbitraryUsedEventTopicInner) -> bool { + fn eq(&self, other: &ArbitraryUsedTupleReturnElement) -> bool { self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedEventTopicInner { + impl ::core::cmp::Ord for ArbitraryUsedTupleReturnElement { #[inline] - fn cmp(&self, other: &ArbitraryUsedEventTopicInner) -> ::core::cmp::Ordering { + fn cmp(&self, other: &ArbitraryUsedTupleReturnElement) -> ::core::cmp::Ordering { ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedEventTopicInner { + impl ::core::cmp::PartialOrd for ArbitraryUsedTupleReturnElement { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedEventTopicInner, + other: &ArbitraryUsedTupleReturnElement, ) -> ::core::option::Option<::core::cmp::Ordering> { ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedEventTopicInner: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -5716,11 +10104,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventTopicInner { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedTupleReturnElement { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -5729,12 +10117,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventTopicInner { + Ok(ArbitraryUsedTupleReturnElement { val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement.with(|count| { count.set(count.get() - 1); }); } @@ -5745,7 +10133,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -5754,12 +10142,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventTopicInner { + Ok(ArbitraryUsedTupleReturnElement { val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventTopicInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement.with(|count| { count.set(count.get() - 1); }); } @@ -5779,216 +10167,130 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventTopicInner { - type Prototype = ArbitraryUsedEventTopicInner; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedTupleReturnElement { + type Prototype = ArbitraryUsedTupleReturnElement; } - impl soroban_sdk::TryFromVal - for UsedEventTopicInner + impl soroban_sdk::TryFromVal + for UsedTupleReturnElement { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedEventTopicInner, + v: &ArbitraryUsedTupleReturnElement, ) -> std::result::Result { - Ok(UsedEventTopicInner { + Ok(UsedTupleReturnElement { val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -pub struct UsedEventWithNestedTopic { - pub info: UsedEventTopicOuter, - pub amount: i128, -} -#[automatically_derived] -impl ::core::clone::Clone for UsedEventWithNestedTopic { - #[inline] - fn clone(&self) -> UsedEventWithNestedTopic { - UsedEventWithNestedTopic { - info: ::core::clone::Clone::clone(&self.info), - amount: ::core::clone::Clone::clone(&self.amount), - } - } -} -#[automatically_derived] -impl ::core::fmt::Debug for UsedEventWithNestedTopic { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( - f, - "UsedEventWithNestedTopic", - "info", - &self.info, - "amount", - &&self.amount, - ) - } -} -#[automatically_derived] -impl ::core::cmp::Eq for UsedEventWithNestedTopic { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; - } -} -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventWithNestedTopic {} -#[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventWithNestedTopic { - #[inline] - fn eq(&self, other: &UsedEventWithNestedTopic) -> bool { - self.amount == other.amount && self.info == other.info - } -} -pub static __SPEC_XDR_EVENT_USEDEVENTWITHNESTEDTOPIC: [u8; 152usize] = - UsedEventWithNestedTopic::spec_xdr(); -impl UsedEventWithNestedTopic { - pub const fn spec_xdr() -> [u8; 152usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x18UsedEventWithNestedTopic\0\0\0\x01\0\0\0\x1cused_event_with_nested_topic\0\0\0\x02\0\0\0\0\0\0\0\x04info\0\0\x07\xd0\0\0\0\x13UsedEventTopicOuter\0\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" - } -} -impl soroban_sdk::SpecShakingMarker for UsedEventWithNestedTopic { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } -} -impl soroban_sdk::Event for UsedEventWithNestedTopic { - fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { - use soroban_sdk::IntoVal; - ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_nested_topic") }, - { - let v: soroban_sdk::Val = self.info.into_val(env); - v - }, - ) - .into_val(env) - } - fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { - use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["amount"]; - let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; - env.map_new_from_slices(&KEYS, &vals) - .unwrap_infallible() - .into() - } -} -impl UsedEventWithNestedTopic { - pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); - <_ as soroban_sdk::Event>::publish(self, env); - } -} -pub struct UsedEventDataOuter { - pub inner: UsedEventDataInner, +pub struct UsedVecInnerVecElement { + pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventDataOuter { +impl ::core::clone::Clone for UsedVecInnerVecElement { #[inline] - fn clone(&self) -> UsedEventDataOuter { - UsedEventDataOuter { - inner: ::core::clone::Clone::clone(&self.inner), + fn clone(&self) -> UsedVecInnerVecElement { + UsedVecInnerVecElement { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventDataOuter { +impl ::core::fmt::Debug for UsedVecInnerVecElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedEventDataOuter", - "inner", - &&self.inner, + "UsedVecInnerVecElement", + "val", + &&self.val, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventDataOuter { +impl ::core::cmp::Eq for UsedVecInnerVecElement { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventDataOuter {} +impl ::core::marker::StructuralPartialEq for UsedVecInnerVecElement {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventDataOuter { +impl ::core::cmp::PartialEq for UsedVecInnerVecElement { #[inline] - fn eq(&self, other: &UsedEventDataOuter) -> bool { - self.inner == other.inner + fn eq(&self, other: &UsedVecInnerVecElement) -> bool { + self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDEVENTDATAOUTER: [u8; 84usize] = UsedEventDataOuter::spec_xdr(); -impl UsedEventDataOuter { - pub const fn spec_xdr() -> [u8; 84usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventDataOuter\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x12UsedEventDataInner\0\0" +pub static __SPEC_XDR_TYPE_USEDVECINNERVECELEMENT: [u8; 60usize] = + UsedVecInnerVecElement::spec_xdr(); +impl UsedVecInnerVecElement { + pub const fn spec_xdr() -> [u8; 60usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x16UsedVecInnerVecElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UsedEventDataOuter { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedVecInnerVecElement { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xcf@%X\xde+J@\xc4\xe7\xb8=\xdd(\x16za\xe2\xb0\xa6\x9e>\xc6h\x18\xc6\xdfl\0s\xa3D"; } -impl soroban_sdk::TryFromVal for UsedEventDataOuter { +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDVECINNERVECELEMENT: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xcf@%X\xde+J@\xc4\xe7\xb8=\xdd(\x16za\xe2\xb0\xa6\x9e>\xc6h\x18\xc6\xdfl\0s\xa3D", + [], + ); +impl soroban_sdk::TryFromVal for UsedVecInnerVecElement { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["inner"]; + const KEYS: [&'static str; 1usize] = ["val"]; let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - inner: vals[0] + val: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventDataOuter, + val: &UsedVecInnerVecElement, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["inner"]; - let vals: [Val; 1usize] = [(&val.inner) - .try_into_val(env) - .map_err(|_| ConversionError)?]; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventDataOuter, + val: &&UsedVecInnerVecElement, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( + <_ as soroban_sdk::TryFromVal>::try_from_val( env, *val, ) } } -impl soroban_sdk::TryFromVal for UsedEventDataOuter { +impl soroban_sdk::TryFromVal for UsedVecInnerVecElement { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -6003,9 +10305,9 @@ impl soroban_sdk::TryFromVal for Used } map.validate()?; Ok(Self { - inner: { + val: { let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "inner" + "val" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) @@ -6022,7 +10324,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedEventDataOuter { +impl soroban_sdk::TryFromVal for UsedVecInnerVecElement { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -6036,116 +10338,115 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedEventDataOuter> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedVecInnerVecElement> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventDataOuter) -> Result { + fn try_from(val: &UsedVecInnerVecElement) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ soroban_sdk::xdr::ScMapEntry { key: soroban_sdk::xdr::ScSymbol( - "inner" + "val" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(), - val: (&val.inner) + val: (&val.val) .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, }, ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventDataOuter) -> Result { + fn try_from(val: UsedVecInnerVecElement) -> Result { (&val).try_into() } } -impl TryFrom<&UsedEventDataOuter> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedVecInnerVecElement> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventDataOuter) -> Result { + fn try_from(val: &UsedVecInnerVecElement) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventDataOuter) -> Result { + fn try_from(val: UsedVecInnerVecElement) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedEventDataOuter { - inner: - ::Prototype, + pub struct ArbitraryUsedVecInnerVecElement { + val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedEventDataOuter { + impl ::core::fmt::Debug for ArbitraryUsedVecInnerVecElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedEventDataOuter", - "inner", - &&self.inner, + "ArbitraryUsedVecInnerVecElement", + "val", + &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedEventDataOuter { + impl ::core::clone::Clone for ArbitraryUsedVecInnerVecElement { #[inline] - fn clone(&self) -> ArbitraryUsedEventDataOuter { - ArbitraryUsedEventDataOuter { - inner: ::core::clone::Clone::clone(&self.inner), + fn clone(&self) -> ArbitraryUsedVecInnerVecElement { + ArbitraryUsedVecInnerVecElement { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedEventDataOuter { + impl ::core::cmp::Eq for ArbitraryUsedVecInnerVecElement { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq< - ::Prototype, + ::Prototype, >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventDataOuter {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedVecInnerVecElement {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedEventDataOuter { + impl ::core::cmp::PartialEq for ArbitraryUsedVecInnerVecElement { #[inline] - fn eq(&self, other: &ArbitraryUsedEventDataOuter) -> bool { - self.inner == other.inner + fn eq(&self, other: &ArbitraryUsedVecInnerVecElement) -> bool { + self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedEventDataOuter { + impl ::core::cmp::Ord for ArbitraryUsedVecInnerVecElement { #[inline] - fn cmp(&self, other: &ArbitraryUsedEventDataOuter) -> ::core::cmp::Ordering { - ::core::cmp::Ord::cmp(&self.inner, &other.inner) + fn cmp(&self, other: &ArbitraryUsedVecInnerVecElement) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedEventDataOuter { + impl ::core::cmp::PartialOrd for ArbitraryUsedVecInnerVecElement { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedEventDataOuter, + other: &ArbitraryUsedVecInnerVecElement, ) -> ::core::option::Option<::core::cmp::Ordering> { - ::core::cmp::PartialOrd::partial_cmp(&self.inner, &other.inner) + ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedEventDataOuter: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedVecInnerVecElement: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -6179,11 +10480,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventDataOuter { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedVecInnerVecElement { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataOuter.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecInnerVecElement.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -6192,12 +10493,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventDataOuter { - inner: arbitrary::Arbitrary::arbitrary(u)?, + Ok(ArbitraryUsedVecInnerVecElement { + val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataOuter.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecInnerVecElement.with(|count| { count.set(count.get() - 1); }); } @@ -6208,7 +10509,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataOuter.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecInnerVecElement.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -6217,12 +10518,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventDataOuter { - inner: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + Ok(ArbitraryUsedVecInnerVecElement { + val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataOuter.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecInnerVecElement.with(|count| { count.set(count.get() - 1); }); } @@ -6233,7 +10534,7 @@ const _: () = { arbitrary::size_hint::recursion_guard(depth, |depth| { arbitrary::size_hint::and_all( &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( + <::Prototype as arbitrary::Arbitrary>::size_hint( depth, ), ], @@ -6242,47 +10543,49 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventDataOuter { - type Prototype = ArbitraryUsedEventDataOuter; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedVecInnerVecElement { + type Prototype = ArbitraryUsedVecInnerVecElement; } - impl soroban_sdk::TryFromVal for UsedEventDataOuter { + impl soroban_sdk::TryFromVal + for UsedVecInnerVecElement + { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedEventDataOuter, + v: &ArbitraryUsedVecInnerVecElement, ) -> std::result::Result { - Ok(UsedEventDataOuter { - inner: soroban_sdk::IntoVal::into_val(&v.inner, env), + Ok(UsedVecInnerVecElement { + val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -pub struct UsedEventDataInner { +pub struct UsedVecInnerElement { pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventDataInner { +impl ::core::clone::Clone for UsedVecInnerElement { #[inline] - fn clone(&self) -> UsedEventDataInner { - UsedEventDataInner { + fn clone(&self) -> UsedVecInnerElement { + UsedVecInnerElement { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventDataInner { +impl ::core::fmt::Debug for UsedVecInnerElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedEventDataInner", + "UsedVecInnerElement", "val", &&self.val, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventDataInner { +impl ::core::cmp::Eq for UsedVecInnerElement { #[inline] #[doc(hidden)] #[coverage(off)] @@ -6291,28 +10594,32 @@ impl ::core::cmp::Eq for UsedEventDataInner { } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventDataInner {} +impl ::core::marker::StructuralPartialEq for UsedVecInnerElement {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventDataInner { +impl ::core::cmp::PartialEq for UsedVecInnerElement { #[inline] - fn eq(&self, other: &UsedEventDataInner) -> bool { + fn eq(&self, other: &UsedVecInnerElement) -> bool { self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDEVENTDATAINNER: [u8; 56usize] = UsedEventDataInner::spec_xdr(); -impl UsedEventDataInner { +pub static __SPEC_XDR_TYPE_USEDVECINNERELEMENT: [u8; 56usize] = UsedVecInnerElement::spec_xdr(); +impl UsedVecInnerElement { pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventDataInner\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedVecInnerElement\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UsedEventDataInner { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedVecInnerElement { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xb4\xabN]\xe3\xeaA\xd6AQ\x80Y\xe9H\xaa6L/k\xb0\x17\xcdg\x92=\x8f\x8dA\xeaXP\x18"; } -impl soroban_sdk::TryFromVal for UsedEventDataInner { +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDVECINNERELEMENT: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xb4\xabN]\xe3\xeaA\xd6AQ\x80Y\xe9H\xaa6L/k\xb0\x17\xcdg\x92=\x8f\x8dA\xeaXP\x18", + [], + ); +impl soroban_sdk::TryFromVal for UsedVecInnerElement { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -6331,11 +10638,11 @@ impl soroban_sdk::TryFromVal for UsedEventDa }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventDataInner, + val: &UsedVecInnerElement, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["val"]; @@ -6346,19 +10653,19 @@ impl soroban_sdk::TryFromVal for soroban_s .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventDataInner, + val: &&UsedVecInnerElement, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( + <_ as soroban_sdk::TryFromVal>::try_from_val( env, *val, ) } } -impl soroban_sdk::TryFromVal for UsedEventDataInner { +impl soroban_sdk::TryFromVal for UsedVecInnerElement { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -6392,7 +10699,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedEventDataInner { +impl soroban_sdk::TryFromVal for UsedVecInnerElement { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -6406,10 +10713,10 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedEventDataInner> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedVecInnerElement> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventDataInner) -> Result { + fn try_from(val: &UsedVecInnerElement) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ @@ -6427,56 +10734,56 @@ impl TryFrom<&UsedEventDataInner> for soroban_sdk::xdr::ScMap { ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventDataInner) -> Result { + fn try_from(val: UsedVecInnerElement) -> Result { (&val).try_into() } } -impl TryFrom<&UsedEventDataInner> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedVecInnerElement> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedEventDataInner) -> Result { + fn try_from(val: &UsedVecInnerElement) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedEventDataInner) -> Result { + fn try_from(val: UsedVecInnerElement) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedEventDataInner { + pub struct ArbitraryUsedVecInnerElement { val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedEventDataInner { + impl ::core::fmt::Debug for ArbitraryUsedVecInnerElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedEventDataInner", + "ArbitraryUsedVecInnerElement", "val", &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedEventDataInner { + impl ::core::clone::Clone for ArbitraryUsedVecInnerElement { #[inline] - fn clone(&self) -> ArbitraryUsedEventDataInner { - ArbitraryUsedEventDataInner { + fn clone(&self) -> ArbitraryUsedVecInnerElement { + ArbitraryUsedVecInnerElement { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedEventDataInner { + impl ::core::cmp::Eq for ArbitraryUsedVecInnerElement { #[inline] #[doc(hidden)] #[coverage(off)] @@ -6487,34 +10794,34 @@ const _: () = { } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedEventDataInner {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedVecInnerElement {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedEventDataInner { + impl ::core::cmp::PartialEq for ArbitraryUsedVecInnerElement { #[inline] - fn eq(&self, other: &ArbitraryUsedEventDataInner) -> bool { + fn eq(&self, other: &ArbitraryUsedVecInnerElement) -> bool { self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedEventDataInner { + impl ::core::cmp::Ord for ArbitraryUsedVecInnerElement { #[inline] - fn cmp(&self, other: &ArbitraryUsedEventDataInner) -> ::core::cmp::Ordering { + fn cmp(&self, other: &ArbitraryUsedVecInnerElement) -> ::core::cmp::Ordering { ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedEventDataInner { + impl ::core::cmp::PartialOrd for ArbitraryUsedVecInnerElement { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedEventDataInner, + other: &ArbitraryUsedVecInnerElement, ) -> ::core::option::Option<::core::cmp::Ordering> { ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedEventDataInner: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedVecInnerElement: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -6548,11 +10855,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedEventDataInner { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedVecInnerElement { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecInnerElement.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -6561,12 +10868,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventDataInner { + Ok(ArbitraryUsedVecInnerElement { val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecInnerElement.with(|count| { count.set(count.get() - 1); }); } @@ -6577,7 +10884,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecInnerElement.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -6586,12 +10893,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedEventDataInner { + Ok(ArbitraryUsedVecInnerElement { val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedEventDataInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecInnerElement.with(|count| { count.set(count.get() - 1); }); } @@ -6611,314 +10918,405 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedEventDataInner { - type Prototype = ArbitraryUsedEventDataInner; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedVecInnerElement { + type Prototype = ArbitraryUsedVecInnerElement; } - impl soroban_sdk::TryFromVal for UsedEventDataInner { + impl soroban_sdk::TryFromVal + for UsedVecInnerElement + { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedEventDataInner, + v: &ArbitraryUsedVecInnerElement, ) -> std::result::Result { - Ok(UsedEventDataInner { + Ok(UsedVecInnerElement { val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -pub struct UsedEventWithNestedData { - pub kind: Symbol, - pub payload: UsedEventDataOuter, +pub struct UsedVecElementNested { + pub val: u32, + pub inner: UsedVecInnerElement, + pub vec_inner: Vec, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventWithNestedData { +impl ::core::clone::Clone for UsedVecElementNested { #[inline] - fn clone(&self) -> UsedEventWithNestedData { - UsedEventWithNestedData { - kind: ::core::clone::Clone::clone(&self.kind), - payload: ::core::clone::Clone::clone(&self.payload), + fn clone(&self) -> UsedVecElementNested { + UsedVecElementNested { + val: ::core::clone::Clone::clone(&self.val), + inner: ::core::clone::Clone::clone(&self.inner), + vec_inner: ::core::clone::Clone::clone(&self.vec_inner), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventWithNestedData { +impl ::core::fmt::Debug for UsedVecElementNested { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( + ::core::fmt::Formatter::debug_struct_field3_finish( f, - "UsedEventWithNestedData", - "kind", - &self.kind, - "payload", - &&self.payload, + "UsedVecElementNested", + "val", + &self.val, + "inner", + &self.inner, + "vec_inner", + &&self.vec_inner, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventWithNestedData { +impl ::core::cmp::Eq for UsedVecElementNested { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; - } -} -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventWithNestedData {} -#[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventWithNestedData { - #[inline] - fn eq(&self, other: &UsedEventWithNestedData) -> bool { - self.kind == other.kind && self.payload == other.payload - } -} -pub static __SPEC_XDR_EVENT_USEDEVENTWITHNESTEDDATA: [u8; 152usize] = - UsedEventWithNestedData::spec_xdr(); -impl UsedEventWithNestedData { - pub const fn spec_xdr() -> [u8; 152usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x17UsedEventWithNestedData\0\0\0\0\x01\0\0\0\x1bused_event_with_nested_data\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x12UsedEventDataOuter\0\0\0\0\0\0\0\0\0\x02" - } -} -impl soroban_sdk::SpecShakingMarker for UsedEventWithNestedData { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } -} -impl soroban_sdk::Event for UsedEventWithNestedData { - fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { - use soroban_sdk::IntoVal; - ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_nested_data") }, - { - let v: soroban_sdk::Val = self.kind.into_val(env); - v - }, - ) - .into_val(env) - } - fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { - use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["payload"]; - let vals: [soroban_sdk::Val; 1usize] = [self.payload.into_val(env)]; - env.map_new_from_slices(&KEYS, &vals) - .unwrap_infallible() - .into() - } -} -impl UsedEventWithNestedData { - pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); - <_ as soroban_sdk::Event>::publish(self, env); - } -} -pub enum UsedRefTopicType { - Send = 1, - Recv = 2, -} -#[automatically_derived] -impl ::core::marker::Copy for UsedRefTopicType {} -#[automatically_derived] -impl ::core::clone::Clone for UsedRefTopicType { - #[inline] - fn clone(&self) -> UsedRefTopicType { - *self - } -} -#[automatically_derived] -impl ::core::fmt::Debug for UsedRefTopicType { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( - f, - match self { - UsedRefTopicType::Send => "Send", - UsedRefTopicType::Recv => "Recv", - }, - ) + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; } } #[automatically_derived] -impl ::core::cmp::Eq for UsedRefTopicType { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} -} -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedRefTopicType {} +impl ::core::marker::StructuralPartialEq for UsedVecElementNested {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedRefTopicType { +impl ::core::cmp::PartialEq for UsedVecElementNested { #[inline] - fn eq(&self, other: &UsedRefTopicType) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr - } -} -pub static __SPEC_XDR_TYPE_USEDREFTOPICTYPE: [u8; 68usize] = UsedRefTopicType::spec_xdr(); -impl UsedRefTopicType { - pub const fn spec_xdr() -> [u8; 68usize] { - *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x10UsedRefTopicType\0\0\0\x02\0\0\0\0\0\0\0\x04Send\0\0\0\x01\0\0\0\0\0\0\0\x04Recv\0\0\0\x02" + fn eq(&self, other: &UsedVecElementNested) -> bool { + self.val == other.val && self.inner == other.inner && self.vec_inner == other.vec_inner } } -impl soroban_sdk::SpecShakingMarker for UsedRefTopicType { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() {} -} -impl soroban_sdk::TryFromVal for UsedRefTopicType { +pub static __SPEC_XDR_TYPE_USEDVECELEMENTNESTED: [u8; 156usize] = UsedVecElementNested::spec_xdr(); +impl UsedVecElementNested { + pub const fn spec_xdr() -> [u8; 156usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x14UsedVecElementNested\0\0\0\x03\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x13UsedVecInnerElement\0\0\0\0\0\0\0\0\x03val\0\0\0\0\x04\0\0\0\0\0\0\0\tvec_inner\0\0\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x16UsedVecInnerVecElement\0\0" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedVecElementNested { + const SPEC_TYPE_ID: [u8; 32] = *b"\x13?J\x12d\xden|\xe9\xd0`\x82\xf0\x19\xd4s\x1e\xa4\x87\xe1\xe6p.-\xa2\x1b\xb1\xae[\xcc`\xcc"; +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDVECELEMENTNESTED: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 2, + *b"\x13?J\x12d\xden|\xe9\xd0`\x82\xf0\x19\xd4s\x1e\xa4\x87\xe1\xe6p.-\xa2\x1b\xb1\xae[\xcc`\xcc", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); +impl soroban_sdk::TryFromVal for UsedVecElementNested { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::TryIntoVal; - let discriminant: u32 = val.try_into_val(env)?; - Ok(match discriminant { - 1u32 => Self::Send, - 2u32 => Self::Recv, - _ => Err(soroban_sdk::ConversionError {})?, + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["inner", "val", "vec_inner"]; + let mut vals: [Val; 3usize] = [Val::VOID.to_val(); 3usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + inner: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + val: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + vec_inner: vals[2] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedRefTopicType, + val: &UsedVecElementNested, ) -> Result { - Ok(match val { - UsedRefTopicType::Send => 1u32.into(), - UsedRefTopicType::Recv => 2u32.into(), - }) + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["inner", "val", "vec_inner"]; + let vals: [Val; 3usize] = [ + (&val.inner) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.val).try_into_val(env).map_err(|_| ConversionError)?, + (&val.vec_inner) + .try_into_val(env) + .map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedRefTopicType, + val: &&UsedVecElementNested, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +impl soroban_sdk::TryFromVal for UsedVecElementNested { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 3usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + inner: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "inner" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + val: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "val" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + vec_inner: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "vec_inner" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) } } -impl soroban_sdk::TryFromVal for UsedRefTopicType { +impl soroban_sdk::TryFromVal for UsedVecElementNested { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::xdr::ScVal, ) -> Result { - if let soroban_sdk::xdr::ScVal::U32(discriminant) = val { - Ok(match *discriminant { - 1u32 => Self::Send, - 2u32 => Self::Recv, - _ => Err(soroban_sdk::xdr::Error::Invalid)?, - }) + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) } else { Err(soroban_sdk::xdr::Error::Invalid) } } } -impl TryInto for &UsedRefTopicType { +impl TryFrom<&UsedVecElementNested> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_into(self) -> Result { - Ok(match self { - UsedRefTopicType::Send => 1u32.into(), - UsedRefTopicType::Recv => 2u32.into(), - }) + fn try_from(val: &UsedVecElementNested) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "inner" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.inner) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "val" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.val) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "vec_inner" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.vec_inner) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) } } -impl TryInto for UsedRefTopicType { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_into(self) -> Result { - Ok(match self { - UsedRefTopicType::Send => 1u32.into(), - UsedRefTopicType::Recv => 2u32.into(), - }) + fn try_from(val: UsedVecElementNested) -> Result { + (&val).try_into() + } +} +impl TryFrom<&UsedVecElementNested> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UsedVecElementNested) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UsedVecElementNested) -> Result { + (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub enum ArbitraryUsedRefTopicType { - Send, - Recv, + pub struct ArbitraryUsedVecElementNested { + val: ::Prototype, + inner: ::Prototype, + vec_inner: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedRefTopicType { + impl ::core::fmt::Debug for ArbitraryUsedVecElementNested { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( + ::core::fmt::Formatter::debug_struct_field3_finish( f, - match self { - ArbitraryUsedRefTopicType::Send => "Send", - ArbitraryUsedRefTopicType::Recv => "Recv", - }, + "ArbitraryUsedVecElementNested", + "val", + &self.val, + "inner", + &self.inner, + "vec_inner", + &&self.vec_inner, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedRefTopicType { + impl ::core::clone::Clone for ArbitraryUsedVecElementNested { #[inline] - fn clone(&self) -> ArbitraryUsedRefTopicType { - match self { - ArbitraryUsedRefTopicType::Send => ArbitraryUsedRefTopicType::Send, - ArbitraryUsedRefTopicType::Recv => ArbitraryUsedRefTopicType::Recv, + fn clone(&self) -> ArbitraryUsedVecElementNested { + ArbitraryUsedVecElementNested { + val: ::core::clone::Clone::clone(&self.val), + inner: ::core::clone::Clone::clone(&self.inner), + vec_inner: ::core::clone::Clone::clone(&self.vec_inner), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedRefTopicType { + impl ::core::cmp::Eq for ArbitraryUsedVecElementNested { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedRefTopicType {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedVecElementNested {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedRefTopicType { + impl ::core::cmp::PartialEq for ArbitraryUsedVecElementNested { #[inline] - fn eq(&self, other: &ArbitraryUsedRefTopicType) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr + fn eq(&self, other: &ArbitraryUsedVecElementNested) -> bool { + self.val == other.val && self.inner == other.inner && self.vec_inner == other.vec_inner } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedRefTopicType { + impl ::core::cmp::Ord for ArbitraryUsedVecElementNested { #[inline] - fn cmp(&self, other: &ArbitraryUsedRefTopicType) -> ::core::cmp::Ordering { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) + fn cmp(&self, other: &ArbitraryUsedVecElementNested) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.val, &other.val) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.inner, &other.inner) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.vec_inner, &other.vec_inner) + } + cmp => cmp, + } + } + cmp => cmp, + } } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedRefTopicType { + impl ::core::cmp::PartialOrd for ArbitraryUsedVecElementNested { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedRefTopicType, + other: &ArbitraryUsedVecElementNested, ) -> ::core::option::Option<::core::cmp::Ordering> { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr) + match ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp(&self.inner, &other.inner) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.vec_inner, &other.vec_inner) + } + cmp => cmp, + } + } + cmp => cmp, + } } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedRefTopicType: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedVecElementNested: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -6952,11 +11350,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedRefTopicType { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedVecElementNested { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefTopicType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecElementNested.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -6965,19 +11363,14 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(u)?) * 2u64) >> 32 - { - 0u64 => ArbitraryUsedRefTopicType::Send, - 1u64 => ArbitraryUsedRefTopicType::Recv, - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryUsedVecElementNested { + val: arbitrary::Arbitrary::arbitrary(u)?, + inner: arbitrary::Arbitrary::arbitrary(u)?, + vec_inner: arbitrary::Arbitrary::arbitrary(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefTopicType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecElementNested.with(|count| { count.set(count.get() - 1); }); } @@ -6988,7 +11381,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefTopicType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecElementNested.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -6997,20 +11390,14 @@ const _: () = { })?; } let result = (|| { - Ok( - match (u64::from(::arbitrary(&mut u)?) * 2u64) - >> 32 - { - 0u64 => ArbitraryUsedRefTopicType::Send, - 1u64 => ArbitraryUsedRefTopicType::Recv, - _ => { - ::core::panicking::panic("internal error: entered unreachable code") - } - }, - ) + Ok(ArbitraryUsedVecElementNested { + val: arbitrary::Arbitrary::arbitrary(&mut u)?, + inner: arbitrary::Arbitrary::arbitrary(&mut u)?, + vec_inner: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefTopicType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedVecElementNested.with(|count| { count.set(count.get() - 1); }); } @@ -7018,136 +11405,145 @@ const _: () = { } #[inline] fn size_hint(depth: usize) -> (usize, Option) { - arbitrary::size_hint::and( - ::size_hint(depth), - arbitrary::size_hint::recursion_guard(depth, |depth| { - arbitrary::size_hint::or_all(&[ - arbitrary::size_hint::and_all(&[]), - arbitrary::size_hint::and_all(&[]), - ]) - }), - ) + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedRefTopicType { - type Prototype = ArbitraryUsedRefTopicType; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedVecElementNested { + type Prototype = ArbitraryUsedVecElementNested; } - impl soroban_sdk::TryFromVal for UsedRefTopicType { + impl soroban_sdk::TryFromVal + for UsedVecElementNested + { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedRefTopicType, + v: &ArbitraryUsedVecElementNested, ) -> std::result::Result { - Ok(match v { - ArbitraryUsedRefTopicType::Send => UsedRefTopicType::Send, - ArbitraryUsedRefTopicType::Recv => UsedRefTopicType::Recv, + Ok(UsedVecElementNested { + val: soroban_sdk::IntoVal::into_val(&v.val, env), + inner: soroban_sdk::IntoVal::into_val(&v.inner, env), + vec_inner: soroban_sdk::IntoVal::into_val(&v.vec_inner, env), }) } } }; -pub struct UsedRefDataType { - pub nested: UsedRefDataInner, +struct UsedNonPubStruct { + pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedRefDataType { +impl ::core::clone::Clone for UsedNonPubStruct { #[inline] - fn clone(&self) -> UsedRefDataType { - UsedRefDataType { - nested: ::core::clone::Clone::clone(&self.nested), + fn clone(&self) -> UsedNonPubStruct { + UsedNonPubStruct { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedRefDataType { +impl ::core::fmt::Debug for UsedNonPubStruct { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( - f, - "UsedRefDataType", - "nested", - &&self.nested, - ) + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedNonPubStruct", "val", &&self.val) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedRefDataType { +impl ::core::cmp::Eq for UsedNonPubStruct { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedRefDataType {} +impl ::core::marker::StructuralPartialEq for UsedNonPubStruct {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedRefDataType { +impl ::core::cmp::PartialEq for UsedNonPubStruct { #[inline] - fn eq(&self, other: &UsedRefDataType) -> bool { - self.nested == other.nested + fn eq(&self, other: &UsedNonPubStruct) -> bool { + self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDREFDATATYPE: [u8; 76usize] = UsedRefDataType::spec_xdr(); -impl UsedRefDataType { - pub const fn spec_xdr() -> [u8; 76usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fUsedRefDataType\0\0\0\0\x01\0\0\0\0\0\0\0\x06nested\0\0\0\0\x07\xd0\0\0\0\x10UsedRefDataInner" +pub static __SPEC_XDR_TYPE_USEDNONPUBSTRUCT: [u8; 52usize] = UsedNonPubStruct::spec_xdr(); +impl UsedNonPubStruct { + pub const fn spec_xdr() -> [u8; 52usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedNonPubStruct\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UsedRefDataType { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedNonPubStruct { + const SPEC_TYPE_ID: [u8; 32] = *b"p\x8c\x0fN!\x082\xd8n\x8c\xea\x0fh\x9c\xb8\xd8\xbe\xddnI\xa0\x91\xcdb3\xd8\x07t\x0c\xcd\xfa\xb0"; } -impl soroban_sdk::TryFromVal for UsedRefDataType { +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDNONPUBSTRUCT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"p\x8c\x0fN!\x082\xd8n\x8c\xea\x0fh\x9c\xb8\xd8\xbe\xddnI\xa0\x91\xcdb3\xd8\x07t\x0c\xcd\xfa\xb0", + [], +); +impl soroban_sdk::TryFromVal for UsedNonPubStruct { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["nested"]; + const KEYS: [&'static str; 1usize] = ["val"]; let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - nested: vals[0] + val: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedRefDataType, - ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["nested"]; - let vals: [Val; 1usize] = [(&val.nested) - .try_into_val(env) - .map_err(|_| ConversionError)?]; + val: &UsedNonPubStruct, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedRefDataType, + val: &&UsedNonPubStruct, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedRefDataType { +impl soroban_sdk::TryFromVal for UsedNonPubStruct { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -7162,9 +11558,9 @@ impl soroban_sdk::TryFromVal for Used } map.validate()?; Ok(Self { - nested: { + val: { let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "nested" + "val" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) @@ -7181,7 +11577,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedRefDataType { +impl soroban_sdk::TryFromVal for UsedNonPubStruct { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -7195,116 +11591,115 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedRefDataType> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedNonPubStruct> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedRefDataType) -> Result { + fn try_from(val: &UsedNonPubStruct) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ soroban_sdk::xdr::ScMapEntry { key: soroban_sdk::xdr::ScSymbol( - "nested" + "val" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) .into(), - val: (&val.nested) + val: (&val.val) .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, }, ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedRefDataType) -> Result { + fn try_from(val: UsedNonPubStruct) -> Result { (&val).try_into() } } -impl TryFrom<&UsedRefDataType> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedNonPubStruct> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedRefDataType) -> Result { + fn try_from(val: &UsedNonPubStruct) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedRefDataType) -> Result { + fn try_from(val: UsedNonPubStruct) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedRefDataType { - nested: - ::Prototype, + struct ArbitraryUsedNonPubStruct { + val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedRefDataType { + impl ::core::fmt::Debug for ArbitraryUsedNonPubStruct { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedRefDataType", - "nested", - &&self.nested, + "ArbitraryUsedNonPubStruct", + "val", + &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedRefDataType { + impl ::core::clone::Clone for ArbitraryUsedNonPubStruct { #[inline] - fn clone(&self) -> ArbitraryUsedRefDataType { - ArbitraryUsedRefDataType { - nested: ::core::clone::Clone::clone(&self.nested), + fn clone(&self) -> ArbitraryUsedNonPubStruct { + ArbitraryUsedNonPubStruct { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedRefDataType { + impl ::core::cmp::Eq for ArbitraryUsedNonPubStruct { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq< - ::Prototype, + ::Prototype, >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedRefDataType {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedNonPubStruct {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedRefDataType { + impl ::core::cmp::PartialEq for ArbitraryUsedNonPubStruct { #[inline] - fn eq(&self, other: &ArbitraryUsedRefDataType) -> bool { - self.nested == other.nested + fn eq(&self, other: &ArbitraryUsedNonPubStruct) -> bool { + self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedRefDataType { + impl ::core::cmp::Ord for ArbitraryUsedNonPubStruct { #[inline] - fn cmp(&self, other: &ArbitraryUsedRefDataType) -> ::core::cmp::Ordering { - ::core::cmp::Ord::cmp(&self.nested, &other.nested) + fn cmp(&self, other: &ArbitraryUsedNonPubStruct) -> ::core::cmp::Ordering { + ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedRefDataType { + impl ::core::cmp::PartialOrd for ArbitraryUsedNonPubStruct { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedRefDataType, + other: &ArbitraryUsedNonPubStruct, ) -> ::core::option::Option<::core::cmp::Ordering> { - ::core::cmp::PartialOrd::partial_cmp(&self.nested, &other.nested) + ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedRefDataType: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedNonPubStruct: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -7338,11 +11733,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedRefDataType { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedNonPubStruct { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefDataType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedNonPubStruct.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -7351,12 +11746,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedRefDataType { - nested: arbitrary::Arbitrary::arbitrary(u)?, + Ok(ArbitraryUsedNonPubStruct { + val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefDataType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedNonPubStruct.with(|count| { count.set(count.get() - 1); }); } @@ -7367,7 +11762,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefDataType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedNonPubStruct.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -7376,12 +11771,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedRefDataType { - nested: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + Ok(ArbitraryUsedNonPubStruct { + val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefDataType.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedNonPubStruct.with(|count| { count.set(count.get() - 1); }); } @@ -7392,7 +11787,7 @@ const _: () = { arbitrary::size_hint::recursion_guard(depth, |depth| { arbitrary::size_hint::and_all( &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( + <::Prototype as arbitrary::Arbitrary>::size_hint( depth, ), ], @@ -7401,72 +11796,243 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedRefDataType { - type Prototype = ArbitraryUsedRefDataType; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedNonPubStruct { + type Prototype = ArbitraryUsedNonPubStruct; } - impl soroban_sdk::TryFromVal for UsedRefDataType { + impl soroban_sdk::TryFromVal for UsedNonPubStruct { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedRefDataType, + v: &ArbitraryUsedNonPubStruct, ) -> std::result::Result { - Ok(UsedRefDataType { - nested: soroban_sdk::IntoVal::into_val(&v.nested, env), + Ok(UsedNonPubStruct { + val: soroban_sdk::IntoVal::into_val(&v.val, env), + }) + } + } +}; +enum UsedNonPubError { + Fail = 1, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedNonPubError {} +#[automatically_derived] +impl ::core::clone::Clone for UsedNonPubError { + #[inline] + fn clone(&self) -> UsedNonPubError { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedNonPubError { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str(f, "Fail") + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedNonPubError { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedNonPubError {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedNonPubError { + #[inline] + fn eq(&self, other: &UsedNonPubError) -> bool { + true + } +} +pub static __SPEC_XDR_TYPE_USEDNONPUBERROR: [u8; 52usize] = UsedNonPubError::spec_xdr(); +impl UsedNonPubError { + pub const fn spec_xdr() -> [u8; 52usize] { + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x0fUsedNonPubError\0\0\0\0\x01\0\0\0\0\0\0\0\x04Fail\0\0\0\x01" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedNonPubError { + const SPEC_TYPE_ID: [u8; 32] = *b"\xa9<\xd8+\xb7\xa7\r\x17\xf1\x12\x1e\x03\xeb9\xb4\xa9'\xfc\x11\xab\x86>\xb5jd\\5\xf1]\xf2\xbb\x14"; +} +impl soroban_sdk::spec_shaking::SpecShakingMarker for UsedNonPubError { + #[doc(hidden)] + #[inline(always)] + fn spec_shaking_marker() {} +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDNONPUBERROR: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\xa9<\xd8+\xb7\xa7\r\x17\xf1\x12\x1e\x03\xeb9\xb4\xa9'\xfc\x11\xab\x86>\xb5jd\\5\xf1]\xf2\xbb\x14", + [], +); +impl TryFrom for UsedNonPubError { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: soroban_sdk::Error) -> Result { + if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { + let discriminant = error.get_code(); + Ok(match discriminant { + 1u32 => Self::Fail, + _ => return Err(error), }) + } else { + Err(error) + } + } +} +impl TryFrom<&soroban_sdk::Error> for UsedNonPubError { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: &soroban_sdk::Error) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::Error { + #[inline(always)] + fn from(val: UsedNonPubError) -> soroban_sdk::Error { + <_ as From<&UsedNonPubError>>::from(&val) + } +} +impl From<&UsedNonPubError> for soroban_sdk::Error { + #[inline(always)] + fn from(val: &UsedNonPubError) -> soroban_sdk::Error { + match val { + UsedNonPubError::Fail => soroban_sdk::Error::from_contract_error(1u32), + } + } +} +impl TryFrom for UsedNonPubError { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: soroban_sdk::InvokeError) -> Result { + match error { + soroban_sdk::InvokeError::Abort => Err(error), + soroban_sdk::InvokeError::Contract(code) => Ok(match code { + 1u32 => Self::Fail, + _ => return Err(error), + }), + } + } +} +impl TryFrom<&soroban_sdk::InvokeError> for UsedNonPubError { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: &soroban_sdk::InvokeError) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: UsedNonPubError) -> soroban_sdk::InvokeError { + <_ as From<&UsedNonPubError>>::from(&val) + } +} +impl From<&UsedNonPubError> for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: &UsedNonPubError) -> soroban_sdk::InvokeError { + match val { + UsedNonPubError::Fail => soroban_sdk::InvokeError::Contract(1u32), } } -}; -pub struct UsedRefDataInner { - pub val: u32, +} +impl soroban_sdk::TryFromVal for UsedNonPubError { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let error: soroban_sdk::Error = val.try_into_val(env)?; + error.try_into().map_err(|_| soroban_sdk::ConversionError) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedNonPubError, + ) -> Result { + let error: soroban_sdk::Error = val.into(); + Ok(error.into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedNonPubError, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +pub struct UsedRecursiveRoot { + pub val: UsedRecursiveNode, } #[automatically_derived] -impl ::core::clone::Clone for UsedRefDataInner { +impl ::core::clone::Clone for UsedRecursiveRoot { #[inline] - fn clone(&self) -> UsedRefDataInner { - UsedRefDataInner { + fn clone(&self) -> UsedRecursiveRoot { + UsedRecursiveRoot { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedRefDataInner { +impl ::core::fmt::Debug for UsedRecursiveRoot { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedRefDataInner", "val", &&self.val) + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedRecursiveRoot", + "val", + &&self.val, + ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedRefDataInner { +impl ::core::cmp::Eq for UsedRecursiveRoot { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedRefDataInner {} +impl ::core::marker::StructuralPartialEq for UsedRecursiveRoot {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedRefDataInner { +impl ::core::cmp::PartialEq for UsedRecursiveRoot { #[inline] - fn eq(&self, other: &UsedRefDataInner) -> bool { + fn eq(&self, other: &UsedRecursiveRoot) -> bool { self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDREFDATAINNER: [u8; 52usize] = UsedRefDataInner::spec_xdr(); -impl UsedRefDataInner { - pub const fn spec_xdr() -> [u8; 52usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedRefDataInner\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDRECURSIVEROOT: [u8; 80usize] = UsedRecursiveRoot::spec_xdr(); +impl UsedRecursiveRoot { + pub const fn spec_xdr() -> [u8; 80usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedRecursiveRoot\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\x07\xd0\0\0\0\x11UsedRecursiveNode\0\0\0" } } -impl soroban_sdk::SpecShakingMarker for UsedRefDataInner { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedRecursiveRoot { + const SPEC_TYPE_ID: [u8; 32] = *b"u2\x0b\x97\xae\xcd\x86\xbf\x0b(\x18\x06\x90x\xae?\xceC\xbe\x7f\xc9\x9c= \xb0\xa5\xd0=j\x91\xfd\xbb"; } -impl soroban_sdk::TryFromVal for UsedRefDataInner { +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDRECURSIVEROOT: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 2, + *b"u2\x0b\x97\xae\xcd\x86\xbf\x0b(\x18\x06\x90x\xae?\xceC\xbe\x7f\xc9\x9c= \xb0\xa5\xd0=j\x91\xfd\xbb", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::TryFromVal for UsedRecursiveRoot { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -7485,11 +12051,11 @@ impl soroban_sdk::TryFromVal for UsedRefData }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedRefDataInner, + val: &UsedRecursiveRoot, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["val"]; @@ -7500,17 +12066,17 @@ impl soroban_sdk::TryFromVal for soroban_sdk .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedRefDataInner, + val: &&UsedRecursiveRoot, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedRefDataInner { +impl soroban_sdk::TryFromVal for UsedRecursiveRoot { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -7544,7 +12110,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedRefDataInner { +impl soroban_sdk::TryFromVal for UsedRecursiveRoot { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -7558,10 +12124,10 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedRefDataInner> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedRecursiveRoot> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedRefDataInner) -> Result { + fn try_from(val: &UsedRecursiveRoot) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ @@ -7579,94 +12145,94 @@ impl TryFrom<&UsedRefDataInner> for soroban_sdk::xdr::ScMap { ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedRefDataInner) -> Result { + fn try_from(val: UsedRecursiveRoot) -> Result { (&val).try_into() } } -impl TryFrom<&UsedRefDataInner> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedRecursiveRoot> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedRefDataInner) -> Result { + fn try_from(val: &UsedRecursiveRoot) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedRefDataInner) -> Result { + fn try_from(val: UsedRecursiveRoot) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedRefDataInner { - val: ::Prototype, + pub struct ArbitraryUsedRecursiveRoot { + val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedRefDataInner { + impl ::core::fmt::Debug for ArbitraryUsedRecursiveRoot { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedRefDataInner", + "ArbitraryUsedRecursiveRoot", "val", &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedRefDataInner { + impl ::core::clone::Clone for ArbitraryUsedRecursiveRoot { #[inline] - fn clone(&self) -> ArbitraryUsedRefDataInner { - ArbitraryUsedRefDataInner { + fn clone(&self) -> ArbitraryUsedRecursiveRoot { + ArbitraryUsedRecursiveRoot { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedRefDataInner { + impl ::core::cmp::Eq for ArbitraryUsedRecursiveRoot { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq< - ::Prototype, + ::Prototype, >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedRefDataInner {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedRecursiveRoot {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedRefDataInner { + impl ::core::cmp::PartialEq for ArbitraryUsedRecursiveRoot { #[inline] - fn eq(&self, other: &ArbitraryUsedRefDataInner) -> bool { + fn eq(&self, other: &ArbitraryUsedRecursiveRoot) -> bool { self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedRefDataInner { + impl ::core::cmp::Ord for ArbitraryUsedRecursiveRoot { #[inline] - fn cmp(&self, other: &ArbitraryUsedRefDataInner) -> ::core::cmp::Ordering { + fn cmp(&self, other: &ArbitraryUsedRecursiveRoot) -> ::core::cmp::Ordering { ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedRefDataInner { + impl ::core::cmp::PartialOrd for ArbitraryUsedRecursiveRoot { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedRefDataInner, + other: &ArbitraryUsedRecursiveRoot, ) -> ::core::option::Option<::core::cmp::Ordering> { ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedRefDataInner: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedRecursiveRoot: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -7700,11 +12266,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedRefDataInner { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedRecursiveRoot { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefDataInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveRoot.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -7713,12 +12279,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedRefDataInner { + Ok(ArbitraryUsedRecursiveRoot { val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefDataInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveRoot.with(|count| { count.set(count.get() - 1); }); } @@ -7729,7 +12295,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefDataInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveRoot.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -7738,12 +12304,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedRefDataInner { + Ok(ArbitraryUsedRecursiveRoot { val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedRefDataInner.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveRoot.with(|count| { count.set(count.get() - 1); }); } @@ -7754,7 +12320,7 @@ const _: () = { arbitrary::size_hint::recursion_guard(depth, |depth| { arbitrary::size_hint::and_all( &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( + <::Prototype as arbitrary::Arbitrary>::size_hint( depth, ), ], @@ -7763,360 +12329,420 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedRefDataInner { - type Prototype = ArbitraryUsedRefDataInner; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedRecursiveRoot { + type Prototype = ArbitraryUsedRecursiveRoot; } - impl soroban_sdk::TryFromVal for UsedRefDataInner { + impl soroban_sdk::TryFromVal for UsedRecursiveRoot { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedRefDataInner, + v: &ArbitraryUsedRecursiveRoot, ) -> std::result::Result { - Ok(UsedRefDataInner { + Ok(UsedRecursiveRoot { val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -pub struct UsedEventWithRefs<'a> { - pub kind: &'a UsedRefTopicType, - pub payload: &'a UsedRefDataType, +pub enum UsedRecursiveNode { + NotRecursive(UsedLeaf), + Recursive(UsedRecursiveLeaf), } #[automatically_derived] -impl<'a> ::core::clone::Clone for UsedEventWithRefs<'a> { +impl ::core::clone::Clone for UsedRecursiveNode { #[inline] - fn clone(&self) -> UsedEventWithRefs<'a> { - UsedEventWithRefs { - kind: ::core::clone::Clone::clone(&self.kind), - payload: ::core::clone::Clone::clone(&self.payload), + fn clone(&self) -> UsedRecursiveNode { + match self { + UsedRecursiveNode::NotRecursive(__self_0) => { + UsedRecursiveNode::NotRecursive(::core::clone::Clone::clone(__self_0)) + } + UsedRecursiveNode::Recursive(__self_0) => { + UsedRecursiveNode::Recursive(::core::clone::Clone::clone(__self_0)) + } } } } #[automatically_derived] -impl<'a> ::core::fmt::Debug for UsedEventWithRefs<'a> { +impl ::core::fmt::Debug for UsedRecursiveNode { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( - f, - "UsedEventWithRefs", - "kind", - &self.kind, - "payload", - &&self.payload, - ) - } -} -#[automatically_derived] -impl<'a> ::core::cmp::Eq for UsedEventWithRefs<'a> { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq<&'a UsedRefTopicType>; - let _: ::core::cmp::AssertParamIsEq<&'a UsedRefDataType>; - } -} -#[automatically_derived] -impl<'a> ::core::marker::StructuralPartialEq for UsedEventWithRefs<'a> {} -#[automatically_derived] -impl<'a> ::core::cmp::PartialEq for UsedEventWithRefs<'a> { - #[inline] - fn eq(&self, other: &UsedEventWithRefs<'a>) -> bool { - self.kind == other.kind && self.payload == other.payload - } -} -pub static __SPEC_XDR_EVENT_USEDEVENTWITHREFS: [u8; 156usize] = UsedEventWithRefs::spec_xdr(); -impl<'a> UsedEventWithRefs<'a> { - pub const fn spec_xdr() -> [u8; 156usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x11UsedEventWithRefs\0\0\0\0\0\0\x01\0\0\0\x14used_event_with_refs\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\x07\xd0\0\0\0\x10UsedRefTopicType\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x0fUsedRefDataType\0\0\0\0\0\0\0\0\x02" - } -} -impl<'a> soroban_sdk::SpecShakingMarker for UsedEventWithRefs<'a> { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - <&'a UsedRefTopicType as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - <&'a UsedRefDataType as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - } -} -impl<'a> soroban_sdk::Event for UsedEventWithRefs<'a> { - fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { - use soroban_sdk::IntoVal; - ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_refs") }, - { - let v: soroban_sdk::Val = self.kind.into_val(env); - v - }, - ) - .into_val(env) - } - fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { - use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["payload"]; - let vals: [soroban_sdk::Val; 1usize] = [self.payload.into_val(env)]; - env.map_new_from_slices(&KEYS, &vals) - .unwrap_infallible() - .into() - } -} -impl<'a> UsedEventWithRefs<'a> { - pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); - <_ as soroban_sdk::Event>::publish(self, env); - } -} -pub struct UsedTupleElement { - pub val: u32, -} -#[automatically_derived] -impl ::core::clone::Clone for UsedTupleElement { - #[inline] - fn clone(&self) -> UsedTupleElement { - UsedTupleElement { - val: ::core::clone::Clone::clone(&self.val), + match self { + UsedRecursiveNode::NotRecursive(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "NotRecursive", &__self_0) + } + UsedRecursiveNode::Recursive(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Recursive", &__self_0) + } } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedTupleElement { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedTupleElement", "val", &&self.val) - } -} -#[automatically_derived] -impl ::core::cmp::Eq for UsedTupleElement { +impl ::core::cmp::Eq for UsedRecursiveNode { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedTupleElement {} +impl ::core::marker::StructuralPartialEq for UsedRecursiveNode {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedTupleElement { +impl ::core::cmp::PartialEq for UsedRecursiveNode { #[inline] - fn eq(&self, other: &UsedTupleElement) -> bool { - self.val == other.val + fn eq(&self, other: &UsedRecursiveNode) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + UsedRecursiveNode::NotRecursive(__self_0), + UsedRecursiveNode::NotRecursive(__arg1_0), + ) => __self_0 == __arg1_0, + ( + UsedRecursiveNode::Recursive(__self_0), + UsedRecursiveNode::Recursive(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } } } -pub static __SPEC_XDR_TYPE_USEDTUPLEELEMENT: [u8; 52usize] = UsedTupleElement::spec_xdr(); -impl UsedTupleElement { - pub const fn spec_xdr() -> [u8; 52usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedTupleElement\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDRECURSIVENODE: [u8; 140usize] = UsedRecursiveNode::spec_xdr(); +impl UsedRecursiveNode { + pub const fn spec_xdr() -> [u8; 140usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x11UsedRecursiveNode\0\0\0\0\0\0\x02\0\0\0\x01\0\0\0\0\0\0\0\x0cNotRecursive\0\0\0\x01\0\0\x07\xd0\0\0\0\x08UsedLeaf\0\0\0\x01\0\0\0\0\0\0\0\tRecursive\0\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x11UsedRecursiveLeaf\0\0\0" } } -impl soroban_sdk::SpecShakingMarker for UsedTupleElement { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedRecursiveNode { + const SPEC_TYPE_ID: [u8; 32] = + *b"*\\\x9c\xf4e\xaa\x1e]V\xdcG\x0f>f\xb3N\xf3\xa9\xf5\t\x86y\xbf\0\x11Q\t\xf3\xc8\xae\xf4E"; } -impl soroban_sdk::TryFromVal for UsedTupleElement { +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDRECURSIVENODE: [u8; 106usize] = + soroban_sdk::spec_shaking::encode_graph_record::<106usize, 2usize>( + 2, + *b"*\\\x9c\xf4e\xaa\x1e]V\xdcG\x0f>f\xb3N\xf3\xa9\xf5\t\x86y\xbf\0\x11Q\t\xf3\xc8\xae\xf4E", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); +impl soroban_sdk::TryFromVal for UsedRecursiveNode { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; - let map: MapObject = val.try_into().map_err(|_| ConversionError)?; - env.map_unpack_to_slice(map, &KEYS, &mut vals) - .map_err(|_| ConversionError)?; - Ok(Self { - val: vals[0] - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?, - }) + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["NotRecursive", "Recursive"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::NotRecursive( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Recursive( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) } -} -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; - fn try_from_val( - env: &soroban_sdk::Env, - val: &UsedTupleElement, - ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; - Ok(env - .map_new_from_slices(&KEYS, &vals) - .map_err(|_| ConversionError)? - .into()) +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedRecursiveNode, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + UsedRecursiveNode::NotRecursive(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"NotRecursive")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + UsedRecursiveNode::Recursive(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Recursive")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedTupleElement, + val: &&UsedRecursiveNode, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedTupleElement { +impl soroban_sdk::TryFromVal for UsedRecursiveNode { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &soroban_sdk::xdr::ScMap, + val: &soroban_sdk::xdr::ScVec, ) -> Result { use soroban_sdk::xdr::Validate; use soroban_sdk::TryIntoVal; - let map = val; - if map.len() != 1usize { - return Err(soroban_sdk::xdr::Error::Invalid); - } - map.validate()?; - Ok(Self { - val: { - let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( - "val" - .try_into() + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "NotRecursive" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::NotRecursive( + rv0.try_into_val(env) .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, ) - .into(); - let idx = map - .binary_search_by_key(&key, |entry| entry.key.clone()) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; - let rv: soroban_sdk::Val = (&map[idx].val.clone()) + } + "Recursive" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? .try_into_val(env) .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; - rv.try_into_val(env) - .map_err(|_| soroban_sdk::xdr::Error::Invalid)? - }, + Self::Recursive( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, }) } } -impl soroban_sdk::TryFromVal for UsedTupleElement { +impl soroban_sdk::TryFromVal for UsedRecursiveNode { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::xdr::ScVal, ) -> Result { - if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { - <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) } else { Err(soroban_sdk::xdr::Error::Invalid) } } } -impl TryFrom<&UsedTupleElement> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedRecursiveNode> for soroban_sdk::xdr::ScVec { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedTupleElement) -> Result { + fn try_from(val: &UsedRecursiveNode) -> Result { extern crate alloc; - use soroban_sdk::TryFromVal; - soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ - soroban_sdk::xdr::ScMapEntry { - key: soroban_sdk::xdr::ScSymbol( - "val" + Ok(match val { + UsedRecursiveNode::NotRecursive(value0) => ( + soroban_sdk::xdr::ScSymbol( + "NotRecursive" .try_into() .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - ) - .into(), - val: (&val.val) - .try_into() - .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, - }, - ]))) + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + UsedRecursiveNode::Recursive(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Recursive" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScVec { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedTupleElement) -> Result { + fn try_from(val: UsedRecursiveNode) -> Result { (&val).try_into() } } -impl TryFrom<&UsedTupleElement> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedRecursiveNode> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedTupleElement) -> Result { - Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + fn try_from(val: &UsedRecursiveNode) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedTupleElement) -> Result { + fn try_from(val: UsedRecursiveNode) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedTupleElement { - val: ::Prototype, + pub enum ArbitraryUsedRecursiveNode { + NotRecursive(::Prototype), + Recursive( + ::Prototype, + ), } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedTupleElement { + impl ::core::fmt::Debug for ArbitraryUsedRecursiveNode { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( - f, - "ArbitraryUsedTupleElement", - "val", - &&self.val, - ) + match self { + ArbitraryUsedRecursiveNode::NotRecursive(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "NotRecursive", &__self_0) + } + ArbitraryUsedRecursiveNode::Recursive(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Recursive", &__self_0) + } + } } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedTupleElement { + impl ::core::clone::Clone for ArbitraryUsedRecursiveNode { #[inline] - fn clone(&self) -> ArbitraryUsedTupleElement { - ArbitraryUsedTupleElement { - val: ::core::clone::Clone::clone(&self.val), + fn clone(&self) -> ArbitraryUsedRecursiveNode { + match self { + ArbitraryUsedRecursiveNode::NotRecursive(__self_0) => { + ArbitraryUsedRecursiveNode::NotRecursive(::core::clone::Clone::clone(__self_0)) + } + ArbitraryUsedRecursiveNode::Recursive(__self_0) => { + ArbitraryUsedRecursiveNode::Recursive(::core::clone::Clone::clone(__self_0)) + } } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedTupleElement { + impl ::core::cmp::Eq for ArbitraryUsedRecursiveNode { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq< - ::Prototype, + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedTupleElement {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedRecursiveNode {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedTupleElement { + impl ::core::cmp::PartialEq for ArbitraryUsedRecursiveNode { #[inline] - fn eq(&self, other: &ArbitraryUsedTupleElement) -> bool { - self.val == other.val + fn eq(&self, other: &ArbitraryUsedRecursiveNode) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + ArbitraryUsedRecursiveNode::NotRecursive(__self_0), + ArbitraryUsedRecursiveNode::NotRecursive(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryUsedRecursiveNode::Recursive(__self_0), + ArbitraryUsedRecursiveNode::Recursive(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedTupleElement { + impl ::core::cmp::Ord for ArbitraryUsedRecursiveNode { #[inline] - fn cmp(&self, other: &ArbitraryUsedTupleElement) -> ::core::cmp::Ordering { - ::core::cmp::Ord::cmp(&self.val, &other.val) + fn cmp(&self, other: &ArbitraryUsedRecursiveNode) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + ArbitraryUsedRecursiveNode::NotRecursive(__self_0), + ArbitraryUsedRecursiveNode::NotRecursive(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryUsedRecursiveNode::Recursive(__self_0), + ArbitraryUsedRecursiveNode::Recursive(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedTupleElement { + impl ::core::cmp::PartialOrd for ArbitraryUsedRecursiveNode { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedTupleElement, + other: &ArbitraryUsedRecursiveNode, ) -> ::core::option::Option<::core::cmp::Ordering> { - ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + ArbitraryUsedRecursiveNode::NotRecursive(__self_0), + ArbitraryUsedRecursiveNode::NotRecursive(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + ArbitraryUsedRecursiveNode::Recursive(__self_0), + ArbitraryUsedRecursiveNode::Recursive(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedTupleElement: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedRecursiveNode: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -8150,11 +12776,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedTupleElement { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedRecursiveNode { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedTupleElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveNode.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -8163,12 +12789,23 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedTupleElement { - val: arbitrary::Arbitrary::arbitrary(u)?, - }) + Ok( + match (u64::from(::arbitrary(u)?) * 2u64) >> 32 + { + 0u64 => ArbitraryUsedRecursiveNode::NotRecursive( + arbitrary::Arbitrary::arbitrary(u)?, + ), + 1u64 => ArbitraryUsedRecursiveNode::Recursive( + arbitrary::Arbitrary::arbitrary(u)?, + ), + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedTupleElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveNode.with(|count| { count.set(count.get() - 1); }); } @@ -8179,7 +12816,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedTupleElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveNode.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -8188,12 +12825,24 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedTupleElement { - val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, - }) + Ok( + match (u64::from(::arbitrary(&mut u)?) * 2u64) + >> 32 + { + 0u64 => ArbitraryUsedRecursiveNode::NotRecursive( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 1u64 => ArbitraryUsedRecursiveNode::Recursive( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedTupleElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveNode.with(|count| { count.set(count.get() - 1); }); } @@ -8201,90 +12850,113 @@ const _: () = { } #[inline] fn size_hint(depth: usize) -> (usize, Option) { - arbitrary::size_hint::recursion_guard(depth, |depth| { - arbitrary::size_hint::and_all( - &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( - depth, - ), - ], - ) - }) + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + ], + ) + }), + ) } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedTupleElement { - type Prototype = ArbitraryUsedTupleElement; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedRecursiveNode { + type Prototype = ArbitraryUsedRecursiveNode; } - impl soroban_sdk::TryFromVal for UsedTupleElement { + impl soroban_sdk::TryFromVal for UsedRecursiveNode { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedTupleElement, + v: &ArbitraryUsedRecursiveNode, ) -> std::result::Result { - Ok(UsedTupleElement { - val: soroban_sdk::IntoVal::into_val(&v.val, env), + Ok(match v { + ArbitraryUsedRecursiveNode::NotRecursive(field_0) => { + UsedRecursiveNode::NotRecursive(soroban_sdk::IntoVal::into_val(field_0, env)) + } + ArbitraryUsedRecursiveNode::Recursive(field_0) => { + UsedRecursiveNode::Recursive(soroban_sdk::IntoVal::into_val(field_0, env)) + } }) } } -}; -pub struct UsedTupleReturnElement { - pub val: u32, +}; +pub struct UsedRecursiveLeaf { + pub val: Vec, } #[automatically_derived] -impl ::core::clone::Clone for UsedTupleReturnElement { +impl ::core::clone::Clone for UsedRecursiveLeaf { #[inline] - fn clone(&self) -> UsedTupleReturnElement { - UsedTupleReturnElement { + fn clone(&self) -> UsedRecursiveLeaf { + UsedRecursiveLeaf { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedTupleReturnElement { +impl ::core::fmt::Debug for UsedRecursiveLeaf { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedTupleReturnElement", + "UsedRecursiveLeaf", "val", &&self.val, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedTupleReturnElement { +impl ::core::cmp::Eq for UsedRecursiveLeaf { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedTupleReturnElement {} +impl ::core::marker::StructuralPartialEq for UsedRecursiveLeaf {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedTupleReturnElement { +impl ::core::cmp::PartialEq for UsedRecursiveLeaf { #[inline] - fn eq(&self, other: &UsedTupleReturnElement) -> bool { + fn eq(&self, other: &UsedRecursiveLeaf) -> bool { self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDTUPLERETURNELEMENT: [u8; 60usize] = - UsedTupleReturnElement::spec_xdr(); -impl UsedTupleReturnElement { - pub const fn spec_xdr() -> [u8; 60usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x16UsedTupleReturnElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" - } -} -impl soroban_sdk::SpecShakingMarker for UsedTupleReturnElement { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } -} -impl soroban_sdk::TryFromVal for UsedTupleReturnElement { +pub static __SPEC_XDR_TYPE_USEDRECURSIVELEAF: [u8; 84usize] = UsedRecursiveLeaf::spec_xdr(); +impl UsedRecursiveLeaf { + pub const fn spec_xdr() -> [u8; 84usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedRecursiveLeaf\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x11UsedRecursiveRoot\0\0\0" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedRecursiveLeaf { + const SPEC_TYPE_ID: [u8; 32] = *b"?\xd9\xb3q\xdep>\xf3\xab\xb06G\x9d\xb5\x9cd\x9c\x97\xa5T\xcc\xa1\x98*\x83\xe90\xdd\xdb#\x186"; +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDRECURSIVELEAF: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 2, + *b"?\xd9\xb3q\xdep>\xf3\xab\xb06G\x9d\xb5\x9cd\x9c\x97\xa5T\xcc\xa1\x98*\x83\xe90\xdd\xdb#\x186", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::TryFromVal for UsedRecursiveLeaf { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -8303,11 +12975,11 @@ impl soroban_sdk::TryFromVal for UsedTupleRe }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedTupleReturnElement, + val: &UsedRecursiveLeaf, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["val"]; @@ -8318,19 +12990,17 @@ impl soroban_sdk::TryFromVal for sorob .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedTupleReturnElement, + val: &&UsedRecursiveLeaf, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedTupleReturnElement { +impl soroban_sdk::TryFromVal for UsedRecursiveLeaf { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -8364,7 +13034,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedTupleReturnElement { +impl soroban_sdk::TryFromVal for UsedRecursiveLeaf { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -8378,10 +13048,10 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedTupleReturnElement> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedRecursiveLeaf> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedTupleReturnElement) -> Result { + fn try_from(val: &UsedRecursiveLeaf) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ @@ -8399,94 +13069,98 @@ impl TryFrom<&UsedTupleReturnElement> for soroban_sdk::xdr::ScMap { ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedTupleReturnElement) -> Result { + fn try_from(val: UsedRecursiveLeaf) -> Result { (&val).try_into() } } -impl TryFrom<&UsedTupleReturnElement> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedRecursiveLeaf> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedTupleReturnElement) -> Result { + fn try_from(val: &UsedRecursiveLeaf) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedTupleReturnElement) -> Result { + fn try_from(val: UsedRecursiveLeaf) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - pub struct ArbitraryUsedTupleReturnElement { - val: ::Prototype, + pub struct ArbitraryUsedRecursiveLeaf { + val: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedTupleReturnElement { + impl ::core::fmt::Debug for ArbitraryUsedRecursiveLeaf { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedTupleReturnElement", + "ArbitraryUsedRecursiveLeaf", "val", &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedTupleReturnElement { + impl ::core::clone::Clone for ArbitraryUsedRecursiveLeaf { #[inline] - fn clone(&self) -> ArbitraryUsedTupleReturnElement { - ArbitraryUsedTupleReturnElement { + fn clone(&self) -> ArbitraryUsedRecursiveLeaf { + ArbitraryUsedRecursiveLeaf { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedTupleReturnElement { + impl ::core::cmp::Eq for ArbitraryUsedRecursiveLeaf { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq< - ::Prototype, + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, >; } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedTupleReturnElement {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedRecursiveLeaf {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedTupleReturnElement { + impl ::core::cmp::PartialEq for ArbitraryUsedRecursiveLeaf { #[inline] - fn eq(&self, other: &ArbitraryUsedTupleReturnElement) -> bool { + fn eq(&self, other: &ArbitraryUsedRecursiveLeaf) -> bool { self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedTupleReturnElement { + impl ::core::cmp::Ord for ArbitraryUsedRecursiveLeaf { #[inline] - fn cmp(&self, other: &ArbitraryUsedTupleReturnElement) -> ::core::cmp::Ordering { + fn cmp(&self, other: &ArbitraryUsedRecursiveLeaf) -> ::core::cmp::Ordering { ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedTupleReturnElement { + impl ::core::cmp::PartialOrd for ArbitraryUsedRecursiveLeaf { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedTupleReturnElement, + other: &ArbitraryUsedRecursiveLeaf, ) -> ::core::option::Option<::core::cmp::Ordering> { ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement: ::std::thread::LocalKey< + const RECURSIVE_COUNT_ArbitraryUsedRecursiveLeaf: ::std::thread::LocalKey< std::cell::Cell, > = { #[inline] @@ -8520,11 +13194,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedTupleReturnElement { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedRecursiveLeaf { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveLeaf.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -8533,12 +13207,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedTupleReturnElement { + Ok(ArbitraryUsedRecursiveLeaf { val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveLeaf.with(|count| { count.set(count.get() - 1); }); } @@ -8549,7 +13223,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveLeaf.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -8558,12 +13232,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedTupleReturnElement { + Ok(ArbitraryUsedRecursiveLeaf { val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedTupleReturnElement.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedRecursiveLeaf.with(|count| { count.set(count.get() - 1); }); } @@ -8574,7 +13248,9 @@ const _: () = { arbitrary::size_hint::recursion_guard(depth, |depth| { arbitrary::size_hint::and_all( &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( depth, ), ], @@ -8583,44 +13259,42 @@ const _: () = { } } }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedTupleReturnElement { - type Prototype = ArbitraryUsedTupleReturnElement; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedRecursiveLeaf { + type Prototype = ArbitraryUsedRecursiveLeaf; } - impl soroban_sdk::TryFromVal - for UsedTupleReturnElement - { + impl soroban_sdk::TryFromVal for UsedRecursiveLeaf { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - v: &ArbitraryUsedTupleReturnElement, + v: &ArbitraryUsedRecursiveLeaf, ) -> std::result::Result { - Ok(UsedTupleReturnElement { + Ok(UsedRecursiveLeaf { val: soroban_sdk::IntoVal::into_val(&v.val, env), }) } } }; -struct UsedNonPubStruct { +pub struct UsedLeaf { pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedNonPubStruct { +impl ::core::clone::Clone for UsedLeaf { #[inline] - fn clone(&self) -> UsedNonPubStruct { - UsedNonPubStruct { + fn clone(&self) -> UsedLeaf { + UsedLeaf { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedNonPubStruct { +impl ::core::fmt::Debug for UsedLeaf { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedNonPubStruct", "val", &&self.val) + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedLeaf", "val", &&self.val) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedNonPubStruct { +impl ::core::cmp::Eq for UsedLeaf { #[inline] #[doc(hidden)] #[coverage(off)] @@ -8629,28 +13303,33 @@ impl ::core::cmp::Eq for UsedNonPubStruct { } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedNonPubStruct {} +impl ::core::marker::StructuralPartialEq for UsedLeaf {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedNonPubStruct { +impl ::core::cmp::PartialEq for UsedLeaf { #[inline] - fn eq(&self, other: &UsedNonPubStruct) -> bool { + fn eq(&self, other: &UsedLeaf) -> bool { self.val == other.val } } -pub static __SPEC_XDR_TYPE_USEDNONPUBSTRUCT: [u8; 52usize] = UsedNonPubStruct::spec_xdr(); -impl UsedNonPubStruct { - pub const fn spec_xdr() -> [u8; 52usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedNonPubStruct\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDLEAF: [u8; 44usize] = UsedLeaf::spec_xdr(); +impl UsedLeaf { + pub const fn spec_xdr() -> [u8; 44usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x08UsedLeaf\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UsedNonPubStruct { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedLeaf { + const SPEC_TYPE_ID: [u8; 32] = *b"\xe6Q\xd5T\x13\x8a\xb7l\xa1E\xc4q\x84\x01\xf9Y\xe49\x83 for UsedNonPubStruct { +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDLEAF: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\xe6Q\xd5T\x13\x8a\xb7l\xa1E\xc4q\x84\x01\xf9Y\xe49\x83 for UsedLeaf { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -8669,11 +13348,11 @@ impl soroban_sdk::TryFromVal for UsedNonPubS }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedNonPubStruct, + val: &UsedLeaf, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["val"]; @@ -8684,17 +13363,17 @@ impl soroban_sdk::TryFromVal for soroban_sdk .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedNonPubStruct, + val: &&UsedLeaf, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl soroban_sdk::TryFromVal for UsedNonPubStruct { +impl soroban_sdk::TryFromVal for UsedLeaf { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -8728,7 +13407,7 @@ impl soroban_sdk::TryFromVal for Used }) } } -impl soroban_sdk::TryFromVal for UsedNonPubStruct { +impl soroban_sdk::TryFromVal for UsedLeaf { type Error = soroban_sdk::xdr::Error; #[inline(always)] fn try_from_val( @@ -8742,10 +13421,10 @@ impl soroban_sdk::TryFromVal for Used } } } -impl TryFrom<&UsedNonPubStruct> for soroban_sdk::xdr::ScMap { +impl TryFrom<&UsedLeaf> for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedNonPubStruct) -> Result { + fn try_from(val: &UsedLeaf) -> Result { extern crate alloc; use soroban_sdk::TryFromVal; soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ @@ -8763,56 +13442,56 @@ impl TryFrom<&UsedNonPubStruct> for soroban_sdk::xdr::ScMap { ]))) } } -impl TryFrom for soroban_sdk::xdr::ScMap { +impl TryFrom for soroban_sdk::xdr::ScMap { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedNonPubStruct) -> Result { + fn try_from(val: UsedLeaf) -> Result { (&val).try_into() } } -impl TryFrom<&UsedNonPubStruct> for soroban_sdk::xdr::ScVal { +impl TryFrom<&UsedLeaf> for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: &UsedNonPubStruct) -> Result { + fn try_from(val: &UsedLeaf) -> Result { Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) } } -impl TryFrom for soroban_sdk::xdr::ScVal { +impl TryFrom for soroban_sdk::xdr::ScVal { type Error = soroban_sdk::xdr::Error; #[inline(always)] - fn try_from(val: UsedNonPubStruct) -> Result { + fn try_from(val: UsedLeaf) -> Result { (&val).try_into() } } const _: () = { use soroban_sdk::testutils::arbitrary::arbitrary; use soroban_sdk::testutils::arbitrary::std; - struct ArbitraryUsedNonPubStruct { + pub struct ArbitraryUsedLeaf { val: ::Prototype, } #[automatically_derived] - impl ::core::fmt::Debug for ArbitraryUsedNonPubStruct { + impl ::core::fmt::Debug for ArbitraryUsedLeaf { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "ArbitraryUsedNonPubStruct", + "ArbitraryUsedLeaf", "val", &&self.val, ) } } #[automatically_derived] - impl ::core::clone::Clone for ArbitraryUsedNonPubStruct { + impl ::core::clone::Clone for ArbitraryUsedLeaf { #[inline] - fn clone(&self) -> ArbitraryUsedNonPubStruct { - ArbitraryUsedNonPubStruct { + fn clone(&self) -> ArbitraryUsedLeaf { + ArbitraryUsedLeaf { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] - impl ::core::cmp::Eq for ArbitraryUsedNonPubStruct { + impl ::core::cmp::Eq for ArbitraryUsedLeaf { #[inline] #[doc(hidden)] #[coverage(off)] @@ -8823,36 +13502,34 @@ const _: () = { } } #[automatically_derived] - impl ::core::marker::StructuralPartialEq for ArbitraryUsedNonPubStruct {} + impl ::core::marker::StructuralPartialEq for ArbitraryUsedLeaf {} #[automatically_derived] - impl ::core::cmp::PartialEq for ArbitraryUsedNonPubStruct { + impl ::core::cmp::PartialEq for ArbitraryUsedLeaf { #[inline] - fn eq(&self, other: &ArbitraryUsedNonPubStruct) -> bool { + fn eq(&self, other: &ArbitraryUsedLeaf) -> bool { self.val == other.val } } #[automatically_derived] - impl ::core::cmp::Ord for ArbitraryUsedNonPubStruct { + impl ::core::cmp::Ord for ArbitraryUsedLeaf { #[inline] - fn cmp(&self, other: &ArbitraryUsedNonPubStruct) -> ::core::cmp::Ordering { + fn cmp(&self, other: &ArbitraryUsedLeaf) -> ::core::cmp::Ordering { ::core::cmp::Ord::cmp(&self.val, &other.val) } } #[automatically_derived] - impl ::core::cmp::PartialOrd for ArbitraryUsedNonPubStruct { + impl ::core::cmp::PartialOrd for ArbitraryUsedLeaf { #[inline] fn partial_cmp( &self, - other: &ArbitraryUsedNonPubStruct, + other: &ArbitraryUsedLeaf, ) -> ::core::option::Option<::core::cmp::Ordering> { ::core::cmp::PartialOrd::partial_cmp(&self.val, &other.val) } } const _: () = { #[allow(non_upper_case_globals)] - const RECURSIVE_COUNT_ArbitraryUsedNonPubStruct: ::std::thread::LocalKey< - std::cell::Cell, - > = { + const RECURSIVE_COUNT_ArbitraryUsedLeaf: ::std::thread::LocalKey> = { #[inline] fn __init() -> std::cell::Cell { std::cell::Cell::new(0) @@ -8884,11 +13561,11 @@ const _: () = { } }; #[automatically_derived] - impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedNonPubStruct { + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUsedLeaf { fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedNonPubStruct.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedLeaf.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -8897,12 +13574,12 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedNonPubStruct { + Ok(ArbitraryUsedLeaf { val: arbitrary::Arbitrary::arbitrary(u)?, }) })(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedNonPubStruct.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedLeaf.with(|count| { count.set(count.get() - 1); }); } @@ -8913,7 +13590,7 @@ const _: () = { ) -> arbitrary::Result { let guard_against_recursion = u.is_empty(); if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedNonPubStruct.with(|count| { + RECURSIVE_COUNT_ArbitraryUsedLeaf.with(|count| { if count.get() > 0 { return Err(arbitrary::Error::NotEnoughData); } @@ -8922,195 +13599,46 @@ const _: () = { })?; } let result = (|| { - Ok(ArbitraryUsedNonPubStruct { + Ok(ArbitraryUsedLeaf { val: arbitrary::Arbitrary::arbitrary_take_rest(u)?, }) })(); - if guard_against_recursion { - RECURSIVE_COUNT_ArbitraryUsedNonPubStruct.with(|count| { - count.set(count.get() - 1); - }); - } - result - } - #[inline] - fn size_hint(depth: usize) -> (usize, Option) { - arbitrary::size_hint::recursion_guard(depth, |depth| { - arbitrary::size_hint::and_all( - &[ - <::Prototype as arbitrary::Arbitrary>::size_hint( - depth, - ), - ], - ) - }) - } - } - }; - impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedNonPubStruct { - type Prototype = ArbitraryUsedNonPubStruct; - } - impl soroban_sdk::TryFromVal for UsedNonPubStruct { - type Error = soroban_sdk::ConversionError; - fn try_from_val( - env: &soroban_sdk::Env, - v: &ArbitraryUsedNonPubStruct, - ) -> std::result::Result { - Ok(UsedNonPubStruct { - val: soroban_sdk::IntoVal::into_val(&v.val, env), - }) - } - } -}; -enum UsedNonPubError { - Fail = 1, -} -#[automatically_derived] -impl ::core::marker::Copy for UsedNonPubError {} -#[automatically_derived] -impl ::core::clone::Clone for UsedNonPubError { - #[inline] - fn clone(&self) -> UsedNonPubError { - *self - } -} -#[automatically_derived] -impl ::core::fmt::Debug for UsedNonPubError { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str(f, "Fail") - } -} -#[automatically_derived] -impl ::core::cmp::Eq for UsedNonPubError { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} -} -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedNonPubError {} -#[automatically_derived] -impl ::core::cmp::PartialEq for UsedNonPubError { - #[inline] - fn eq(&self, other: &UsedNonPubError) -> bool { - true - } -} -pub static __SPEC_XDR_TYPE_USEDNONPUBERROR: [u8; 52usize] = UsedNonPubError::spec_xdr(); -impl UsedNonPubError { - pub const fn spec_xdr() -> [u8; 52usize] { - *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x0fUsedNonPubError\0\0\0\0\x01\0\0\0\0\0\0\0\x04Fail\0\0\0\x01" - } -} -impl soroban_sdk::SpecShakingMarker for UsedNonPubError { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() {} -} -impl TryFrom for UsedNonPubError { - type Error = soroban_sdk::Error; - #[inline(always)] - fn try_from(error: soroban_sdk::Error) -> Result { - if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { - let discriminant = error.get_code(); - Ok(match discriminant { - 1u32 => Self::Fail, - _ => return Err(error), - }) - } else { - Err(error) - } - } -} -impl TryFrom<&soroban_sdk::Error> for UsedNonPubError { - type Error = soroban_sdk::Error; - #[inline(always)] - fn try_from(error: &soroban_sdk::Error) -> Result { - <_ as TryFrom>::try_from(*error) - } -} -impl From for soroban_sdk::Error { - #[inline(always)] - fn from(val: UsedNonPubError) -> soroban_sdk::Error { - <_ as From<&UsedNonPubError>>::from(&val) - } -} -impl From<&UsedNonPubError> for soroban_sdk::Error { - #[inline(always)] - fn from(val: &UsedNonPubError) -> soroban_sdk::Error { - match val { - UsedNonPubError::Fail => soroban_sdk::Error::from_contract_error(1u32), - } - } -} -impl TryFrom for UsedNonPubError { - type Error = soroban_sdk::InvokeError; - #[inline(always)] - fn try_from(error: soroban_sdk::InvokeError) -> Result { - match error { - soroban_sdk::InvokeError::Abort => Err(error), - soroban_sdk::InvokeError::Contract(code) => Ok(match code { - 1u32 => Self::Fail, - _ => return Err(error), - }), + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUsedLeaf.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UsedLeaf { + type Prototype = ArbitraryUsedLeaf; } -} -impl TryFrom<&soroban_sdk::InvokeError> for UsedNonPubError { - type Error = soroban_sdk::InvokeError; - #[inline(always)] - fn try_from(error: &soroban_sdk::InvokeError) -> Result { - <_ as TryFrom>::try_from(*error) - } -} -impl From for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: UsedNonPubError) -> soroban_sdk::InvokeError { - <_ as From<&UsedNonPubError>>::from(&val) - } -} -impl From<&UsedNonPubError> for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: &UsedNonPubError) -> soroban_sdk::InvokeError { - match val { - UsedNonPubError::Fail => soroban_sdk::InvokeError::Contract(1u32), + impl soroban_sdk::TryFromVal for UsedLeaf { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUsedLeaf, + ) -> std::result::Result { + Ok(UsedLeaf { + val: soroban_sdk::IntoVal::into_val(&v.val, env), + }) } } -} -impl soroban_sdk::TryFromVal for UsedNonPubError { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &soroban_sdk::Val, - ) -> Result { - use soroban_sdk::TryIntoVal; - let error: soroban_sdk::Error = val.try_into_val(env)?; - error.try_into().map_err(|_| soroban_sdk::ConversionError) - } -} -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &UsedNonPubError, - ) -> Result { - let error: soroban_sdk::Error = val.into(); - Ok(error.into()) - } -} -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &&UsedNonPubError, - ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) - } -} +}; mod wasm_imported { pub const WASM: &[u8] = b"\x00asm\x01\x00\x00\x00\x01*\x07`\x02~~\x01~`\x03~~~\x01~`\x01~\x01~`\x00\x01~`\x02\x7f\x7f\x01~`\x04\x7f\x7f\x7f\x7f\x01~`\x02\x7f~\x00\x02%\x06\x01b\x01j\x00\x00\x01x\x011\x00\x00\x01v\x01g\x00\x00\x01m\x019\x00\x01\x01i\x012\x00\x02\x01i\x011\x00\x02\x03\x0b\n\x03\x04\x03\x02\x00\x05\x00\x00\x06\x06\x05\x03\x01\x00\x11\x06!\x04\x7f\x01A\x80\x80\xc0\x00\x0b\x7f\x00A\x82\x80\xc0\x00\x0b\x7f\x00A\xa0\x80\xc0\x00\x0b\x7f\x00A\xa0\x80\xc0\x00\x0b\x07\x81\x01\n\x06memory\x02\x00\tfn_enum_a\x00\x06\rfn_enum_int_a\x00\x08\nfn_error_a\x00\t\nfn_event_a\x00\n\x0bfn_struct_a\x00\x0c\x11fn_struct_tuple_a\x00\r\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n\xbd\x08\n\x8b\x02\x03\x01\x7f\x01~\x03\x7f#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00B\x00!\x01A~!\x02\x03~\x02@\x02@\x02@\x02@\x02@ \x02E\r\x00A\x01!\x03 \x02A\x82\x80\xc0\x80\x00j-\x00\x00\"\x04A\xdf\x00F\r\x04 \x04APjA\xff\x01qA\nI\r\x02 \x04A\xbf\x7fjA\xff\x01qA\x1aI\r\x03\x02@ \x04A\x9f\x7fjA\xff\x01qA\x1aO\r\x00 \x04AEj!\x03\x0c\x05\x0b \x00 \x04\xadB\x08\x86B\x01\x847\x03\x00A\x80\x80\xc0\x80\x00\xadB \x86B\x04\x84B\x84\x80\x80\x80 \x10\x80\x80\x80\x80\x00!\x01\x0c\x01\x0b \x00 \x01B\x08\x86B\x0e\x84\"\x017\x02\x04\x0b \x00 \x017\x03\x00 \x00A\x01\x10\x87\x80\x80\x80\x00!\x01 \x00A\x10j$\x80\x80\x80\x80\x00 \x01\x0f\x0b \x04ARj!\x03\x0c\x01\x0b \x04AKj!\x03\x0b \x01B\x06\x86 \x03\xadB\xff\x01\x83\x84!\x01 \x02A\x01j!\x02\x0c\x00\x0b\x0b\x1a\x00 \x00\xadB \x86B\x04\x84 \x01\xadB \x86B\x04\x84\x10\x82\x80\x80\x80\x00\x0b\x08\x00B\x84\x80\x80\x800\x0b*\x00\x02@ \x00B\xff\x01\x83B\x04Q\r\x00\x00\x0bB\x83\x80\x80\x80 \x00B\x84\x80\x80\x80p\x83 \x00B\x80\x80\x80\x80\x10T\x1b\x0b\xdc\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A k\"\x02$\x80\x80\x80\x80\x00\x02@ \x00B\xff\x01\x83B\xcd\x00R\r\x00 \x01B\xff\x01\x83B\xc9\x00R\r\x00 \x02 \x007\x03\x08 \x02B\x8e\xcc\xc1\xfc\xac\xdd\xab\x017\x03\x00A\x00!\x03\x03@\x02@ \x03A\x10G\r\x00A\x00!\x03\x02@\x03@ \x03A\x10F\r\x01 \x02A\x10j \x03j \x02 \x03j)\x03\x007\x03\x00 \x03A\x08j!\x03\x0c\x00\x0b\x0b \x02A\x10jA\x02\x10\x87\x80\x80\x80\x00!\x00 \x02 \x017\x03\x10 \x00A\x98\x80\xc0\x80\x00A\x01 \x02A\x10jA\x01\x10\x8b\x80\x80\x80\x00\x10\x81\x80\x80\x80\x00\x1a \x02A j$\x80\x80\x80\x80\x00B\x02\x0f\x0b \x02A\x10j \x03jB\x027\x03\x00 \x03A\x08j!\x03\x0c\x00\x0b\x0b\x00\x0b.\x00\x02@ \x01 \x03F\r\x00\x00\x0b \x00\xadB \x86B\x04\x84 \x02\xadB \x86B\x04\x84 \x01\xadB \x86B\x04\x84\x10\x83\x80\x80\x80\x00\x0by\x01\x02\x7f#\x80\x80\x80\x80\x00A\x10k\"\x02$\x80\x80\x80\x80\x00\x02@ \x00B\xff\x01\x83B\x04R\r\x00A\x01A\x02A\x00 \x01\xa7A\xff\x01q\"\x03\x1b \x03A\x01F\x1b\"\x03A\x02F\r\x00 \x02 \x03\xad7\x03\x08 \x02 \x00B\x84\x80\x80\x80p\x837\x03\x00A\x88\x80\xc0\x80\x00A\x02 \x02A\x02\x10\x8b\x80\x80\x80\x00!\x00 \x02A\x10j$\x80\x80\x80\x80\x00 \x00\x0f\x0b\x00\x0b\xb2\x01\x01\x01\x7f#\x80\x80\x80\x80\x00A k\"\x02$\x80\x80\x80\x80\x00 \x02A\x10j \x00\x10\x8e\x80\x80\x80\x00\x02@ \x02(\x02\x10A\x01F\r\x00 \x02)\x03\x18!\x00 \x02A\x10j \x01\x10\x8e\x80\x80\x80\x00 \x02(\x02\x10A\x01F\r\x00 \x02)\x03\x18!\x01 \x02A\x10j \x00\x10\x8f\x80\x80\x80\x00 \x02(\x02\x10\r\x00 \x02)\x03\x18!\x00 \x02A\x10j \x01\x10\x8f\x80\x80\x80\x00 \x02(\x02\x10A\x01F\r\x00 \x02 \x02)\x03\x187\x03\x08 \x02 \x007\x03\x00 \x02A\x02\x10\x87\x80\x80\x80\x00!\x00 \x02A j$\x80\x80\x80\x80\x00 \x00\x0f\x0b\x00\x0b]\x02\x01\x7f\x01~\x02@\x02@ \x01\xa7A\xff\x01q\"\x02A\xc1\x00F\r\x00\x02@ \x02A\x07F\r\x00B\x01!\x03B\x83\x90\x80\x80\x80\x01!\x01\x0c\x02\x0b \x01B\x08\x87!\x01B\x00!\x03\x0c\x01\x0bB\x00!\x03 \x01\x10\x84\x80\x80\x80\x00!\x01\x0b \x00 \x037\x03\x00 \x00 \x017\x03\x08\x0bF\x00\x02@\x02@ \x01B\x80\x80\x80\x80\x80\x80\x80\xc0\x00|B\xff\xff\xff\xff\xff\xff\xff\xff\x00V\r\x00 \x01B\x08\x86B\x07\x84!\x01\x0c\x01\x0b \x01\x10\x85\x80\x80\x80\x00!\x01\x0b \x00B\x007\x03\x00 \x00 \x017\x03\x08\x0b\x0b)\x01\x00A\x80\x80\xc0\x00\x0b V2f1f2\x00\x00\x02\x00\x10\x00\x02\x00\x00\x00\x04\x00\x10\x00\x02\x00\x00\x00\x04\x00\x10\x00\x02\x00\x00\x00\x00\xbf\x0e\x0econtractspecv0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\tfn_enum_a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x05EnumA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nfn_error_a\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05input\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x03\xe9\x00\x00\x00\x04\x00\x00\x07\xd0\x00\x00\x00\x06ErrorA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nfn_event_a\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bfn_struct_a\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x07StructA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\rfn_enum_int_a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x08EnumIntA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11fn_struct_tuple_a\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0cStructTupleA\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumA\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumB\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x02\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumC\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x07StructA\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0cStructTupleA\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorA\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorB\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorC\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00d\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00e\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00f\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventA\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_a\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventB\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_b\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f3\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventC\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_c\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02f3\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructA\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructB\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructC\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x03\xea\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x13\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntA\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntB\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntC\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00d\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\xc8\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x01,\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleA\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleB\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleC\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\x0b\x00\x1e\x11contractenvmetav0\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x00\x00+\x0econtractmetav0\x00\x00\x00\x00\x00\x00\x00\x05rsver\x00\x00\x00\x00\x00\x00\x061.91.0\x00\x00"; pub trait Contract { @@ -9800,14 +14328,17 @@ mod wasm_imported { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x07StructA\0\0\0\0\x02\0\0\0\0\0\0\0\x02f1\0\0\0\0\0\x04\0\0\0\0\0\0\0\x02f2\0\0\0\0\0\x01" } } - impl soroban_sdk::SpecShakingMarker for StructA { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } + impl soroban_sdk::spec_shaking::SpecTypeId for StructA { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xb6\x1c\xfd\xdfhY-d\xc190\xf9\xa0\xde\x1b&\xc5y\xfe\x80R\x860\xa4\xa2GE\xd7\xcd,YJ"; } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_STRUCTA: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xb6\x1c\xfd\xdfhY-d\xc190\xf9\xa0\xde\x1b&\xc5y\xfe\x80R\x860\xa4\xa2GE\xd7\xcd,YJ", + [], + ); impl soroban_sdk::TryFromVal for StructA { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -10240,14 +14771,17 @@ mod wasm_imported { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x07StructB\0\0\0\0\x02\0\0\0\0\0\0\0\x02f1\0\0\0\0\0\x07\0\0\0\0\0\0\0\x02f2\0\0\0\0\0\x10" } } - impl soroban_sdk::SpecShakingMarker for StructB { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } + impl soroban_sdk::spec_shaking::SpecTypeId for StructB { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xf3\xc4\xd3\x8c\xc1w\xe9\x18\x7f\xbdXAi{P7\xbe\xa3riQ*,\x95\xa2\xb0\xe6\x9fo#&`"; } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_STRUCTB: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xf3\xc4\xd3\x8c\xc1w\xe9\x18\x7f\xbdXAi{P7\xbe\xa3riQ*,\x95\xa2\xb0\xe6\x9fo#&`", + [], + ); impl soroban_sdk::TryFromVal for StructB { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -10680,14 +15214,18 @@ mod wasm_imported { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x07StructC\0\0\0\0\x02\0\0\0\0\0\0\0\x02f1\0\0\0\0\x03\xea\0\0\0\x04\0\0\0\0\0\0\0\x02f2\0\0\0\0\0\x13" } } - impl soroban_sdk::SpecShakingMarker for StructC { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - ::spec_shaking_marker(); - } + impl soroban_sdk::spec_shaking::SpecTypeId for StructC { + const SPEC_TYPE_ID: [u8; 32] = *b"\xa3\x16\n\x8f\xc9\x92\xd2\x11\xfe\x9f\x8b\x9a\x1f L\xd2\x0f\xec\x8a\xc7\xcdwU\x85\xc5\x166\xe7|\xad)N"; } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_STRUCTC: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\xa3\x16\n\x8f\xc9\x92\xd2\x11\xfe\x9f\x8b\x9a\x1f L\xd2\x0f\xec\x8a\xc7\xcdwU\x85\xc5\x166\xe7|\xad)N", + [], + ); impl soroban_sdk::TryFromVal for StructC { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -11123,14 +15661,18 @@ mod wasm_imported { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0cStructTupleA\0\0\0\x02\0\0\0\0\0\0\0\x010\0\0\0\0\0\0\x07\0\0\0\0\0\0\0\x011\0\0\0\0\0\0\x07" } } - impl soroban_sdk::SpecShakingMarker for StructTupleA { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } + impl soroban_sdk::spec_shaking::SpecTypeId for StructTupleA { + const SPEC_TYPE_ID: [u8; 32] = *b"\xcf)\x97]S\xb2\xfd)9\x03!Po\x97\xbb%\x93l\x96\xc9V\xcf\xa97\x9d\r\xf3\x0c\xe5\x1f.["; } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_STRUCTTUPLEA: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\xcf)\x97]S\xb2\xfd)9\x03!Po\x97\xbb%\x93l\x96\xc9V\xcf\xa97\x9d\r\xf3\x0c\xe5\x1f.[", + [], + ); impl soroban_sdk::TryFromVal for StructTupleA { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -11528,14 +16070,18 @@ mod wasm_imported { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0cStructTupleB\0\0\0\x02\0\0\0\0\0\0\0\x010\0\0\0\0\0\0\n\0\0\0\0\0\0\0\x011\0\0\0\0\0\0\n" } } - impl soroban_sdk::SpecShakingMarker for StructTupleB { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } + impl soroban_sdk::spec_shaking::SpecTypeId for StructTupleB { + const SPEC_TYPE_ID: [u8; 32] = *b"x\xd98\x9c\x1ao\xac\x8c\x08v\x8b\xec\xbf\xeb\xbd~\xd0\xb8F\xaa\xbc\x12<\xa0\x89\xe1L&\x9e\x04\xfc\xa0"; } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_STRUCTTUPLEB: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"x\xd98\x9c\x1ao\xac\x8c\x08v\x8b\xec\xbf\xeb\xbd~\xd0\xb8F\xaa\xbc\x12<\xa0\x89\xe1L&\x9e\x04\xfc\xa0", + [], + ); impl soroban_sdk::TryFromVal for StructTupleB { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -11934,14 +16480,18 @@ mod wasm_imported { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0cStructTupleC\0\0\0\x02\0\0\0\0\0\0\0\x010\0\0\0\0\0\0\x13\0\0\0\0\0\0\0\x011\0\0\0\0\0\0\x0b" } } - impl soroban_sdk::SpecShakingMarker for StructTupleC { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } + impl soroban_sdk::spec_shaking::SpecTypeId for StructTupleC { + const SPEC_TYPE_ID: [u8; 32] = *b"\xc5=\x81\xc1\"\xafT\xd9\x03\x9b\x9a]\xc4mcc\xa0y|\x12j\xe5\x9e\xb4_A\xfb\x08j#\x99\x9b"; } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_STRUCTTUPLEC: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\xc5=\x81\xc1\"\xafT\xd9\x03\x9b\x9a]\xc4mcc\xa0y|\x12j\xe5\x9e\xb4_A\xfb\x08j#\x99\x9b", + [], + ); impl soroban_sdk::TryFromVal for StructTupleC { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -12344,11 +16894,18 @@ mod wasm_imported { *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x05EnumA\0\0\0\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x02V1\0\0\0\0\0\0\0\0\0\0\0\0\0\x02V2\0\0\0\0\0\0\0\0\0\0\0\0\0\x02V3\0\0" } } - impl soroban_sdk::SpecShakingMarker for EnumA { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() {} + impl soroban_sdk::spec_shaking::SpecTypeId for EnumA { + const SPEC_TYPE_ID: [u8; 32] = *b"\xa2=N\xc1p\x95\x90\xb2/\xd4:\xe6\xc6\xae\xa2Z\xdbw\xdf\x9bT\xc6\x1a\xdd\xf1\x7f=u\xbdz\x07\xeb"; } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ENUMA: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\xa2=N\xc1p\x95\x90\xb2/\xd4:\xe6\xc6\xae\xa2Z\xdbw\xdf\x9bT\xc6\x1a\xdd\xf1\x7f=u\xbdz\x07\xeb", + [], + ); impl soroban_sdk::TryFromVal for EnumA { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -12866,13 +17423,17 @@ mod wasm_imported { *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x05EnumB\0\0\0\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x02V1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02V2\0\0\0\0\0\x01\0\0\0\x07\0\0\0\x01\0\0\0\0\0\0\0\x02V3\0\0\0\0\0\x02\0\0\0\x07\0\0\0\x07" } } - impl soroban_sdk::SpecShakingMarker for EnumB { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } + impl soroban_sdk::spec_shaking::SpecTypeId for EnumB { + const SPEC_TYPE_ID: [u8; 32] = + *b"'\x1b\0DSH^\xcc\x19\x8f\x93\xda\x937\xd01\"v\x96k\xce\xf4\xe7\xbact)\xb3KY\t\x89"; } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ENUMB: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"'\x1b\0DSH^\xcc\x19\x8f\x93\xda\x937\xd01\"v\x96k\xce\xf4\xe7\xbact)\xb3KY\t\x89", + [], + ); impl soroban_sdk::TryFromVal for EnumB { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -13506,14 +18067,21 @@ mod wasm_imported { *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x05EnumC\0\0\0\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x02V1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02V2\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x07StructA\0\0\0\0\x01\0\0\0\0\0\0\0\x02V3\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x0cStructTupleA" } } - impl soroban_sdk::SpecShakingMarker for EnumC { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } + impl soroban_sdk::spec_shaking::SpecTypeId for EnumC { + const SPEC_TYPE_ID: [u8; 32] = *b"\xa0\xdd\x8f\xdc\xc9W\xbe\xc2P;\x8c\xbd\xe5\x17V\x11\xf5\xfc_\x82X@\x0e\x8f4\xab|\xdc\xf7\xfd\x96D"; } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ENUMC: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, + >( + 2, + *b"\xa0\xdd\x8f\xdc\xc9W\xbe\xc2P;\x8c\xbd\xe5\x17V\x11\xf5\xfc_\x82X@\x0e\x8f4\xab|\xdc\xf7\xfd\x96D", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); impl soroban_sdk::TryFromVal for EnumC { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -14075,11 +18643,18 @@ mod wasm_imported { *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x08EnumIntA\0\0\0\x03\0\0\0\0\0\0\0\x02V1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02V2\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02V3\0\0\0\0\0\x03" } } - impl soroban_sdk::SpecShakingMarker for EnumIntA { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() {} + impl soroban_sdk::spec_shaking::SpecTypeId for EnumIntA { + const SPEC_TYPE_ID: [u8; 32] = *b"V]\x80\\~\x1a\x08/\xa1\x13\xf0r\x98\xa8\xc8\x9c\xdfS\x1b\xbc\x80\x10nP\x81\xfd-\x90\n\xab\x99\t"; } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ENUMINTA: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"V]\x80\\~\x1a\x08/\xa1\x13\xf0r\x98\xa8\xc8\x9c\xdfS\x1b\xbc\x80\x10nP\x81\xfd-\x90\n\xab\x99\t", + [], + ); impl soroban_sdk::TryFromVal for EnumIntA { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -14440,11 +19015,18 @@ mod wasm_imported { *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x08EnumIntB\0\0\0\x03\0\0\0\0\0\0\0\x02V1\0\0\0\0\0\n\0\0\0\0\0\0\0\x02V2\0\0\0\0\0\x14\0\0\0\0\0\0\0\x02V3\0\0\0\0\0\x1e" } } - impl soroban_sdk::SpecShakingMarker for EnumIntB { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() {} + impl soroban_sdk::spec_shaking::SpecTypeId for EnumIntB { + const SPEC_TYPE_ID: [u8; 32] = *b",\x9c\xc0_\xed_)\x85\x9b\x01\xac\x9d\xf9OMlv*\xfbE\x8f\xab\x8f.\xdaQ\x161\xc1\x07\xbap"; } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ENUMINTB: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b",\x9c\xc0_\xed_)\x85\x9b\x01\xac\x9d\xf9OMlv*\xfbE\x8f\xab\x8f.\xdaQ\x161\xc1\x07\xbap", + [], + ); impl soroban_sdk::TryFromVal for EnumIntB { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -14805,11 +19387,18 @@ mod wasm_imported { *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x08EnumIntC\0\0\0\x03\0\0\0\0\0\0\0\x02V1\0\0\0\0\0d\0\0\0\0\0\0\0\x02V2\0\0\0\0\0\xc8\0\0\0\0\0\0\0\x02V3\0\0\0\0\x01," } } - impl soroban_sdk::SpecShakingMarker for EnumIntC { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() {} + impl soroban_sdk::spec_shaking::SpecTypeId for EnumIntC { + const SPEC_TYPE_ID: [u8; 32] = *b"`\xca\xda\x19\xb9c\xf0/\xb0T\x02-\x98\x95\xbd\xbb\x87\xbf-\x9d\x1bp\xf0=\x96\xf2D\xf6yT\xdc\xd4"; } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ENUMINTC: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"`\xca\xda\x19\xb9c\xf0/\xb0T\x02-\x98\x95\xbd\xbb\x87\xbf-\x9d\x1bp\xf0=\x96\xf2D\xf6yT\xdc\xd4", + [], + ); impl soroban_sdk::TryFromVal for EnumIntC { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -15170,11 +19759,23 @@ mod wasm_imported { *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x06ErrorA\0\0\0\0\0\x03\0\0\0\0\0\0\0\x02E1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02E2\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02E3\0\0\0\0\0\x03" } } - impl soroban_sdk::SpecShakingMarker for ErrorA { + impl soroban_sdk::spec_shaking::SpecTypeId for ErrorA { + const SPEC_TYPE_ID: [u8; 32] = *b"\xe9R\xa7\xe8b\x99\xa2\xc3\x15$]1\x88\xb5~p\x1c\xe0\xc5.\xac\x12\xb8\xbd\xd5t\xfd[\x98B\xb7d"; + } + impl soroban_sdk::spec_shaking::SpecShakingMarker for ErrorA { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() {} } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ERRORA: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\xe9R\xa7\xe8b\x99\xa2\xc3\x15$]1\x88\xb5~p\x1c\xe0\xc5.\xac\x12\xb8\xbd\xd5t\xfd[\x98B\xb7d", + [], + ); impl TryFrom for ErrorA { type Error = soroban_sdk::Error; #[inline(always)] @@ -15356,11 +19957,23 @@ mod wasm_imported { *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x06ErrorB\0\0\0\0\0\x03\0\0\0\0\0\0\0\x02E1\0\0\0\0\0\n\0\0\0\0\0\0\0\x02E2\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02E3\0\0\0\0\0\x0c" } } - impl soroban_sdk::SpecShakingMarker for ErrorB { + impl soroban_sdk::spec_shaking::SpecTypeId for ErrorB { + const SPEC_TYPE_ID: [u8; 32] = *b"\x1d1\xd6\xfb\x88\xd2=\xe3}\xcd\xe8\xd8\xc1 \xd0\x9c\xfe\xab|\xdd\xaf!>\xa6=\xbf8`\xcd\x82CR"; + } + impl soroban_sdk::spec_shaking::SpecShakingMarker for ErrorB { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() {} } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ERRORB: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\x1d1\xd6\xfb\x88\xd2=\xe3}\xcd\xe8\xd8\xc1 \xd0\x9c\xfe\xab|\xdd\xaf!>\xa6=\xbf8`\xcd\x82CR", + [], + ); impl TryFrom for ErrorB { type Error = soroban_sdk::Error; #[inline(always)] @@ -15542,11 +20155,23 @@ mod wasm_imported { *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x06ErrorC\0\0\0\0\0\x03\0\0\0\0\0\0\0\x02E1\0\0\0\0\0d\0\0\0\0\0\0\0\x02E2\0\0\0\0\0e\0\0\0\0\0\0\0\x02E3\0\0\0\0\0f" } } - impl soroban_sdk::SpecShakingMarker for ErrorC { + impl soroban_sdk::spec_shaking::SpecTypeId for ErrorC { + const SPEC_TYPE_ID: [u8; 32] = *b"\xb9\x01\xafj\xe0c\xa3\rk\x83\xec\x83DA\xd9\\q\xfbtE\xc0\xf8\x83\xdd\x84\xc9\xb0\x95\x18\x98pd"; + } + impl soroban_sdk::spec_shaking::SpecShakingMarker for ErrorC { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() {} } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ERRORC: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\xb9\x01\xafj\xe0c\xa3\rk\x83\xec\x83DA\xd9\\q\xfbtE\xc0\xf8\x83\xdd\x84\xc9\xb0\x95\x18\x98pd", + [], + ); impl TryFrom for ErrorC { type Error = soroban_sdk::Error; #[inline(always)] @@ -15728,14 +20353,13 @@ mod wasm_imported { *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x06EventA\0\0\0\0\0\x01\0\0\0\x07event_a\0\0\0\0\x02\0\0\0\0\0\0\0\x02f1\0\0\0\0\0\x13\0\0\0\x01\0\0\0\0\0\0\0\x02f2\0\0\0\0\0\x10\0\0\0\0\0\0\0\x02" } } - impl soroban_sdk::SpecShakingMarker for EventA { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } - } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_EVENT_EVENTA: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 1, + *b"K\xe6\x8ej\x19\x9en\xbd\xccv\xd2:}`\x07\xddn\xe9\x904>\x9b^h\xa7\x04%Be#r\x9b", + [], + ); impl soroban_sdk::Event for EventA { fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { use soroban_sdk::IntoVal; @@ -15763,7 +20387,6 @@ mod wasm_imported { } impl EventA { pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); <_ as soroban_sdk::Event>::publish(self, env); } } @@ -15848,15 +20471,15 @@ mod wasm_imported { *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x06EventB\0\0\0\0\0\x01\0\0\0\x07event_b\0\0\0\0\x03\0\0\0\0\0\0\0\x02f1\0\0\0\0\0\x13\0\0\0\x01\0\0\0\0\0\0\0\x02f2\0\0\0\0\0\x13\0\0\0\x01\0\0\0\0\0\0\0\x02f3\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" } } - impl soroban_sdk::SpecShakingMarker for EventB { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } - } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_EVENT_EVENTB: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 1, + *b"\xe6\xaa\xefz\x17i$\x15\x95\x112\x06\xef\xd7R\xa8\xc9\x83\xf2\xc8\x87i\xadz\x1e\xdc\x8e\x90\x1c-\x80`", + [], + ); impl soroban_sdk::Event for EventB { fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { use soroban_sdk::IntoVal; @@ -15888,7 +20511,6 @@ mod wasm_imported { } impl EventB { pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); <_ as soroban_sdk::Event>::publish(self, env); } } @@ -15972,15 +20594,15 @@ mod wasm_imported { *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x06EventC\0\0\0\0\0\x01\0\0\0\x07event_c\0\0\0\0\x03\0\0\0\0\0\0\0\x02f1\0\0\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x02f2\0\0\0\0\0\x07\0\0\0\0\0\0\0\0\0\0\0\x02f3\0\0\0\0\0\x07\0\0\0\0\0\0\0\x02" } } - impl soroban_sdk::SpecShakingMarker for EventC { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } - } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_EVENT_EVENTC: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 1, + *b"\x16\xd6\xdf\xe7\xdb\xb4W@\x9b\x92\x97\xb9\x1a\x14\xeeK\xbf6\xfe\x92\xab`\xa1\xe3\xc8r\\\"T0\xb8!", + [], + ); impl soroban_sdk::Event for EventC { fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { use soroban_sdk::IntoVal; @@ -16008,7 +20630,6 @@ mod wasm_imported { } impl EventC { pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); <_ as soroban_sdk::Event>::publish(self, env); } } @@ -16056,13 +20677,18 @@ impl UnusedStruct { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0cUnusedStruct\0\0\0\x01\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UnusedStruct { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UnusedStruct { + const SPEC_TYPE_ID: [u8; 32] = *b"|\x9c\t\x1e\xf5\xa8\x19\xa0\t\xdb\x92\xcaaA\xc9\x1e\xee\xf2\xf0\xd1\x95L\xc7\xec\xc0\x08U\x9a\xe6\x8f\xcb\x1c"; } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UNUSEDSTRUCT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"|\x9c\t\x1e\xf5\xa8\x19\xa0\t\xdb\x92\xcaaA\xc9\x1e\xee\xf2\xf0\xd1\x95L\xc7\xec\xc0\x08U\x9a\xe6\x8f\xcb\x1c", + [], +); impl soroban_sdk::TryFromVal for UnusedStruct { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -16427,13 +21053,18 @@ impl UnusedEnum { *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\nUnusedEnum\0\0\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x01A\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01B\0\0\0\0\0\0\x01\0\0\0\x07" } } -impl soroban_sdk::SpecShakingMarker for UnusedEnum { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UnusedEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"/\x82\x9a0\xbe@\x0eZ\xe3\x8c\xaf\xe8\x9f\xcb\x96\x9d\x06S\xe9,\x94\x9b\x83U-|16\x1d\xa3\xdb\xb1"; } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UNUSEDENUM: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"/\x82\x9a0\xbe@\x0eZ\xe3\x8c\xaf\xe8\x9f\xcb\x96\x9d\x06S\xe9,\x94\x9b\x83U-|16\x1d\xa3\xdb\xb1", + [], +); impl soroban_sdk::TryFromVal for UnusedEnum { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -16897,11 +21528,18 @@ impl UnusedIntEnum { *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\rUnusedIntEnum\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02U1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02U2\0\0\0\0\0\x02" } } -impl soroban_sdk::SpecShakingMarker for UnusedIntEnum { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() {} +impl soroban_sdk::spec_shaking::SpecTypeId for UnusedIntEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"\x0c\xdd\xee~,\x83\xe4\x9c\xf6\x82\x80\xd5\xc3\xe4\xce\x0c\xe1\xf7\xff\xe0\xcf\x8f\x0e\xc7Cue;\xd2;\x90\xf5"; } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UNUSEDINTENUM: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\x0c\xdd\xee~,\x83\xe4\x9c\xf6\x82\x80\xd5\xc3\xe4\xce\x0c\xe1\xf7\xff\xe0\xcf\x8f\x0e\xc7Cue;\xd2;\x90\xf5", + [], +); impl soroban_sdk::TryFromVal for UnusedIntEnum { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -17231,14 +21869,15 @@ impl UnusedEvent { *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x0bUnusedEvent\0\0\0\0\x01\0\0\0\x0cunused_event\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04\0\0\0\0\0\0\0\x02" } } -impl soroban_sdk::SpecShakingMarker for UnusedEvent { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } -} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_EVENT_UNUSEDEVENT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 1, + *b"\x10\xe8\xf6\xcc\xea\xc3Sb\x01\xb0_\x05\xcb\xf1It\xa2\xca\xdc\xd7\xa9\xc2~\xbd_\x08\x98@y\xc2\xf1\xbf", + [], +); impl soroban_sdk::Event for UnusedEvent { fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { use soroban_sdk::IntoVal; @@ -17259,7 +21898,6 @@ impl soroban_sdk::Event for UnusedEvent { } impl UnusedEvent { pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); <_ as soroban_sdk::Event>::publish(self, env); } } @@ -17304,11 +21942,22 @@ impl UnusedPubError { *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x0eUnusedPubError\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04Nope\0\0\0\x01" } } -impl soroban_sdk::SpecShakingMarker for UnusedPubError { +impl soroban_sdk::spec_shaking::SpecTypeId for UnusedPubError { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xe7\xf0{7\xdd\x90z=3\xe0\xb9\\\xdfc\x03\xe6lF_A\x90L( + 2, + *b"\xe7\xf0{7\xdd\x90z=3\xe0\xb9\\\xdfc\x03\xe6lF_A\x90L for UnusedPubError { type Error = soroban_sdk::Error; #[inline(always)] @@ -17461,13 +22110,18 @@ impl UnusedNonContractFnParam { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x18UnusedNonContractFnParam\0\0\0\x01\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UnusedNonContractFnParam { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UnusedNonContractFnParam { + const SPEC_TYPE_ID: [u8; 32] = *b"\x81\xbc\xdb\xb4\xc1\xcb\xbd\xc5\x8a\x8d\xbc\xf2\x19kdi@]\xbe\xc3\xbf\x97lX\x84d=\x90\x1b\xc8\xc5\x86"; } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UNUSEDNONCONTRACTFNPARAM: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\x81\xbc\xdb\xb4\xc1\xcb\xbd\xc5\x8a\x8d\xbc\xf2\x19kdi@]\xbe\xc3\xbf\x97lX\x84d=\x90\x1b\xc8\xc5\x86", + [], +); impl soroban_sdk::TryFromVal for UnusedNonContractFnParam { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -17835,13 +22489,18 @@ impl UnusedNonContractFnReturn { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x19UnusedNonContractFnReturn\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UnusedNonContractFnReturn { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UnusedNonContractFnReturn { + const SPEC_TYPE_ID: [u8; 32] = *b"\x7fe\x1c\n\x87g\x1d\xc0\x06x\xb0\xae8\x04\x1eO(Q\xf0\xe5\xb2\xef.\xd8\x95\xe1;*\xa4\x96\xf49"; } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UNUSEDNONCONTRACTFNRETURN: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\x7fe\x1c\n\x87g\x1d\xc0\x06x\xb0\xae8\x04\x1eO(Q\xf0\xe5\xb2\xef.\xd8\x95\xe1;*\xa4\x96\xf49", + [], +); impl soroban_sdk::TryFromVal for UnusedNonContractFnReturn { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -18203,13 +22862,17 @@ impl UnusedNonPubStruct { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UnusedNonPubStruct\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UnusedNonPubStruct { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UnusedNonPubStruct { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xa8;,%}]PA\xe4\xae\xa7|l\"\xef\xeb\xc8\xe6\x08\n\xea\xf8x\xaa\x95\xb2\xa4\xaat\xdfB6"; } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UNUSEDNONPUBSTRUCT: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xa8;,%}]PA\xe4\xae\xa7|l\"\xef\xeb\xc8\xe6\x08\n\xea\xf8x\xaa\x95\xb2\xa4\xaat\xdfB6", + [], + ); impl soroban_sdk::TryFromVal for UnusedNonPubStruct { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -18563,11 +23226,23 @@ impl UnusedNonPubError { *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x11UnusedNonPubError\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03Bad\0\0\0\0\x01" } } -impl soroban_sdk::SpecShakingMarker for UnusedNonPubError { +impl soroban_sdk::spec_shaking::SpecTypeId for UnusedNonPubError { + const SPEC_TYPE_ID: [u8; 32] = *b"\xd9_\x99\"=\xc6FM\xa7U\x9d\xc5\x8b\x9b\xee\x99!\x86}\x99|P\x15\x8e\x16\x0e&\xe5p\xa3]\xe4"; +} +impl soroban_sdk::spec_shaking::SpecShakingMarker for UnusedNonPubError { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() {} } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UNUSEDNONPUBERROR: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\xd9_\x99\"=\xc6FM\xa7U\x9d\xc5\x8b\x9b\xee\x99!\x86}\x99|P\x15\x8e\x16\x0e&\xe5p\xa3]\xe4", + [], +); impl TryFrom for UnusedNonPubError { type Error = soroban_sdk::Error; #[inline(always)] @@ -18673,7 +23348,9 @@ impl soroban_sdk::TryFromVal for soroban_s } #[allow(private_interfaces)] impl Contract { + pub fn __constructor(_env: Env, _meta: UsedConstructorMeta) {} pub fn with_param(_env: Env, _s: UsedParamStruct, _ie: UsedParamIntEnum) {} + pub fn with_context(_env: Env, _context: Context) {} pub fn with_return(_env: Env) -> UsedReturnEnum { UsedReturnEnum::A(1) } @@ -18687,6 +23364,13 @@ impl Contract { }; } } + pub fn with_panic_error_ref(env: Env, fail: bool) { + if fail { + { + (&env).panic_with_error(&UsedPanicErrorEnumRef::Boom); + }; + } + } pub fn with_assert_error(env: Env, ok: bool) { { if !(ok) { @@ -18704,11 +23388,13 @@ impl Contract { } } pub fn with_vec(_env: Env, _v: Vec) {} + pub fn with_vec_nested(_env: Env, _v: Vec) {} pub fn with_map(_env: Env, _m: Map) {} pub fn with_option(_env: Env, _o: Option) {} pub fn with_result(_env: Env) -> Result { Ok(UsedResultOk { data: 1 }) } + pub fn with_recursion(_env: Env, _r: UsedRecursiveRoot) {} pub fn publish_simple(env: Env) { UsedEventSimple { kind: Symbol::new(&env, "transfer"), @@ -18772,6 +23458,30 @@ impl Contract { } #[doc(hidden)] #[allow(non_snake_case)] +pub mod __Contract____constructor__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN___CONSTRUCTOR: [u8; 76usize] = + super::Contract::spec_xdr___constructor(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr___constructor() -> [u8; 76usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\r__constructor\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04meta\0\0\x07\xd0\0\0\0\x13UsedConstructorMeta\0\0\0\0\0" + } +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT___CONSTRUCTOR: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"\xc2\x7f\t\x92\x8d\xa6\xe9Pv\xc6\xab\xcf\x07Q\x98\x10\xd5\xd8|\x85\xe7\x12\xf6\x8aR\xa0]\xff\x1e~\xccV", + [::SPEC_TYPE_ID], +); +#[doc(hidden)] +#[allow(non_snake_case)] pub mod __Contract__with_param__spec { #[doc(hidden)] #[allow(non_snake_case)] @@ -18784,6 +23494,41 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\nwith_param\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01s\0\0\0\0\0\x07\xd0\0\0\0\x0fUsedParamStruct\0\0\0\0\0\0\0\0\x02ie\0\0\0\0\x07\xd0\0\0\0\x10UsedParamIntEnum\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_PARAM: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"9AZ\x8d\xc6\x89R\xa2A\xb7\xff\xf2d\xef\xb2b\xd6\x93\x96\x8a\xf6\xf3\xf3\xe2\x8f\xcc\x88T\x13\x10a\xdb", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__with_context__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN_WITH_CONTEXT: [u8; 64usize] = super::Contract::spec_xdr_with_context(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_context() -> [u8; 64usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0cwith_context\0\0\0\x01\0\0\0\0\0\0\0\x07context\0\0\0\x07\xd0\0\0\0\x07Context\0\0\0\0\0" + } +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_CONTEXT: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"b\xc2\xbdU\xd1\x05\x81o\xa4\x12\xb3\"\xe5\xb0H\x19\x8a\x02M\xe6\xe2\xb4\xc6\x9e\x98\xb7{\xcd\x1f\\\xb0\x15", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_return__spec { @@ -18798,6 +23543,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0bwith_return\0\0\0\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x0eUsedReturnEnum\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_RETURN: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"K\xaa\xb0_Y\\]\xc1\x06\xa8\xd9\xbf\x0f%\xfd\xa2\x13\xee\x84\xe4\xff<6\xf4\x03\"2\x9d\xfb\xb9\xfe\xf2", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_error__spec { @@ -18812,6 +23566,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\nwith_error\0\0\0\0\0\0\0\0\0\x01\0\0\x03\xe9\0\0\0\x04\0\0\x07\xd0\0\0\0\rUsedErrorEnum\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_ERROR: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b",\xccnmf\x98\xf0\x1f\xb7\x1e\xc6\x9b\xb8\x1d`\xdeVb\xcc\xd9\xd5;\xc9\x17E:\x18\x96i?\xees", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_panic_error__spec { @@ -18827,6 +23590,39 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x10with_panic_error\0\0\0\x01\0\0\0\0\0\0\0\x04fail\0\0\0\x01\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_PANIC_ERROR: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xc6\xf0\xfd2g\x89\x8d\x16\x10\xe1P\x83<\xf6(\x19\xc4\x81\x8120\xe7\x14\xa6\xa7\x90\xd9\xe4\xd3\x9d\xaa\x0e", + [], +); +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__with_panic_error_ref__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN_WITH_PANIC_ERROR_REF: [u8; 56usize] = + super::Contract::spec_xdr_with_panic_error_ref(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_panic_error_ref() -> [u8; 56usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x14with_panic_error_ref\0\0\0\x01\0\0\0\0\0\0\0\x04fail\0\0\0\x01\0\0\0\0" + } +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_PANIC_ERROR_REF: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xcdB\x02\xf7\xfd\x86\xae<*\x7fR\xee9\x815\"K\xa8\x1c\x18<\x812\xfc\xf0s\xd3U\xd9\xbdD\x16", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_assert_error__spec { @@ -18842,6 +23638,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x11with_assert_error\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02ok\0\0\0\0\0\x01\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_ASSERT_ERROR: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xee\xec\xcb\x84V\xda\x92P\"t'\xe64\xde\x853\xcb\xd44Z\x04\x1c\x13\xca\xcd\xf9\xb3\xab^\xdb\x91\xb4", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_panic_raw_error__spec { @@ -18857,6 +23662,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x14with_panic_raw_error\0\0\0\x01\0\0\0\0\0\0\0\x04fail\0\0\0\x01\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_PANIC_RAW_ERROR: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xa8\x16\x96\x10I\xdc\x18\xfb-\xcc.P\xe4\x8a\x8f\x88\x04&\x8a\xc61@\x9af,\xb9c5R\0,\"", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_vec__spec { @@ -18871,6 +23683,39 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08with_vec\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x0eUsedVecElement\0\0\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_VEC: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"\xac\xab\xce\x9a\xb4\x11\xfd\xff\x88\xc6x\xbf\x90\xbc\x9c\xf4.Fy::SPEC_TYPE_ID], +); +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__with_vec_nested__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN_WITH_VEC_NESTED: [u8; 80usize] = + super::Contract::spec_xdr_with_vec_nested(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_vec_nested() -> [u8; 80usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0fwith_vec_nested\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x14UsedVecElementNested\0\0\0\0" + } +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_VEC_NESTED: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"=\xc9^7\x8a\xd6\xc3\x91\x81\xea\x1aw\xf0&\x84\xc5=w\xbe\xce\xa3Q\xaa)\xa3\xe1z\x05\xc3\x90\xe9\xfe", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_map__spec { @@ -18885,6 +23730,18 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08with_map\0\0\0\x01\0\0\0\0\0\0\0\x01m\0\0\0\0\0\x03\xec\0\0\x07\xd0\0\0\0\nUsedMapKey\0\0\0\0\x07\xd0\0\0\0\nUsedMapVal\0\0\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_MAP: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"\x1c:c\xadb\x1c6\x05Z<\x1c\x1e~,\xa4?\xd5\xce:\x1d4g\xc1\x1e\xdc\x1f\xf3\x87\xa5\xe2\x97\xa1", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_option__spec { @@ -18899,6 +23756,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0bwith_option\0\0\0\0\x01\0\0\0\0\0\0\0\x01o\0\0\0\0\0\x03\xe8\0\0\x07\xd0\0\0\0\x11UsedOptionElement\0\0\0\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_OPTION: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"\x98;\xeb\x9f\x1c\xdf\xf3\xd2\x90E\x08\xce)e\x16\xdazb\xaeB}\xa9\x8d\xdd6P\xa9g\xc5\xea\xb7m", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_result__spec { @@ -18913,6 +23779,40 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0bwith_result\0\0\0\0\0\0\0\0\x01\0\0\x03\xe9\0\0\x07\xd0\0\0\0\x0cUsedResultOk\0\0\x07\xd0\0\0\0\rUsedErrorEnum\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_RESULT: [u8; 106usize] = + soroban_sdk::spec_shaking::encode_graph_record::<106usize, 2usize>( + 0, + *b"6::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__with_recursion__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN_WITH_RECURSION: [u8; 76usize] = + super::Contract::spec_xdr_with_recursion(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_recursion() -> [u8; 76usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0ewith_recursion\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01r\0\0\0\0\0\x07\xd0\0\0\0\x11UsedRecursiveRoot\0\0\0\0\0\0\0" + } +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_RECURSION: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"\x95\x02\"L\x8a\x81*\x08\x17c\xae#g\t\xb6\x02\rt\x03\x9e\xe5D\xf2\xfd\xd5\x94\x04\xa4\x0cG\x88\xbd", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__publish_simple__spec { @@ -18928,6 +23828,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0epublish_simple\0\0\0\0\0\0\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_PUBLISH_SIMPLE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"U\x86\x1b\x93v\xa5\x8c\x81\x9c\xf5\xb4\xf4\xd7\xd5\x8c?\xe4\xb4?;{\x9a\xe957p\xfd-\x8e\x91\xfb\xb9", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__publish_topic_type__spec { @@ -18943,6 +23852,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x12publish_topic_type\0\0\0\0\0\0\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_PUBLISH_TOPIC_TYPE: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xee\x97\xa6+\xa5\xb6\xc5 b\xed\x18RU\x89z',\x9ffq\xc0c\xbfZ\xcar\x14^oz\xf6_", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__publish_data_type__spec { @@ -18958,6 +23874,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x11publish_data_type\0\0\0\0\0\0\0\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_PUBLISH_DATA_TYPE: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xb5z-\x08C&*\xbe\x83:\x87\"\xe9$|\xd8\xfa\xfeB\xea\xf0.\xb6W\xf0\x86][o\xcb\x8c\xe5", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__publish_nested_topic__spec { @@ -18973,6 +23896,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x14publish_nested_topic\0\0\0\0\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_PUBLISH_NESTED_TOPIC: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xa3\x15\xec\xffg\x02E\xabPG\xb9\x01Q\xf0\0\xe0 \xebF\xa3\xce\xe4\x9a\xda\xbfC\xbe[\x16|\x0cy", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__publish_nested_data__spec { @@ -18988,6 +23920,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x13publish_nested_data\0\0\0\0\0\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_PUBLISH_NESTED_DATA: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x85\x91`+\xaez\xee\x08\x9a\\\x18\xab1\xab\x13\xf6\xc6%\xfbj\xf2\xff/\x98E\xe6\xc9\xa7L\x83\x86\xbb", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_lib_struct__spec { @@ -19003,6 +23944,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0fwith_lib_struct\0\0\0\0\x01\0\0\0\0\0\0\0\x01s\0\0\0\0\0\x07\xd0\0\0\0\x07StructC\0\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_LIB_STRUCT: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"?\xbe1a\xd0/\xc8\xee\xc8\xfc\xf1\xfe\x0e\xb6\x81`\x91\xeao\x10\xc5\xc4\xa0L^\xdd\xf4j\x01F,Z", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_wasm_imported__spec { @@ -19018,6 +23968,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x12with_wasm_imported\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01s\0\0\0\0\0\x07\xd0\0\0\0\x07StructA\0\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_WASM_IMPORTED: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"\xa3\x98\xd5x\xf0O\"\x89\xdc>\xfe\xc4\xd4\xdf\xc1\x8aN\x19v\xed\xaa\t\x85p\xc5\xa5[\xef\xb0\xd6>\xae", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_non_pub__spec { @@ -19032,6 +23991,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0cwith_non_pub\0\0\0\x01\0\0\0\0\0\0\0\x01s\0\0\0\0\0\x07\xd0\0\0\0\x10UsedNonPubStruct\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_NON_PUB: [u8; 74usize] = + soroban_sdk::spec_shaking::encode_graph_record::<74usize, 1usize>( + 0, + *b"\x13\xb2]FU\xec\xf3\xbb%\x0c6Veq\xda\x82q\x96\xd1F\x96\xaday`\xfe\xef\\3\x1aB\n", + [::SPEC_TYPE_ID], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_non_pub_error__spec { @@ -19047,6 +24013,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x12with_non_pub_error\0\0\0\0\0\0\0\0\0\x01\0\0\x03\xe9\0\0\0\x04\0\0\x07\xd0\0\0\0\x0fUsedNonPubError\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_NON_PUB_ERROR: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"D\xbeG?\x1c\x8c\xb2\x96\xbcS\xed\xb1`\xb3\x1a\xb6>\xe397\xc1\x9e\x19\x18#\x81\xd1\xcb\x85O\xb6\xea", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_tuple__spec { @@ -19061,6 +24036,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\nwith_tuple\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01t\0\0\0\0\0\x03\xed\0\0\0\x02\0\0\x07\xd0\0\0\0\x10UsedTupleElement\0\0\0\x04\0\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_TUPLE: [u8; 74usize] = + soroban_sdk::spec_shaking::encode_graph_record::<74usize, 1usize>( + 0, + *b"\x921\x17mb\xdb@#\x02]\xc0o\x95\xa30x\x9e\x8e\x0e5\r\xc0\xc2\xe7-G\x90\x19\x1cf\xc8=", + [::SPEC_TYPE_ID], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_tuple_return__spec { @@ -19076,6 +24058,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x11with_tuple_return\0\0\0\0\0\0\0\0\0\0\x01\0\0\x03\xed\0\0\0\x02\0\0\x07\xd0\0\0\0\x16UsedTupleReturnElement\0\0\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_TUPLE_RETURN: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"\xe3\x01\xf3\xbf\xd9\x995\x9a\xba\x90\rF\xc6\xb3^\x86\x12L\xffR\xf0\xbd\x0b\xc0N\xc0\xe1f\x13\x88w\x84", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__publish_ref_event__spec { @@ -19090,9 +24081,61 @@ impl Contract { pub const fn spec_xdr_publish_ref_event() -> [u8; 40usize] { *b"\0\0\0\0\0\0\0\0\0\0\0\x11publish_ref_event\0\0\0\0\0\0\0\0\0\0\0" } -} -impl<'a> ContractClient<'a> { - pub fn with_param(&self, _s: &UsedParamStruct, _ie: &UsedParamIntEnum) -> () { +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_PUBLISH_REF_EVENT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xb6\x92\x87\x14\xa1\xab\x9b\xe8\x85\xa5\x8c\xe6\xf5\x150\x82\x81\x1c\x9d\x9a\xef\x16C\x04{=\x7f<\xfd\r\xf1a", + [], +); +impl<'a> ContractClient<'a> { + pub fn with_param(&self, _s: &UsedParamStruct, _ie: &UsedParamIntEnum) -> () { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_param") }, + ::soroban_sdk::Vec::from_array( + &self.env, + [_s.into_val(&self.env), _ie.into_val(&self.env)], + ), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn try_with_param( + &self, + _s: &UsedParamStruct, + _ie: &UsedParamIntEnum, + ) -> Result< + Result<(), <() as soroban_sdk::TryFromVal>::Error>, + Result, + > { use core::ops::Not; let old_auth_manager = self .env @@ -19115,7 +24158,7 @@ impl<'a> ContractClient<'a> { } } use soroban_sdk::{FromVal, IntoVal}; - let res = self.env.invoke_contract( + let res = self.env.try_invoke_contract( &self.address, &{ soroban_sdk::Symbol::new(&self.env, "with_param") }, ::soroban_sdk::Vec::from_array( @@ -19128,10 +24171,259 @@ impl<'a> ContractClient<'a> { } res } - pub fn try_with_param( + pub fn with_context(&self, _context: &Context) -> () { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_context") }, + ::soroban_sdk::Vec::from_array(&self.env, [_context.into_val(&self.env)]), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn try_with_context( + &self, + _context: &Context, + ) -> Result< + Result<(), <() as soroban_sdk::TryFromVal>::Error>, + Result, + > { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_context") }, + ::soroban_sdk::Vec::from_array(&self.env, [_context.into_val(&self.env)]), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn with_return(&self) -> UsedReturnEnum { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_return") }, + ::soroban_sdk::Vec::new(&self.env), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn try_with_return( + &self, + ) -> Result< + Result< + UsedReturnEnum, + >::Error, + >, + Result, + > { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_return") }, + ::soroban_sdk::Vec::new(&self.env), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn with_error(&self) -> u32 { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_error") }, + ::soroban_sdk::Vec::new(&self.env), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn try_with_error( + &self, + ) -> Result< + Result>::Error>, + Result, + > { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_error") }, + ::soroban_sdk::Vec::new(&self.env), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn with_panic_error(&self, fail: &bool) -> () { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_panic_error") }, + ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn try_with_panic_error( &self, - _s: &UsedParamStruct, - _ie: &UsedParamIntEnum, + fail: &bool, ) -> Result< Result<(), <() as soroban_sdk::TryFromVal>::Error>, Result, @@ -19160,18 +24452,15 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_param") }, - ::soroban_sdk::Vec::from_array( - &self.env, - [_s.into_val(&self.env), _ie.into_val(&self.env)], - ), + &{ soroban_sdk::Symbol::new(&self.env, "with_panic_error") }, + ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn with_return(&self) -> UsedReturnEnum { + pub fn with_panic_error_ref(&self, fail: &bool) -> () { use core::ops::Not; let old_auth_manager = self .env @@ -19196,21 +24485,19 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_return") }, - ::soroban_sdk::Vec::new(&self.env), + &{ soroban_sdk::Symbol::new(&self.env, "with_panic_error_ref") }, + ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn try_with_return( + pub fn try_with_panic_error_ref( &self, + fail: &bool, ) -> Result< - Result< - UsedReturnEnum, - >::Error, - >, + Result<(), <() as soroban_sdk::TryFromVal>::Error>, Result, > { use core::ops::Not; @@ -19237,15 +24524,15 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_return") }, - ::soroban_sdk::Vec::new(&self.env), + &{ soroban_sdk::Symbol::new(&self.env, "with_panic_error_ref") }, + ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn with_error(&self) -> u32 { + pub fn with_assert_error(&self, ok: &bool) -> () { use core::ops::Not; let old_auth_manager = self .env @@ -19270,19 +24557,20 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_error") }, - ::soroban_sdk::Vec::new(&self.env), + &{ soroban_sdk::Symbol::new(&self.env, "with_assert_error") }, + ::soroban_sdk::Vec::from_array(&self.env, [ok.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn try_with_error( + pub fn try_with_assert_error( &self, + ok: &bool, ) -> Result< - Result>::Error>, - Result, + Result<(), <() as soroban_sdk::TryFromVal>::Error>, + Result, > { use core::ops::Not; let old_auth_manager = self @@ -19308,15 +24596,15 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_error") }, - ::soroban_sdk::Vec::new(&self.env), + &{ soroban_sdk::Symbol::new(&self.env, "with_assert_error") }, + ::soroban_sdk::Vec::from_array(&self.env, [ok.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn with_panic_error(&self, fail: &bool) -> () { + pub fn with_panic_raw_error(&self, fail: &bool) -> () { use core::ops::Not; let old_auth_manager = self .env @@ -19341,7 +24629,7 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_panic_error") }, + &{ soroban_sdk::Symbol::new(&self.env, "with_panic_raw_error") }, ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { @@ -19349,7 +24637,7 @@ impl<'a> ContractClient<'a> { } res } - pub fn try_with_panic_error( + pub fn try_with_panic_raw_error( &self, fail: &bool, ) -> Result< @@ -19380,7 +24668,7 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_panic_error") }, + &{ soroban_sdk::Symbol::new(&self.env, "with_panic_raw_error") }, ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { @@ -19388,7 +24676,7 @@ impl<'a> ContractClient<'a> { } res } - pub fn with_assert_error(&self, ok: &bool) -> () { + pub fn with_vec(&self, _v: &Vec) -> () { use core::ops::Not; let old_auth_manager = self .env @@ -19413,17 +24701,21 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_assert_error") }, - ::soroban_sdk::Vec::from_array(&self.env, [ok.into_val(&self.env)]), + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("with_vec"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array(&self.env, [_v.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn try_with_assert_error( + pub fn try_with_vec( &self, - ok: &bool, + _v: &Vec, ) -> Result< Result<(), <() as soroban_sdk::TryFromVal>::Error>, Result, @@ -19452,15 +24744,19 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_assert_error") }, - ::soroban_sdk::Vec::from_array(&self.env, [ok.into_val(&self.env)]), + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("with_vec"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array(&self.env, [_v.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn with_panic_raw_error(&self, fail: &bool) -> () { + pub fn with_vec_nested(&self, _v: &Vec) -> () { use core::ops::Not; let old_auth_manager = self .env @@ -19485,17 +24781,17 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_panic_raw_error") }, - ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), + &{ soroban_sdk::Symbol::new(&self.env, "with_vec_nested") }, + ::soroban_sdk::Vec::from_array(&self.env, [_v.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn try_with_panic_raw_error( + pub fn try_with_vec_nested( &self, - fail: &bool, + _v: &Vec, ) -> Result< Result<(), <() as soroban_sdk::TryFromVal>::Error>, Result, @@ -19524,15 +24820,15 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_panic_raw_error") }, - ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), + &{ soroban_sdk::Symbol::new(&self.env, "with_vec_nested") }, + ::soroban_sdk::Vec::from_array(&self.env, [_v.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn with_vec(&self, _v: &Vec) -> () { + pub fn with_map(&self, _m: &Map) -> () { use core::ops::Not; let old_auth_manager = self .env @@ -19559,19 +24855,19 @@ impl<'a> ContractClient<'a> { &self.address, &{ #[allow(deprecated)] - const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("with_vec"); + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("with_map"); SYMBOL }, - ::soroban_sdk::Vec::from_array(&self.env, [_v.into_val(&self.env)]), + ::soroban_sdk::Vec::from_array(&self.env, [_m.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn try_with_vec( + pub fn try_with_map( &self, - _v: &Vec, + _m: &Map, ) -> Result< Result<(), <() as soroban_sdk::TryFromVal>::Error>, Result, @@ -19602,17 +24898,17 @@ impl<'a> ContractClient<'a> { &self.address, &{ #[allow(deprecated)] - const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("with_vec"); + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("with_map"); SYMBOL }, - ::soroban_sdk::Vec::from_array(&self.env, [_v.into_val(&self.env)]), + ::soroban_sdk::Vec::from_array(&self.env, [_m.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn with_map(&self, _m: &Map) -> () { + pub fn with_option(&self, _o: &Option) -> () { use core::ops::Not; let old_auth_manager = self .env @@ -19637,21 +24933,17 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.invoke_contract( &self.address, - &{ - #[allow(deprecated)] - const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("with_map"); - SYMBOL - }, - ::soroban_sdk::Vec::from_array(&self.env, [_m.into_val(&self.env)]), + &{ soroban_sdk::Symbol::new(&self.env, "with_option") }, + ::soroban_sdk::Vec::from_array(&self.env, [_o.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn try_with_map( + pub fn try_with_option( &self, - _m: &Map, + _o: &Option, ) -> Result< Result<(), <() as soroban_sdk::TryFromVal>::Error>, Result, @@ -19680,19 +24972,15 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ - #[allow(deprecated)] - const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("with_map"); - SYMBOL - }, - ::soroban_sdk::Vec::from_array(&self.env, [_m.into_val(&self.env)]), + &{ soroban_sdk::Symbol::new(&self.env, "with_option") }, + ::soroban_sdk::Vec::from_array(&self.env, [_o.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn with_option(&self, _o: &Option) -> () { + pub fn with_result(&self) -> UsedResultOk { use core::ops::Not; let old_auth_manager = self .env @@ -19717,20 +25005,22 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_option") }, - ::soroban_sdk::Vec::from_array(&self.env, [_o.into_val(&self.env)]), + &{ soroban_sdk::Symbol::new(&self.env, "with_result") }, + ::soroban_sdk::Vec::new(&self.env), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn try_with_option( + pub fn try_with_result( &self, - _o: &Option, ) -> Result< - Result<(), <() as soroban_sdk::TryFromVal>::Error>, - Result, + Result< + UsedResultOk, + >::Error, + >, + Result, > { use core::ops::Not; let old_auth_manager = self @@ -19756,15 +25046,15 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_option") }, - ::soroban_sdk::Vec::from_array(&self.env, [_o.into_val(&self.env)]), + &{ soroban_sdk::Symbol::new(&self.env, "with_result") }, + ::soroban_sdk::Vec::new(&self.env), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn with_result(&self) -> UsedResultOk { + pub fn with_recursion(&self, _r: &UsedRecursiveRoot) -> () { use core::ops::Not; let old_auth_manager = self .env @@ -19789,22 +25079,20 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_result") }, - ::soroban_sdk::Vec::new(&self.env), + &{ soroban_sdk::Symbol::new(&self.env, "with_recursion") }, + ::soroban_sdk::Vec::from_array(&self.env, [_r.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); } res } - pub fn try_with_result( + pub fn try_with_recursion( &self, + _r: &UsedRecursiveRoot, ) -> Result< - Result< - UsedResultOk, - >::Error, - >, - Result, + Result<(), <() as soroban_sdk::TryFromVal>::Error>, + Result, > { use core::ops::Not; let old_auth_manager = self @@ -19830,8 +25118,8 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_result") }, - ::soroban_sdk::Vec::new(&self.env), + &{ soroban_sdk::Symbol::new(&self.env, "with_recursion") }, + ::soroban_sdk::Vec::from_array(&self.env, [_r.into_val(&self.env)]), ); if let Some(old_auth_manager) = old_auth_manager { self.env.host().set_auth_manager(old_auth_manager).unwrap(); @@ -20702,6 +25990,11 @@ impl<'a> ContractClient<'a> { } } impl ContractArgs { + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn __constructor<'i>(_meta: &'i UsedConstructorMeta) -> (&'i UsedConstructorMeta,) { + (_meta,) + } #[inline(always)] #[allow(clippy::unused_unit)] pub fn with_param<'i>( @@ -20712,6 +26005,11 @@ impl ContractArgs { } #[inline(always)] #[allow(clippy::unused_unit)] + pub fn with_context<'i>(_context: &'i Context) -> (&'i Context,) { + (_context,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] pub fn with_return<'i>() -> () { () } @@ -20727,6 +26025,11 @@ impl ContractArgs { } #[inline(always)] #[allow(clippy::unused_unit)] + pub fn with_panic_error_ref<'i>(fail: &'i bool) -> (&'i bool,) { + (fail,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] pub fn with_assert_error<'i>(ok: &'i bool) -> (&'i bool,) { (ok,) } @@ -20742,6 +26045,13 @@ impl ContractArgs { } #[inline(always)] #[allow(clippy::unused_unit)] + pub fn with_vec_nested<'i>( + _v: &'i Vec, + ) -> (&'i Vec,) { + (_v,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] pub fn with_map<'i>(_m: &'i Map) -> (&'i Map,) { (_m,) } @@ -20757,6 +26067,11 @@ impl ContractArgs { } #[inline(always)] #[allow(clippy::unused_unit)] + pub fn with_recursion<'i>(_r: &'i UsedRecursiveRoot) -> (&'i UsedRecursiveRoot,) { + (_r,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] pub fn publish_simple<'i>() -> () { () } @@ -20818,6 +26133,55 @@ impl ContractArgs { } #[doc(hidden)] #[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__constructor` instead")] +#[allow(deprecated)] +pub fn __Contract____constructor__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::__constructor( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__constructor` instead")] +pub fn __Contract____constructor__invoke_raw_slice( + env: soroban_sdk::Env, + args: &[soroban_sdk::Val], +) -> soroban_sdk::Val { + if args.len() != 1usize { + { + ::core::panicking::panic_fmt(format_args!( + "invalid number of input arguments: {0} expected, got {1}", + 1usize, + args.len(), + )); + }; + } + #[allow(deprecated)] + __Contract____constructor__invoke_raw(env, args[0usize]) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__constructor` instead")] +pub extern "C" fn __Contract____constructor__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract____constructor__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] #[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_param` instead")] #[allow(deprecated)] pub fn __Contract__with_param__invoke_raw( @@ -20855,23 +26219,72 @@ pub fn __Contract__with_param__invoke_raw_slice( { ::core::panicking::panic_fmt(format_args!( "invalid number of input arguments: {0} expected, got {1}", - 2usize, + 2usize, + args.len(), + )); + }; + } + #[allow(deprecated)] + __Contract__with_param__invoke_raw(env, args[0usize], args[1usize]) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_param` instead")] +pub extern "C" fn __Contract__with_param__invoke_raw_extern( + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__with_param__invoke_raw(soroban_sdk::Env::default(), arg_0, arg_1) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_context` instead")] +#[allow(deprecated)] +pub fn __Contract__with_context__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::with_context( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_context` instead")] +pub fn __Contract__with_context__invoke_raw_slice( + env: soroban_sdk::Env, + args: &[soroban_sdk::Val], +) -> soroban_sdk::Val { + if args.len() != 1usize { + { + ::core::panicking::panic_fmt(format_args!( + "invalid number of input arguments: {0} expected, got {1}", + 1usize, args.len(), )); }; } #[allow(deprecated)] - __Contract__with_param__invoke_raw(env, args[0usize], args[1usize]) + __Contract__with_context__invoke_raw(env, args[0usize]) } #[doc(hidden)] #[allow(non_snake_case)] -#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_param` instead")] -pub extern "C" fn __Contract__with_param__invoke_raw_extern( +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_context` instead")] +pub extern "C" fn __Contract__with_context__invoke_raw_extern( arg_0: soroban_sdk::Val, - arg_1: soroban_sdk::Val, ) -> soroban_sdk::Val { #[allow(deprecated)] - __Contract__with_param__invoke_raw(soroban_sdk::Env::default(), arg_0, arg_1) + __Contract__with_context__invoke_raw(soroban_sdk::Env::default(), arg_0) } #[doc(hidden)] #[allow(non_snake_case)] @@ -20996,6 +26409,55 @@ pub extern "C" fn __Contract__with_panic_error__invoke_raw_extern( } #[doc(hidden)] #[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_panic_error_ref` instead")] +#[allow(deprecated)] +pub fn __Contract__with_panic_error_ref__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::with_panic_error_ref( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_panic_error_ref` instead")] +pub fn __Contract__with_panic_error_ref__invoke_raw_slice( + env: soroban_sdk::Env, + args: &[soroban_sdk::Val], +) -> soroban_sdk::Val { + if args.len() != 1usize { + { + ::core::panicking::panic_fmt(format_args!( + "invalid number of input arguments: {0} expected, got {1}", + 1usize, + args.len(), + )); + }; + } + #[allow(deprecated)] + __Contract__with_panic_error_ref__invoke_raw(env, args[0usize]) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_panic_error_ref` instead")] +pub extern "C" fn __Contract__with_panic_error_ref__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__with_panic_error_ref__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] #[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_assert_error` instead")] #[allow(deprecated)] pub fn __Contract__with_assert_error__invoke_raw( @@ -21143,6 +26605,55 @@ pub extern "C" fn __Contract__with_vec__invoke_raw_extern( } #[doc(hidden)] #[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_vec_nested` instead")] +#[allow(deprecated)] +pub fn __Contract__with_vec_nested__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::with_vec_nested( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_vec_nested` instead")] +pub fn __Contract__with_vec_nested__invoke_raw_slice( + env: soroban_sdk::Env, + args: &[soroban_sdk::Val], +) -> soroban_sdk::Val { + if args.len() != 1usize { + { + ::core::panicking::panic_fmt(format_args!( + "invalid number of input arguments: {0} expected, got {1}", + 1usize, + args.len(), + )); + }; + } + #[allow(deprecated)] + __Contract__with_vec_nested__invoke_raw(env, args[0usize]) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_vec_nested` instead")] +pub extern "C" fn __Contract__with_vec_nested__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__with_vec_nested__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] #[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_map` instead")] #[allow(deprecated)] pub fn __Contract__with_map__invoke_raw( @@ -21277,6 +26788,55 @@ pub extern "C" fn __Contract__with_result__invoke_raw_extern() -> soroban_sdk::V } #[doc(hidden)] #[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_recursion` instead")] +#[allow(deprecated)] +pub fn __Contract__with_recursion__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::with_recursion( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_recursion` instead")] +pub fn __Contract__with_recursion__invoke_raw_slice( + env: soroban_sdk::Env, + args: &[soroban_sdk::Val], +) -> soroban_sdk::Val { + if args.len() != 1usize { + { + ::core::panicking::panic_fmt(format_args!( + "invalid number of input arguments: {0} expected, got {1}", + 1usize, + args.len(), + )); + }; + } + #[allow(deprecated)] + __Contract__with_recursion__invoke_raw(env, args[0usize]) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_recursion` instead")] +pub extern "C" fn __Contract__with_recursion__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__with_recursion__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] #[deprecated(note = "use `ContractClient::new(&env, &contract_id).publish_simple` instead")] #[allow(deprecated)] pub fn __Contract__publish_simple__invoke_raw(env: soroban_sdk::Env) -> soroban_sdk::Val { @@ -21762,7 +27322,7 @@ pub extern "C" fn __Contract__publish_ref_event__invoke_raw_extern() -> soroban_ #[doc(hidden)] #[allow(non_snake_case)] #[allow(unused)] -fn __Contract____72b5aebeb1af1dc083347284f3fd5e8bb48509c944bf8958f42d24678cfcd7a7_ctor() { +fn __Contract____b0b775ab08c55b3c14d80f9e18224a59091ef93d6cb9cd08fd75b94a7ad289b8_ctor() { #[allow(unsafe_code)] { #[link_section = ".init_array"] @@ -21774,7 +27334,7 @@ fn __Contract____72b5aebeb1af1dc083347284f3fd5e8bb48509c944bf8958f42d24678cfcd7a #[allow(non_snake_case)] extern "C" fn f() -> ::ctor::__support::CtorRetType { unsafe { - __Contract____72b5aebeb1af1dc083347284f3fd5e8bb48509c944bf8958f42d24678cfcd7a7_ctor(); + __Contract____b0b775ab08c55b3c14d80f9e18224a59091ef93d6cb9cd08fd75b94a7ad289b8_ctor(); }; core::default::Default::default() } @@ -21782,11 +27342,21 @@ fn __Contract____72b5aebeb1af1dc083347284f3fd5e8bb48509c944bf8958f42d24678cfcd7a }; } { + ::register( + "__constructor", + #[allow(deprecated)] + &__Contract____constructor__invoke_raw_slice, + ); ::register( "with_param", #[allow(deprecated)] &__Contract__with_param__invoke_raw_slice, ); + ::register( + "with_context", + #[allow(deprecated)] + &__Contract__with_context__invoke_raw_slice, + ); ::register( "with_return", #[allow(deprecated)] @@ -21802,6 +27372,11 @@ fn __Contract____72b5aebeb1af1dc083347284f3fd5e8bb48509c944bf8958f42d24678cfcd7a #[allow(deprecated)] &__Contract__with_panic_error__invoke_raw_slice, ); + ::register( + "with_panic_error_ref", + #[allow(deprecated)] + &__Contract__with_panic_error_ref__invoke_raw_slice, + ); ::register( "with_assert_error", #[allow(deprecated)] @@ -21817,6 +27392,11 @@ fn __Contract____72b5aebeb1af1dc083347284f3fd5e8bb48509c944bf8958f42d24678cfcd7a #[allow(deprecated)] &__Contract__with_vec__invoke_raw_slice, ); + ::register( + "with_vec_nested", + #[allow(deprecated)] + &__Contract__with_vec_nested__invoke_raw_slice, + ); ::register( "with_map", #[allow(deprecated)] @@ -21832,6 +27412,11 @@ fn __Contract____72b5aebeb1af1dc083347284f3fd5e8bb48509c944bf8958f42d24678cfcd7a #[allow(deprecated)] &__Contract__with_result__invoke_raw_slice, ); + ::register( + "with_recursion", + #[allow(deprecated)] + &__Contract__with_recursion__invoke_raw_slice, + ); ::register( "publish_simple", #[allow(deprecated)] @@ -21894,16 +27479,166 @@ fn __Contract____72b5aebeb1af1dc083347284f3fd5e8bb48509c944bf8958f42d24678cfcd7a ); } } +impl CustomAccountInterface for Contract { + type Error = UsedAuthErrorEnum; + type Signature = CustomSignature; + fn __check_auth( + _env: Env, + _signature_payload: Hash<32>, + _signatures: Self::Signature, + _auth_contexts: Vec, + ) -> Result<(), UsedAuthErrorEnum> { + Ok(()) + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract____check_auth__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN___CHECK_AUTH: [u8; 192usize] = + super::Contract::spec_xdr___check_auth(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr___check_auth() -> [u8; 192usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0c__check_auth\0\0\0\x03\0\0\0\0\0\0\0\x11signature_payload\0\0\0\0\0\x03\xee\0\0\0 \0\0\0\0\0\0\0\nsignatures\0\0\0\0\x07\xd0\0\0\0\x0fCustomSignature\0\0\0\0\0\0\0\0\rauth_contexts\0\0\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x07Context\0\0\0\0\x01\0\0\x03\xe9\0\0\0\x02\0\0\x07\xd0\0\0\0\x11UsedAuthErrorEnum\0\0\0" + } +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT___CHECK_AUTH: [u8; 138usize] = + soroban_sdk::spec_shaking::encode_graph_record::<138usize, 3usize>( + 0, + *b"d0\x1d$\nPH\x95\xf0\xbc\xe3\xae\xb2\xd6QK\xe9\x92\xc4\xf3$S\xb9\xff\xd9\xafR4JZ\x9c\x83", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); +impl<'a> ContractClient<'a> {} +impl ContractArgs { + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn __check_auth<'i>( + _signature_payload: &'i Hash<32>, + _signatures: &'i CustomSignature, + _auth_contexts: &'i Vec, + ) -> ( + &'i Hash<32>, + &'i CustomSignature, + &'i Vec, + ) { + (_signature_payload, _signatures, _auth_contexts) + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__check_auth` instead")] +#[allow(deprecated)] +pub fn __Contract____check_auth__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, + arg_2: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::__check_auth( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_1), + ), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_2), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__check_auth` instead")] +pub fn __Contract____check_auth__invoke_raw_slice( + env: soroban_sdk::Env, + args: &[soroban_sdk::Val], +) -> soroban_sdk::Val { + if args.len() != 3usize { + { + ::core::panicking::panic_fmt(format_args!( + "invalid number of input arguments: {0} expected, got {1}", + 3usize, + args.len(), + )); + }; + } + #[allow(deprecated)] + __Contract____check_auth__invoke_raw(env, args[0usize], args[1usize], args[2usize]) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__check_auth` instead")] +pub extern "C" fn __Contract____check_auth__invoke_raw_extern( + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, + arg_2: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract____check_auth__invoke_raw(soroban_sdk::Env::default(), arg_0, arg_1, arg_2) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[allow(unused)] +fn __Contract__CustomAccountInterface__d465b6861ce11142d9f64c1622e1ad88ae003d910de0a8493889a96a23449736_ctor( +) { + #[allow(unsafe_code)] + { + #[link_section = ".init_array"] + #[used] + #[allow(non_upper_case_globals, non_snake_case)] + #[doc(hidden)] + static f: extern "C" fn() -> ::ctor::__support::CtorRetType = { + #[link_section = ".text.startup"] + #[allow(non_snake_case)] + extern "C" fn f() -> ::ctor::__support::CtorRetType { + unsafe { + __Contract__CustomAccountInterface__d465b6861ce11142d9f64c1622e1ad88ae003d910de0a8493889a96a23449736_ctor(); + }; + core::default::Default::default() + } + f + }; + } + { + ::register( + "__check_auth", + #[allow(deprecated)] + &__Contract____check_auth__invoke_raw_slice, + ); + } +} #[allow(dead_code)] fn non_contract_fn(_s: UnusedNonContractFnParam) -> UnusedNonContractFnReturn { UnusedNonContractFnReturn { x: 1 } } mod test { extern crate std; - use soroban_sdk::xdr::ScSpecEntry; + use soroban_sdk::xdr::{ScSpecEntry, ScSpecTypeDef}; use std::collections::HashSet; use std::vec::Vec; - const WASM: &[u8] = b"\x00asm\x01\x00\x00\x00\x01D\x0b`\x02~~\x01~`\x01~\x01~`\x03~~~\x01~`\x04~~~~\x01~`\x00\x01~`\x02\x7f\x7f\x01~`\x04\x7f\x7f\x7f\x7f\x01~`\x01~\x00`\x05~\x7f\x7f\x7f\x7f\x00`\x03\x7f\x7f\x7f\x00`\x01\x7f\x01~\x021\x08\x01x\x011\x00\x00\x01i\x012\x00\x01\x01v\x01h\x00\x02\x01v\x01g\x00\x00\x01b\x01j\x00\x00\x01x\x015\x00\x01\x01m\x019\x00\x02\x01m\x01a\x00\x03\x03\x1f\x1e\x04\x05\x00\x06\x04\x04\x04\x04\x04\x04\x01\x07\x04\x01\x08\x01\x01\x04\x01\x01\x01\x00\x04\x04\t\n\x01\x04\x01\x01\x05\x03\x01\x00\x11\x06!\x04\x7f\x01A\x80\x80\xc0\x00\x0b\x7f\x00A\xda\x85\xc0\x00\x0b\x7f\x00A\xfc\x85\xc0\x00\x0b\x7f\x00A\x80\x86\xc0\x00\x0b\x07\xa8\x03\x1a\x06memory\x02\x00\x11publish_data_type\x00\x08\x13publish_nested_data\x00\x0c\x14publish_nested_topic\x00\r\x11publish_ref_event\x00\x0f\x0epublish_simple\x00\x10\x12publish_topic_type\x00\x11\x11with_assert_error\x00\x12\nwith_error\x00\x14\x0fwith_lib_struct\x00\x15\x08with_map\x00\x17\x0cwith_non_pub\x00\x18\x12with_non_pub_error\x00\x19\x0bwith_option\x00\x1a\x10with_panic_error\x00\x1b\x14with_panic_raw_error\x00\x1c\nwith_param\x00\x1d\x0bwith_result\x00\x1e\x0bwith_return\x00\x1f\nwith_tuple\x00\"\x11with_tuple_return\x00#\x08with_vec\x00$\x12with_wasm_imported\x00%\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n\x88\x19\x1e\xae\x01\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A k\"\x00$\x80\x80\x80\x80\x00A\xa8\x84\xc0\x80\x00A\x06\x10\x89\x80\x80\x80\x00!\x01A\x00-\x00\xa8\x81\xc0\x80\x00\x1aA\x00-\x00\xc2\x82\xc0\x80\x00\x1aA\xf0\x84\xc0\x80\x00A\x19\x10\x89\x80\x80\x80\x00 \x01\x10\x8a\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80 7\x03\x18 \x00B\x84\x80\x80\x80\x107\x03\x10 \x00A\x80\x84\xc0\x80\x00A\x02 \x00A\x10jA\x02\x10\x8b\x80\x80\x80\x007\x03\x08 \x01A\xd4\x84\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x00\x10\x80\x80\x80\x80\x00\x1a \x00A j$\x80\x80\x80\x80\x00B\x02\x0bE\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x02$\x80\x80\x80\x80\x00 \x02 \x00 \x01\x10\xa0\x80\x80\x80\x00\x02@ \x02(\x02\x00A\x01G\r\x00\x00\x0b \x02)\x03\x08!\x03 \x02A\x10j$\x80\x80\x80\x80\x00 \x03\x0b\x92\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A k\"\x02$\x80\x80\x80\x80\x00 \x02 \x017\x03\x08 \x02 \x007\x03\x00A\x00!\x03\x03~\x02@ \x03A\x10G\r\x00A\x00!\x03\x02@\x03@ \x03A\x10F\r\x01 \x02A\x10j \x03j \x02 \x03j)\x03\x007\x03\x00 \x03A\x08j!\x03\x0c\x00\x0b\x0b \x02A\x10j\x10\xa1\x80\x80\x80\x00!\x01 \x02A j$\x80\x80\x80\x80\x00 \x01\x0f\x0b \x02A\x10j \x03jB\x027\x03\x00 \x03A\x08j!\x03\x0c\x00\x0b\x0b.\x00\x02@ \x01 \x03F\r\x00\x00\x0b \x00\xadB \x86B\x04\x84 \x02\xadB \x86B\x04\x84 \x01\xadB \x86B\x04\x84\x10\x86\x80\x80\x80\x00\x0b\xc5\x01\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\xc1\x83\xc0\x80\x00A\x06\x10\x89\x80\x80\x80\x00!\x01A\x00-\x00\xd2\x81\xc0\x80\x00\x1aA\x00-\x00\xe0\x81\xc0\x80\x00\x1aA\x00-\x00\xfa\x82\xc0\x80\x00\x1aA\xa3\x85\xc0\x80\x00A\x1b\x10\x89\x80\x80\x80\x00 \x01\x10\x8a\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80\xa0\x057\x03\x08 \x00A\xdc\x83\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x007\x03\x00 \x00A\x98\x84\xc0\x80\x00A\x01 \x00A\x01\x10\x8b\x80\x80\x80\x007\x03\x08 \x01A\xd4\x84\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x00\x10\x80\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\xbd\x01\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\x00-\x00\xa6\x82\xc0\x80\x00\x1aA\x00-\x00\xb4\x82\xc0\x80\x00\x1aA\x00-\x00\x88\x83\xc0\x80\x00\x1aA\xbe\x85\xc0\x80\x00A\x1c\x10\x89\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80\xa0\x057\x03\x08 \x00A\xdc\x83\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x007\x03\x00 \x01A\x98\x84\xc0\x80\x00A\x01 \x00A\x01\x10\x8b\x80\x80\x80\x00\x10\x8a\x80\x80\x80\x00!\x01 \x00\x10\x8e\x80\x80\x80\x007\x03\x08 \x01A\xb4\x84\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x00\x10\x80\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\x06\x00B\x8b\xc8\x01\x0b\xc3\x01\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\x00-\x00\x8c\x81\xc0\x80\x00\x1aA\x00-\x00\xfe\x80\xc0\x80\x00\x1aA\x00-\x00\xd4\x80\xc0\x80\x00\x1aA\x00-\x00\xb6\x81\xc0\x80\x00\x1aA\xdc\x84\xc0\x80\x00A\x14\x10\x89\x80\x80\x80\x00B\x84\x80\x80\x80\x10\x10\x8a\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80\xb0\x0c7\x03\x08 \x00A\xdc\x83\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x007\x03\x00 \x00A\xf4\x83\xc0\x80\x00A\x01 \x00A\x01\x10\x8b\x80\x80\x80\x007\x03\x08 \x01A\xd4\x84\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x00\x10\x80\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\x7f\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\xa0\x84\xc0\x80\x00A\x08\x10\x89\x80\x80\x80\x00!\x01A\x00-\x00\xaa\x80\xc0\x80\x00\x1aA\xbc\x84\xc0\x80\x00A\x11\x10\x89\x80\x80\x80\x00 \x01\x10\x8a\x80\x80\x80\x00!\x01 \x00\x10\x8e\x80\x80\x80\x007\x03\x08 \x01A\xb4\x84\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x00\x10\x80\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0b}\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\x00-\x00\xee\x81\xc0\x80\x00\x1aA\x00-\x00\xd0\x82\xc0\x80\x00\x1aA\x89\x85\xc0\x80\x00A\x1a\x10\x89\x80\x80\x80\x00B\x84\x80\x80\x80\x10\x10\x8a\x80\x80\x80\x00!\x01 \x00\x10\x8e\x80\x80\x80\x007\x03\x08 \x01A\xb4\x84\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x00\x10\x80\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0bJ\x01\x01\x7f\x02@\x02@A\x01A\x02A\x00 \x00\xa7A\xff\x01q\"\x01\x1b \x01A\x01F\x1b\"\x01A\x02F\r\x00 \x01A\x01qE\r\x01B\x02\x0f\x0b\x00\x0bA\x00-\x00\x98\x82\xc0\x80\x00\x1aB\x83\x80\x80\x80\x10\x10\x93\x80\x80\x80\x00\x00\x0b\x0b\x00 \x00\x10\x85\x80\x80\x80\x00\x1a\x0b\x13\x00A\x00-\x00\x80\x80\xc0\x80\x00\x1aB\x84\x80\x80\x80\xa0\x05\x0b\x8d\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00A\x00!\x02A\x00-\x00\xda\x85\xc0\x80\x00\x1a\x02@\x03@ \x02A\x10F\r\x01 \x01 \x02jB\x027\x03\x00 \x02A\x08j!\x02\x0c\x00\x0b\x0b\x02@\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\xec\x85\xc0\x80\x00A\x02 \x01A\x02\x10\x96\x80\x80\x80\x00 \x011\x00\x00B\xcb\x00R\r\x00 \x011\x00\x08B\xcd\x00Q\r\x01\x0b\x00\x0b \x01A\x10j$\x80\x80\x80\x80\x00B\x02\x0b1\x00\x02@ \x02 \x04F\r\x00\x00\x0b \x00 \x01\xadB \x86B\x04\x84 \x03\xadB \x86B\x04\x84 \x02\xadB \x86B\x04\x84\x10\x87\x80\x80\x80\x00\x1a\x0b(\x00A\x00-\x00\x96\x83\xc0\x80\x00\x1aA\x00-\x00\xa4\x83\xc0\x80\x00\x1a\x02@ \x00B\xff\x01\x83B\xcc\x00Q\r\x00\x00\x0bB\x02\x0bg\x01\x01\x7f#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00A\x00-\x00\xe2\x80\xc0\x80\x00\x1a \x01B\x027\x03\x08\x02@\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\xdc\x83\xc0\x80\x00A\x01 \x01A\x08jA\x01\x10\x96\x80\x80\x80\x00 \x011\x00\x08B\x04Q\r\x01\x0b\x00\x0b \x01A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\x12\x00A\x00-\x00\xb8\x80\xc0\x80\x00\x1aB\x84\x80\x80\x80\x10\x0br\x01\x01\x7f#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00A\x00-\x00\xc4\x81\xc0\x80\x00\x1a\x02@ \x00B\x02Q\r\x00 \x01B\x027\x03\x08\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\xe8\x83\xc0\x80\x00A\x01 \x01A\x08jA\x01\x10\x96\x80\x80\x80\x00 \x01)\x03\x08B\xff\x01\x83B\x04Q\r\x01\x0b\x00\x0b \x01A\x10j$\x80\x80\x80\x80\x00B\x02\x0bI\x01\x01\x7f\x02@\x02@A\x01A\x02A\x00 \x00\xa7A\xff\x01q\"\x01\x1b \x01A\x01F\x1b\"\x01A\x02F\r\x00 \x01A\x01q\r\x01B\x02\x0f\x0b\x00\x0bA\x00-\x00\x8a\x82\xc0\x80\x00\x1aB\x83\x80\x80\x80\x10\x10\x93\x80\x80\x80\x00\x00\x0b@\x01\x01\x7f\x02@\x02@A\x01A\x02A\x00 \x00\xa7A\xff\x01q\"\x01\x1b \x01A\x01F\x1b\"\x01A\x02F\r\x00 \x01A\x01q\r\x01B\x02\x0f\x0b\x00\x0bB\x83\x80\x80\x80\xf0\x00\x10\x93\x80\x80\x80\x00\x00\x0b\x8a\x02\x01\x02\x7f#\x80\x80\x80\x80\x00A k\"\x02$\x80\x80\x80\x80\x00A\x00!\x03A\x00-\x00\xfc\x81\xc0\x80\x00\x1aA\x00-\x00\xc6\x80\xc0\x80\x00\x1a\x02@\x03@ \x03A\x10F\r\x01 \x02A\x08j \x03jB\x027\x03\x00 \x03A\x08j!\x03\x0c\x00\x0b\x0b\x02@\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\xc8\x83\xc0\x80\x00A\x02 \x02A\x08jA\x02\x10\x96\x80\x80\x80\x00 \x021\x00\x08B\x04R\r\x00 \x02B\x027\x03\x18 \x02)\x03\x10\"\x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\xdc\x83\xc0\x80\x00A\x01 \x02A\x18jA\x01\x10\x96\x80\x80\x80\x00\x02@ \x02)\x03\x18\"\x00\xa7A\xff\x01q\"\x03A\x07F\r\x00 \x03A\xc1\x00G\r\x01 \x00\x10\x81\x80\x80\x80\x00\x1a\x0bA\x00-\x00\xf0\x80\xc0\x80\x00\x1a \x01B\xff\x01\x83B\x04R\r\x00 \x01B \x88\xa7A}jA}K\r\x01\x0b\x00\x0b \x02A j$\x80\x80\x80\x80\x00B\x02\x0bZ\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\x00-\x00\xb2\x83\xc0\x80\x00\x1aA\x00-\x00\x80\x80\xc0\x80\x00\x1a \x00B\x84\x80\x80\x80\x107\x03\x08A\xe8\x83\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x8b\x80\x80\x80\x00!\x01 \x00A\x10j$\x80\x80\x80\x80\x00 \x01\x0bo\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\x00-\x00\x8e\x80\xc0\x80\x00\x1a \x00A\xf0\x83\xc0\x80\x00A\x01\x10\xa0\x80\x80\x80\x00\x02@ \x00(\x02\x00A\x01G\r\x00\x00\x0b \x00)\x03\x08!\x01 \x00B\x84\x80\x80\x80\x107\x03\x08 \x00 \x017\x03\x00 \x00\x10\xa1\x80\x80\x80\x00!\x01 \x00A\x10j$\x80\x80\x80\x80\x00 \x01\x0b\xdb\x01\x02\x01~\x04\x7f\x02@\x02@ \x02A\tK\r\x00B\x00!\x03 \x02!\x04 \x01!\x05\x03@\x02@ \x04\r\x00 \x03B\x08\x86B\x0e\x84!\x03\x0c\x03\x0bA\x01!\x06\x02@ \x05-\x00\x00\"\x07A\xdf\x00F\r\x00\x02@\x02@ \x07APjA\xff\x01qA\nI\r\x00 \x07A\xbf\x7fjA\xff\x01qA\x1aI\r\x01 \x07A\x9f\x7fjA\xff\x01qA\x1aO\r\x04 \x07AEj!\x06\x0c\x02\x0b \x07ARj!\x06\x0c\x01\x0b \x07AKj!\x06\x0b \x03B\x06\x86 \x06\xadB\xff\x01\x83\x84!\x03 \x04A\x7fj!\x04 \x05A\x01j!\x05\x0c\x00\x0b\x0b \x01\xadB \x86B\x04\x84 \x02\xadB \x86B\x04\x84\x10\x84\x80\x80\x80\x00!\x03\x0b \x00B\x007\x03\x00 \x00 \x037\x03\x08\x0b\x17\x00 \x00\xadB \x86B\x04\x84B\x84\x80\x80\x80 \x10\x83\x80\x80\x80\x00\x0b\xc4\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A k\"\x01$\x80\x80\x80\x80\x00A\x00!\x02A\x00-\x00\x9a\x81\xc0\x80\x00\x1a\x02@\x02@ \x00B\xff\x01\x83B\xcb\x00R\r\x00\x02@\x03@ \x02A\x10F\r\x01 \x01A\x08j \x02jB\x027\x03\x00 \x02A\x08j!\x02\x0c\x00\x0b\x0b \x00 \x01A\x08j\xadB \x86B\x04\x84B\x84\x80\x80\x80 \x10\x82\x80\x80\x80\x00\x1a \x01B\x027\x03\x18 \x01)\x03\x08\"\x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\xdc\x83\xc0\x80\x00A\x01 \x01A\x18jA\x01\x10\x96\x80\x80\x80\x00 \x011\x00\x18B\x04R\r\x00 \x011\x00\x10B\x04Q\r\x01\x0b\x00\x0b \x01A j$\x80\x80\x80\x80\x00B\x02\x0bo\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A k\"\x00$\x80\x80\x80\x80\x00A\x00-\x00\xde\x82\xc0\x80\x00\x1a \x00B\x84\x80\x80\x80\x107\x03\x18A\xdc\x83\xc0\x80\x00A\x01 \x00A\x18jA\x01\x10\x8b\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80 7\x03\x10 \x00 \x017\x03\x08 \x00A\x08j\x10\xa1\x80\x80\x80\x00!\x01 \x00A j$\x80\x80\x80\x80\x00 \x01\x0b\x1e\x00A\x00-\x00\x9c\x80\xc0\x80\x00\x1a\x02@ \x00B\xff\x01\x83B\xcb\x00Q\r\x00\x00\x0bB\x02\x0b\x8d\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00A\x00!\x02A\x00-\x00\xec\x82\xc0\x80\x00\x1a\x02@\x03@ \x02A\x10F\r\x01 \x01 \x02jB\x027\x03\x00 \x02A\x08j!\x02\x0c\x00\x0b\x0b\x02@\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\xec\x85\xc0\x80\x00A\x02 \x01A\x02\x10\x96\x80\x80\x80\x00 \x011\x00\x00B\x04R\r\x00 \x01)\x03\x08B\xfe\x01\x83P\r\x01\x0b\x00\x0b \x01A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\x0b\x86\x06\x01\x00A\x80\x80\xc0\x00\x0b\xfc\x05SpEcV1Hh\xdc\xaaa\x8d\xf7\rSpEcV1\xe7\xcf\x9b1n\x15\x13\xfeSpEcV1\xe2\x01y\xc9\x9a\xf8\xedtSpEcV1v1\x0eP\xa9C\xc7*SpEcV1\xa9<\xd8+\xb7\xa7\r\x17SpEcV1X\x03\xf6t\xc7\xd0\x01\"SpEcV1\'\xbd_A\r\x9a\x89\x02SpEcV1p\x8c\x0fN!\x082\xd8SpEcV1\xc2\xf4N\xbf\xebqvpSpEcV1K\xdf\'8m/\xe8\x1dSpEcV1@\xb9LO\xf9\xd1\xe8\xe2SpEcV1\xde\x1dMa\x01\xec\xb0ASpEcV1\xc2 \x1b\xdc\xc8gxZSpEcV1[Q+\xe9\xde\xd5\xf2>SpEcV1\xb3/\x97\xd5\x06\xbd3BSpEcV1\x0c\xf0\xf6w\xfd\x1a\x1b\x94SpEcV1\'\xf2\xa2\xb9\xd0)\xc0uSpEcV1\xf5\xd4\x9b\xa3\xccI\x13\xf7SpEcV1\x84\x08Y\xae\xa0\xf128SpEcV1\r\xb76\xae\x93D\xef\x1aSpEcV1\x8b\x89\x1f#\xbd\x157\xf4SpEcV16\x83?\xf0\xcdW\xb1/SpEcV1\x94\xc7w/_\xebXcSpEcV1q\xa3z;6\xa6R\x01SpEcV1q^\xe2&\x9di\x9d\x0eSpEcV1Y\xa66\xb3\xecxE\x13SpEcV1\xb6\x1c\xfd\xdfhY-dSpEcV1 \xfbl\x04B\x82\xc0\xb4SpEcV1\xe3\xf2\x9b5%a\xfb\xd6SpEcV1[\xf4R\xdf\xdd\xb4\xb0\xbcSpEcV1\xaaX8\xde\xef\xbb6%SpEcV1k\xe4zxB\xd1+\x02anested\x00\xc0\x01\x10\x00\x01\x00\x00\x00\xc1\x01\x10\x00\x06\x00\x00\x00val\x00\xd8\x01\x10\x00\x03\x00\x00\x00data\xe4\x01\x10\x00\x04\x00\x00\x00A\x00\x00\x00\xc1\x01\x10\x00\x06\x00\x00\x00xy\x00\x00\xfc\x01\x10\x00\x01\x00\x00\x00\xfd\x01\x10\x00\x01\x00\x00\x00inner\x00\x00\x00\x10\x02\x10\x00\x05\x00\x00\x00transfercoordsamount.\x02\x10\x00\x06\x00\x00\x00used_event_simplepayloadM\x02\x10\x00\x07\x00\x00\x00used_event_with_refsused_event_with_data_typeused_event_with_topic_typeused_event_with_nested_dataused_event_with_nested_topicSpEcV1\xa3\x16\n\x8f\xc9\x92\xd2\x11f1f2\xe8\x02\x10\x00\x02\x00\x00\x00\xea\x02\x10\x00\x02\x00\x00\x00\x00\xf78\x0econtractspecv0\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumA\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumB\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x02\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumC\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x07StructA\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0cStructTupleA\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorA\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorB\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorC\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00d\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00e\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00f\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventA\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_a\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventB\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_b\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f3\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventC\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_c\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02f3\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructA\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructB\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructC\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x03\xea\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x13\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntA\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntB\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntC\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00d\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\xc8\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x01,\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleA\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleB\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleC\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08with_map\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01m\x00\x00\x00\x00\x00\x03\xec\x00\x00\x07\xd0\x00\x00\x00\nUsedMapKey\x00\x00\x00\x00\x07\xd0\x00\x00\x00\nUsedMapVal\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08with_vec\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01v\x00\x00\x00\x00\x00\x03\xea\x00\x00\x07\xd0\x00\x00\x00\x0eUsedVecElement\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nUnusedEnum\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01A\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01B\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nUsedMapKey\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02K1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02K2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nUsedMapVal\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01v\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nwith_error\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x03\xe9\x00\x00\x00\x04\x00\x00\x07\xd0\x00\x00\x00\rUsedErrorEnum\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nwith_param\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01s\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x0fUsedParamStruct\x00\x00\x00\x00\x00\x00\x00\x00\x02ie\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x10UsedParamIntEnum\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nwith_tuple\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01t\x00\x00\x00\x00\x00\x03\xed\x00\x00\x00\x02\x00\x00\x07\xd0\x00\x00\x00\x10UsedTupleElement\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bUnusedEvent\x00\x00\x00\x00\x01\x00\x00\x00\x0cunused_event\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04data\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cUnusedStruct\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01x\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cUsedResultOk\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04data\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bwith_option\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01o\x00\x00\x00\x00\x00\x03\xe8\x00\x00\x07\xd0\x00\x00\x00\x11UsedOptionElement\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bwith_result\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x03\xe9\x00\x00\x07\xd0\x00\x00\x00\x0cUsedResultOk\x00\x00\x07\xd0\x00\x00\x00\rUsedErrorEnum\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bwith_return\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0eUsedReturnEnum\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\rUnusedIntEnum\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02U1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02U2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\rUsedErrorEnum\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x08NotFound\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07Invalid\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cwith_non_pub\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01s\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x10UsedNonPubStruct\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0eUnusedPubError\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Nope\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0eUsedReturnEnum\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01A\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01B\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0eUsedVecElement\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04data\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fUsedNonPubError\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Fail\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fUsedParamStruct\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01a\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x06nested\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12UsedNestedInStruct\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fUsedRefDataType\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x06nested\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x10UsedRefDataInner\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0epublish_simple\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fUsedEventSimple\x00\x00\x00\x00\x01\x00\x00\x00\x11used_event_simple\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x06amount\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10UsedNonPubStruct\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10UsedParamIntEnum\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01X\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01Y\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10UsedRefDataInner\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10UsedRefTopicType\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04Send\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Recv\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10UsedTupleElement\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fwith_lib_struct\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01s\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x07StructC\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UnusedNonPubError\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03Bad\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedEventDataType\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01x\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x01y\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedOptionElement\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04data\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10with_panic_error\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04fail\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedEventWithRefs\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x14used_event_with_refs\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x07\xd0\x00\x00\x00\x10UsedRefTopicType\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07payload\x00\x00\x00\x07\xd0\x00\x00\x00\x0fUsedRefDataType\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UnusedNonPubStruct\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01x\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedEventDataInner\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedEventDataOuter\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05inner\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12UsedEventDataInner\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedEventTopicType\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x08Transfer\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Mint\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedNestedInStruct\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x07\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedPanicErrorEnum\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Boom\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11publish_data_type\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11publish_ref_event\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11with_assert_error\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02ok\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11with_tuple_return\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x03\xed\x00\x00\x00\x02\x00\x00\x07\xd0\x00\x00\x00\x16UsedTupleReturnElement\x00\x00\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13UsedAssertErrorEnum\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03Bad\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13UsedEventTopicInner\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13UsedEventTopicOuter\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05inner\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x13UsedEventTopicInner\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12publish_topic_type\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12with_non_pub_error\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x03\xe9\x00\x00\x00\x04\x00\x00\x07\xd0\x00\x00\x00\x0fUsedNonPubError\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12with_wasm_imported\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01s\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x07StructA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13publish_nested_data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14publish_nested_topic\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14with_panic_raw_error\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04fail\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x15UsedEventWithDataType\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x19used_event_with_data_type\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07payload\x00\x00\x00\x07\xd0\x00\x00\x00\x11UsedEventDataType\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16UsedTupleReturnElement\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16UsedEventWithTopicType\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1aused_event_with_topic_type\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x07\xd0\x00\x00\x00\x12UsedEventTopicType\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x06amount\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17UsedEventWithNestedData\x00\x00\x00\x00\x01\x00\x00\x00\x1bused_event_with_nested_data\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07payload\x00\x00\x00\x07\xd0\x00\x00\x00\x12UsedEventDataOuter\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18UnusedNonContractFnParam\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01x\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18UsedEventWithNestedTopic\x00\x00\x00\x01\x00\x00\x00\x1cused_event_with_nested_topic\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04info\x00\x00\x07\xd0\x00\x00\x00\x13UsedEventTopicOuter\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x06amount\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19UnusedNonContractFnReturn\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01x\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumA\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumB\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x02\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumC\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x07StructA\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0cStructTupleA\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorA\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorB\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorC\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00d\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00e\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00f\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventA\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_a\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventB\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_b\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f3\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventC\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_c\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02f3\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructA\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructB\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructC\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x03\xea\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x13\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntA\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntB\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntC\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00d\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\xc8\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x01,\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleA\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleB\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleC\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\x0b\x00\x1e\x11contractenvmetav0\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x00\x00O\x0econtractmetav0\x00\x00\x00\x00\x00\x00\x00\x05rsver\x00\x00\x00\x00\x00\x00\x061.91.0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12rssdk_spec_shaking\x00\x00\x00\x00\x00\x012\x00\x00\x00"; + const WASM: &[u8] = b"\x00asm\x01\x00\x00\x00\x01R\x0e`\x01~\x01~`\x02~~\x01~`\x03~~~\x01~`\x04~~~~\x01~`\x05~\x7f\x7f\x7f\x7f\x00`\x00\x01~`\x02\x7f\x7f\x01~`\x04\x7f\x7f\x7f\x7f\x01~`\x01~\x00`\x02\x7f\x7f\x00`\x02\x7f\x7f\x01\x7f`\x03\x7f\x7f\x7f\x00`\x01\x7f\x01~`\x00\x00\x02I\x0c\x01b\x018\x00\x00\x01x\x011\x00\x01\x01i\x012\x00\x00\x01v\x013\x00\x00\x01b\x01m\x00\x02\x01v\x01h\x00\x02\x01v\x01g\x00\x01\x01b\x01j\x00\x01\x01v\x011\x00\x01\x01x\x015\x00\x00\x01m\x019\x00\x02\x01m\x01a\x00\x03\x03&%\x02\x04\x00\x05\x06\x01\x07\x05\x05\x05\x05\x05\x05\x00\x08\x05\x00\x00\x05\x00\x00\x00\x00\x01\x00\t\n\x05\x05\x0b\x0c\x00\x05\x00\x00\r\r\x04\x05\x01p\x01\x01\x01\x05\x03\x01\x00\x11\x06!\x04\x7f\x01A\x80\x80\xc0\x00\x0b\x7f\x00A\xd2\x83\xc0\x00\x0b\x7f\x00A\xe8\x83\xc0\x00\x0b\x7f\x00A\xf0\x83\xc0\x00\x0b\x07\x90\x04 \x06memory\x02\x00\x0c__check_auth\x00\x0c\r__constructor\x00\x0e\x11publish_data_type\x00\x0f\x13publish_nested_data\x00\x13\x14publish_nested_topic\x00\x14\x11publish_ref_event\x00\x16\x0epublish_simple\x00\x17\x12publish_topic_type\x00\x18\x11with_assert_error\x00\x19\nwith_error\x00\x1b\x0fwith_lib_struct\x00\x1c\x08with_map\x00\x1d\x12with_non_pub_error\x00\x1e\x0bwith_option\x00\x1f\x10with_panic_error\x00 \x14with_panic_error_ref\x00!\x14with_panic_raw_error\x00\"\nwith_param\x00#\x0ewith_recursion\x00$\x0bwith_result\x00\'\x0bwith_return\x00(\nwith_tuple\x00+\x11with_tuple_return\x00,\x08with_vec\x00-\x12with_wasm_imported\x00.\x01_\x03\x01\x0fwith_vec_nested\x00-\x0cwith_context\x00\x0e\x0cwith_non_pub\x00\x0e\n__data_end\x03\x02\x0b__heap_base\x03\x03\n\xb3\x1d%\x8c\x01\x01\x01\x7f#\x80\x80\x80\x80\x00A\x10k\"\x03$\x80\x80\x80\x80\x00\x02@ \x00B\xff\x01\x83B\xc8\x00R\r\x00 \x00\x10\x80\x80\x80\x80\x00B\x80\x80\x80\x80p\x83B\x80\x80\x80\x80\x80\x04R\r\x00 \x03B\x027\x03\x08 \x01B\xff\x01\x83B\xcc\x00R\r\x00 \x01A\x94\x81\xc0\x80\x00A\x01 \x03A\x08jA\x01\x10\x8d\x80\x80\x80\x00 \x031\x00\x08B\x04R\r\x00 \x02B\xff\x01\x83B\xcb\x00R\r\x00 \x03A\x10j$\x80\x80\x80\x80\x00B\x02\x0f\x0b\x00\x0b1\x00\x02@ \x02 \x04F\r\x00\x00\x0b \x00 \x01\xadB \x86B\x04\x84 \x03\xadB \x86B\x04\x84 \x02\xadB \x86B\x04\x84\x10\x8b\x80\x80\x80\x00\x1a\x0b]\x01\x01\x7f#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00 \x01B\x027\x03\x08\x02@\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\x84\x81\xc0\x80\x00A\x01 \x01A\x08jA\x01\x10\x8d\x80\x80\x80\x00 \x011\x00\x08B\x04Q\r\x01\x0b\x00\x0b \x01A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\xa4\x01\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A k\"\x00$\x80\x80\x80\x80\x00A\xa0\x82\xc0\x80\x00A\x06\x10\x90\x80\x80\x80\x00!\x01A\x00-\x00\xc6\x80\xc0\x80\x00\x1aA\xe8\x82\xc0\x80\x00A\x19\x10\x90\x80\x80\x80\x00 \x01\x10\x91\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80 7\x03\x18 \x00B\x84\x80\x80\x80\x107\x03\x10 \x00A\xf8\x81\xc0\x80\x00A\x02 \x00A\x10jA\x02\x10\x92\x80\x80\x80\x007\x03\x08 \x01A\xcc\x82\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x00\x10\x81\x80\x80\x80\x00\x1a \x00A j$\x80\x80\x80\x80\x00B\x02\x0bE\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x02$\x80\x80\x80\x80\x00 \x02 \x00 \x01\x10\xa9\x80\x80\x80\x00\x02@ \x02(\x02\x00A\x01G\r\x00\x00\x0b \x02)\x03\x08!\x03 \x02A\x10j$\x80\x80\x80\x80\x00 \x03\x0b\x92\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A k\"\x02$\x80\x80\x80\x80\x00 \x02 \x017\x03\x08 \x02 \x007\x03\x00A\x00!\x03\x03~\x02@ \x03A\x10G\r\x00A\x00!\x03\x02@\x03@ \x03A\x10F\r\x01 \x02A\x10j \x03j \x02 \x03j)\x03\x007\x03\x00 \x03A\x08j!\x03\x0c\x00\x0b\x0b \x02A\x10j\x10\xaa\x80\x80\x80\x00!\x01 \x02A j$\x80\x80\x80\x80\x00 \x01\x0f\x0b \x02A\x10j \x03jB\x027\x03\x00 \x03A\x08j!\x03\x0c\x00\x0b\x0b.\x00\x02@ \x01 \x03F\r\x00\x00\x0b \x00\xadB \x86B\x04\x84 \x02\xadB \x86B\x04\x84 \x01\xadB \x86B\x04\x84\x10\x8a\x80\x80\x80\x00\x0b\xb1\x01\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\x9d\x81\xc0\x80\x00A\x06\x10\x90\x80\x80\x80\x00!\x01A\x00-\x00\xe2\x80\xc0\x80\x00\x1aA\x9b\x83\xc0\x80\x00A\x1b\x10\x90\x80\x80\x80\x00 \x01\x10\x91\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80\xa0\x057\x03\x08 \x00A\x84\x81\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x007\x03\x00 \x00A\x90\x82\xc0\x80\x00A\x01 \x00A\x01\x10\x92\x80\x80\x80\x007\x03\x08 \x01A\xcc\x82\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x00\x10\x81\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\xa9\x01\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\x00-\x00\xf0\x80\xc0\x80\x00\x1aA\xb6\x83\xc0\x80\x00A\x1c\x10\x90\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80\xa0\x057\x03\x08 \x00A\x84\x81\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x007\x03\x00 \x01A\x90\x82\xc0\x80\x00A\x01 \x00A\x01\x10\x92\x80\x80\x80\x00\x10\x91\x80\x80\x80\x00!\x01 \x00\x10\x95\x80\x80\x80\x007\x03\x08 \x01A\xac\x82\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x00\x10\x81\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\x06\x00B\x8b\xc8\x01\x0b\xa5\x01\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\x00-\x00\xb8\x80\xc0\x80\x00\x1aA\xd4\x82\xc0\x80\x00A\x14\x10\x90\x80\x80\x80\x00B\x84\x80\x80\x80\x10\x10\x91\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80\xb0\x0c7\x03\x08 \x00A\x84\x81\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x007\x03\x00 \x00A\xec\x81\xc0\x80\x00A\x01 \x00A\x01\x10\x92\x80\x80\x80\x007\x03\x08 \x01A\xcc\x82\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x00\x10\x81\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\x7f\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\x98\x82\xc0\x80\x00A\x08\x10\x90\x80\x80\x80\x00!\x01A\x00-\x00\xaa\x80\xc0\x80\x00\x1aA\xb4\x82\xc0\x80\x00A\x11\x10\x90\x80\x80\x80\x00 \x01\x10\x91\x80\x80\x80\x00!\x01 \x00\x10\x95\x80\x80\x80\x007\x03\x08 \x01A\xac\x82\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x00\x10\x81\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0bs\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00A\x00-\x00\xd4\x80\xc0\x80\x00\x1aA\x81\x83\xc0\x80\x00A\x1a\x10\x90\x80\x80\x80\x00B\x84\x80\x80\x80\x10\x10\x91\x80\x80\x80\x00!\x01 \x00\x10\x95\x80\x80\x80\x007\x03\x08 \x01A\xac\x82\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x00\x10\x81\x80\x80\x80\x00\x1a \x00A\x10j$\x80\x80\x80\x80\x00B\x02\x0bJ\x01\x01\x7f\x02@\x02@A\x01A\x02A\x00 \x00\xa7A\xff\x01q\"\x01\x1b \x01A\x01F\x1b\"\x01A\x02F\r\x00 \x01A\x01qE\r\x01B\x02\x0f\x0b\x00\x0bA\x00-\x00\x8e\x80\xc0\x80\x00\x1aB\x83\x80\x80\x80\x10\x10\x9a\x80\x80\x80\x00\x00\x0b\x0b\x00 \x00\x10\x89\x80\x80\x80\x00\x1a\x0b\t\x00B\x84\x80\x80\x80\xa0\x05\x0b\x83\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00A\x00!\x02\x02@\x03@ \x02A\x10F\r\x01 \x01 \x02jB\x027\x03\x00 \x02A\x08j!\x02\x0c\x00\x0b\x0b\x02@\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\xd8\x83\xc0\x80\x00A\x02 \x01A\x02\x10\x8d\x80\x80\x80\x00 \x011\x00\x00B\xcb\x00R\r\x00 \x011\x00\x08B\xcd\x00Q\r\x01\x0b\x00\x0b \x01A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\x14\x00\x02@ \x00B\xff\x01\x83B\xcc\x00Q\r\x00\x00\x0bB\x02\x0b\x08\x00B\x84\x80\x80\x80\x10\x0bh\x01\x01\x7f#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00\x02@ \x00B\x02Q\r\x00 \x01B\x027\x03\x08\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\xb8\x81\xc0\x80\x00A\x01 \x01A\x08jA\x01\x10\x8d\x80\x80\x80\x00 \x01)\x03\x08B\xff\x01\x83B\x04Q\r\x01\x0b\x00\x0b \x01A\x10j$\x80\x80\x80\x80\x00B\x02\x0bI\x01\x01\x7f\x02@\x02@A\x01A\x02A\x00 \x00\xa7A\xff\x01q\"\x01\x1b \x01A\x01F\x1b\"\x01A\x02F\r\x00 \x01A\x01q\r\x01B\x02\x0f\x0b\x00\x0bA\x00-\x00\x80\x80\xc0\x80\x00\x1aB\x83\x80\x80\x80\x10\x10\x9a\x80\x80\x80\x00\x00\x0bI\x01\x01\x7f\x02@\x02@A\x01A\x02A\x00 \x00\xa7A\xff\x01q\"\x01\x1b \x01A\x01F\x1b\"\x01A\x02F\r\x00 \x01A\x01q\r\x01B\x02\x0f\x0b\x00\x0bA\x00-\x00\x9c\x80\xc0\x80\x00\x1aB\x83\x80\x80\x80\x10\x10\x9a\x80\x80\x80\x00\x00\x0b@\x01\x01\x7f\x02@\x02@A\x01A\x02A\x00 \x00\xa7A\xff\x01q\"\x01\x1b \x01A\x01F\x1b\"\x01A\x02F\r\x00 \x01A\x01q\r\x01B\x02\x0f\x0b\x00\x0bB\x83\x80\x80\x80\xf0\x00\x10\x9a\x80\x80\x80\x00\x00\x0b\xec\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A k\"\x02$\x80\x80\x80\x80\x00A\x00!\x03\x02@\x03@ \x03A\x10F\r\x01 \x02A\x08j \x03jB\x027\x03\x00 \x03A\x08j!\x03\x0c\x00\x0b\x0b\x02@\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\xa4\x81\xc0\x80\x00A\x02 \x02A\x08jA\x02\x10\x8d\x80\x80\x80\x00 \x021\x00\x08B\x04R\r\x00 \x02B\x027\x03\x18 \x02)\x03\x10\"\x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\x84\x81\xc0\x80\x00A\x01 \x02A\x18jA\x01\x10\x8d\x80\x80\x80\x00\x02@ \x02)\x03\x18\"\x00\xa7A\xff\x01q\"\x03A\x07F\r\x00 \x03A\xc1\x00G\r\x01 \x00\x10\x82\x80\x80\x80\x00\x1a\x0b \x01B\xff\x01\x83B\x04R\r\x00 \x01B \x88\xa7A}jA}K\r\x01\x0b\x00\x0b \x02A j$\x80\x80\x80\x80\x00B\x02\x0b\xe2\x03\x03\x01\x7f\x01~\x01\x7f#\x80\x80\x80\x80\x00A0k\"\x01$\x80\x80\x80\x80\x00 \x01B\x027\x03\x08\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\x84\x81\xc0\x80\x00A\x01 \x01A\x08jA\x01\x10\x8d\x80\x80\x80\x00 \x01)\x03\x08\"\x00B\xff\x01\x83B\xcb\x00R\r\x00 \x00\x10\x83\x80\x80\x80\x00!\x02 \x01A\x006\x02\x18 \x01 \x007\x03\x10 \x01 \x02B \x88>\x02\x1c \x01A j \x01A\x10j\x10\xa5\x80\x80\x80\x00 \x01)\x03 \"\x00B\x02Q\r\x00 \x00\xa7A\x01q\r\x00\x02@ \x01)\x03(\"\x00\xa7A\xff\x01q\"\x03A\xca\x00F\r\x00 \x03A\x0eG\r\x01\x0b\x02@\x02@\x02@ \x00A\xd8\x81\xc0\x80\x00\xadB \x86B\x04\x84B\x84\x80\x80\x80 \x10\x84\x80\x80\x80\x00B \x88\xa7\x0e\x02\x01\x00\x03\x0b \x01(\x02\x18 \x01(\x02\x1c\x10\xa6\x80\x80\x80\x00A\x01K\r\x02 \x01A j \x01A\x10j\x10\xa5\x80\x80\x80\x00 \x01)\x03 \"\x00B\x02Q\r\x02 \x00\xa7A\x01q\r\x02 \x01)\x03(!\x00 \x01B\x027\x03 \x00B\xff\x01\x83B\xcc\x00R\r\x02 \x00A\x84\x81\xc0\x80\x00A\x01 \x01A jA\x01\x10\x8d\x80\x80\x80\x00 \x011\x00 B\xcb\x00Q\r\x01\x0c\x02\x0b \x01(\x02\x18 \x01(\x02\x1c\x10\xa6\x80\x80\x80\x00A\x01K\r\x01 \x01A j \x01A\x10j\x10\xa5\x80\x80\x80\x00 \x01)\x03 \"\x00B\x02Q\r\x01 \x00\xa7A\x01q\r\x01 \x01)\x03(!\x00 \x01B\x027\x03 \x00B\xff\x01\x83B\xcc\x00R\r\x01 \x00A\x84\x81\xc0\x80\x00A\x01 \x01A jA\x01\x10\x8d\x80\x80\x80\x00 \x011\x00 B\x04R\r\x01\x0b \x01A0j$\x80\x80\x80\x80\x00B\x02\x0f\x0b\x00\x0bJ\x02\x01~\x01\x7fB\x02!\x02\x02@ \x01(\x02\x08\"\x03 \x01(\x02\x0cO\r\x00 \x00 \x01)\x03\x00 \x03\xadB \x86B\x04\x84\x10\x88\x80\x80\x80\x007\x03\x08 \x01 \x03A\x01j6\x02\x08B\x00!\x02\x0b \x00 \x027\x03\x00\x0b\x19\x00\x02@ \x01 \x00I\r\x00 \x01 \x00k\x0f\x0b\x10\xb0\x80\x80\x80\x00\x00\x0bF\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00 \x00B\x84\x80\x80\x80\x107\x03\x08A\xb8\x81\xc0\x80\x00A\x01 \x00A\x08jA\x01\x10\x92\x80\x80\x80\x00!\x01 \x00A\x10j$\x80\x80\x80\x80\x00 \x01\x0be\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x00$\x80\x80\x80\x80\x00 \x00A\xe8\x81\xc0\x80\x00A\x01\x10\xa9\x80\x80\x80\x00\x02@ \x00(\x02\x00A\x01G\r\x00\x00\x0b \x00)\x03\x08!\x01 \x00B\x84\x80\x80\x80\x107\x03\x08 \x00 \x017\x03\x00 \x00\x10\xaa\x80\x80\x80\x00!\x01 \x00A\x10j$\x80\x80\x80\x80\x00 \x01\x0b\xdb\x01\x02\x01~\x04\x7f\x02@\x02@ \x02A\tK\r\x00B\x00!\x03 \x02!\x04 \x01!\x05\x03@\x02@ \x04\r\x00 \x03B\x08\x86B\x0e\x84!\x03\x0c\x03\x0bA\x01!\x06\x02@ \x05-\x00\x00\"\x07A\xdf\x00F\r\x00\x02@\x02@ \x07APjA\xff\x01qA\nI\r\x00 \x07A\xbf\x7fjA\xff\x01qA\x1aI\r\x01 \x07A\x9f\x7fjA\xff\x01qA\x1aO\r\x04 \x07AEj!\x06\x0c\x02\x0b \x07ARj!\x06\x0c\x01\x0b \x07AKj!\x06\x0b \x03B\x06\x86 \x06\xadB\xff\x01\x83\x84!\x03 \x04A\x7fj!\x04 \x05A\x01j!\x05\x0c\x00\x0b\x0b \x01\xadB \x86B\x04\x84 \x02\xadB \x86B\x04\x84\x10\x87\x80\x80\x80\x00!\x03\x0b \x00B\x007\x03\x00 \x00 \x037\x03\x08\x0b\x17\x00 \x00\xadB \x86B\x04\x84B\x84\x80\x80\x80 \x10\x86\x80\x80\x80\x00\x0b\xba\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A k\"\x01$\x80\x80\x80\x80\x00\x02@\x02@ \x00B\xff\x01\x83B\xcb\x00R\r\x00A\x00!\x02\x02@\x03@ \x02A\x10F\r\x01 \x01A\x08j \x02jB\x027\x03\x00 \x02A\x08j!\x02\x0c\x00\x0b\x0b \x00 \x01A\x08j\xadB \x86B\x04\x84B\x84\x80\x80\x80 \x10\x85\x80\x80\x80\x00\x1a \x01B\x027\x03\x18 \x01)\x03\x08\"\x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\x84\x81\xc0\x80\x00A\x01 \x01A\x18jA\x01\x10\x8d\x80\x80\x80\x00 \x011\x00\x18B\x04R\r\x00 \x011\x00\x10B\x04Q\r\x01\x0b\x00\x0b \x01A j$\x80\x80\x80\x80\x00B\x02\x0be\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A k\"\x00$\x80\x80\x80\x80\x00 \x00B\x84\x80\x80\x80\x107\x03\x18A\x84\x81\xc0\x80\x00A\x01 \x00A\x18jA\x01\x10\x92\x80\x80\x80\x00!\x01 \x00B\x84\x80\x80\x80 7\x03\x10 \x00 \x017\x03\x08 \x00A\x08j\x10\xaa\x80\x80\x80\x00!\x01 \x00A j$\x80\x80\x80\x80\x00 \x01\x0b\x14\x00\x02@ \x00B\xff\x01\x83B\xcb\x00Q\r\x00\x00\x0bB\x02\x0b\x83\x01\x01\x02\x7f#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00A\x00!\x02\x02@\x03@ \x02A\x10F\r\x01 \x01 \x02jB\x027\x03\x00 \x02A\x08j!\x02\x0c\x00\x0b\x0b\x02@\x02@ \x00B\xff\x01\x83B\xcc\x00R\r\x00 \x00A\xd8\x83\xc0\x80\x00A\x02 \x01A\x02\x10\x8d\x80\x80\x80\x00 \x011\x00\x00B\x04R\r\x00 \x01)\x03\x08B\xfe\x01\x83P\r\x01\x0b\x00\x0b \x01A\x10j$\x80\x80\x80\x80\x00B\x02\x0b\x03\x00\x00\x0b\t\x00\x10\xaf\x80\x80\x80\x00\x00\x0b\x0b\xf2\x03\x01\x00A\x80\x80\xc0\x00\x0b\xe8\x03SpEcV1\r\xb76\xae\x93D\xef\x1aSpEcV1\x8b\x89\x1f#\xbd\x157\xf4SpEcV1!v\x9b\xbb<\xd2\x9f\xc9SpEcV1v1\x0eP\xa9C\xc7*SpEcV1[Q+\xe9\xde\xd5\xf2>SpEcV1q\xa3z;6\xa6R\x01SpEcV1q^\xe2&\x9di\x9d\x0eSpEcV1 \xfbl\x04B\x82\xc0\xb4SpEcV1\xe3\xf2\x9b5%a\xfb\xd6val\x00\x00\x00~\x00\x10\x00\x03\x00\x00\x00nonce\x00\x00\x00\x8c\x00\x10\x00\x05\x00\x00\x00anested\x00\x9c\x00\x10\x00\x01\x00\x00\x00\x9d\x00\x10\x00\x06\x00\x00\x00data\xb4\x00\x10\x00\x04\x00\x00\x00NotRecursiveRecursive\x00\x00\x00\xc0\x00\x10\x00\x0c\x00\x00\x00\xcc\x00\x10\x00\t\x00\x00\x00A\x00\x00\x00\x9d\x00\x10\x00\x06\x00\x00\x00xy\x00\x00\xf4\x00\x10\x00\x01\x00\x00\x00\xf5\x00\x10\x00\x01\x00\x00\x00inner\x00\x00\x00\x08\x01\x10\x00\x05\x00\x00\x00transfercoordsamount&\x01\x10\x00\x06\x00\x00\x00used_event_simplepayloadE\x01\x10\x00\x07\x00\x00\x00used_event_with_refsused_event_with_data_typeused_event_with_topic_typeused_event_with_nested_dataused_event_with_nested_topicf1f2\x00\x00\xd2\x01\x10\x00\x02\x00\x00\x00\xd4\x01\x10\x00\x02\x00\x00\x00\x00\xbfY\x0econtractspecv0\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumA\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumB\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x02\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumC\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x07StructA\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0cStructTupleA\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorA\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorB\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorC\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00d\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00e\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00f\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventA\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_a\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventB\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_b\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f3\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventC\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_c\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02f3\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructA\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructB\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructC\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x03\xea\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x13\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntA\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntB\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntC\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00d\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\xc8\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x01,\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleA\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleB\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleC\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07Context\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08UsedLeaf\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08with_map\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01m\x00\x00\x00\x00\x00\x03\xec\x00\x00\x07\xd0\x00\x00\x00\nUsedMapKey\x00\x00\x00\x00\x07\xd0\x00\x00\x00\nUsedMapVal\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08with_vec\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01v\x00\x00\x00\x00\x00\x03\xea\x00\x00\x07\xd0\x00\x00\x00\x0eUsedVecElement\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nUnusedEnum\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01A\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01B\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nUsedMapKey\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02K1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02K2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nUsedMapVal\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01v\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nwith_error\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x03\xe9\x00\x00\x00\x04\x00\x00\x07\xd0\x00\x00\x00\rUsedErrorEnum\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nwith_param\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01s\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x0fUsedParamStruct\x00\x00\x00\x00\x00\x00\x00\x00\x02ie\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x10UsedParamIntEnum\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nwith_tuple\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01t\x00\x00\x00\x00\x00\x03\xed\x00\x00\x00\x02\x00\x00\x07\xd0\x00\x00\x00\x10UsedTupleElement\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bUnusedEvent\x00\x00\x00\x00\x01\x00\x00\x00\x0cunused_event\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04data\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cUnusedStruct\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01x\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cUsedResultOk\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04data\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bwith_option\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01o\x00\x00\x00\x00\x00\x03\xe8\x00\x00\x07\xd0\x00\x00\x00\x11UsedOptionElement\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bwith_result\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x03\xe9\x00\x00\x07\xd0\x00\x00\x00\x0cUsedResultOk\x00\x00\x07\xd0\x00\x00\x00\rUsedErrorEnum\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bwith_return\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0eUsedReturnEnum\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\rUnusedIntEnum\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02U1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02U2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\rUsedErrorEnum\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x08NotFound\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07Invalid\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c__check_auth\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x11signature_payload\x00\x00\x00\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\nsignatures\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x0fCustomSignature\x00\x00\x00\x00\x00\x00\x00\x00\rauth_contexts\x00\x00\x00\x00\x00\x03\xea\x00\x00\x07\xd0\x00\x00\x00\x07Context\x00\x00\x00\x00\x01\x00\x00\x03\xe9\x00\x00\x00\x02\x00\x00\x07\xd0\x00\x00\x00\x11UsedAuthErrorEnum\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cwith_context\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07context\x00\x00\x00\x07\xd0\x00\x00\x00\x07Context\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cwith_non_pub\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01s\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x10UsedNonPubStruct\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0eUnusedPubError\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Nope\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0eUsedReturnEnum\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01A\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01B\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0eUsedVecElement\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04data\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\r__constructor\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04meta\x00\x00\x07\xd0\x00\x00\x00\x13UsedConstructorMeta\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fCustomSignature\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05nonce\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fUsedNonPubError\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Fail\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fUsedParamStruct\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01a\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x06nested\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12UsedNestedInStruct\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fUsedRefDataType\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x06nested\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x10UsedRefDataInner\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0epublish_simple\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0ewith_recursion\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01r\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x11UsedRecursiveRoot\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fUsedEventSimple\x00\x00\x00\x00\x01\x00\x00\x00\x11used_event_simple\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x06amount\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10UsedNonPubStruct\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10UsedParamIntEnum\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01X\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01Y\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10UsedRefDataInner\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10UsedRefTopicType\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04Send\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Recv\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10UsedTupleElement\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fwith_lib_struct\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01s\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x07StructC\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fwith_vec_nested\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01v\x00\x00\x00\x00\x00\x03\xea\x00\x00\x07\xd0\x00\x00\x00\x14UsedVecElementNested\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UnusedNonPubError\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03Bad\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedAuthErrorEnum\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x08NotFound\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07Invalid\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedEventDataType\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01x\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x01y\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedOptionElement\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04data\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedRecursiveLeaf\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x03\xea\x00\x00\x07\xd0\x00\x00\x00\x11UsedRecursiveRoot\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedRecursiveNode\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x0cNotRecursive\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x08UsedLeaf\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\tRecursive\x00\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x11UsedRecursiveLeaf\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedRecursiveRoot\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x07\xd0\x00\x00\x00\x11UsedRecursiveNode\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10with_panic_error\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04fail\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11UsedEventWithRefs\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x14used_event_with_refs\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x07\xd0\x00\x00\x00\x10UsedRefTopicType\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07payload\x00\x00\x00\x07\xd0\x00\x00\x00\x0fUsedRefDataType\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UnusedNonPubStruct\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01x\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedEventDataInner\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedEventDataOuter\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05inner\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12UsedEventDataInner\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedEventTopicType\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x08Transfer\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Mint\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedNestedInStruct\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x07\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12UsedPanicErrorEnum\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Boom\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11publish_data_type\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11publish_ref_event\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11with_assert_error\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02ok\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11with_tuple_return\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x03\xed\x00\x00\x00\x02\x00\x00\x07\xd0\x00\x00\x00\x16UsedTupleReturnElement\x00\x00\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13UsedAssertErrorEnum\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03Bad\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13UsedConstructorMeta\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13UsedEventTopicInner\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13UsedEventTopicOuter\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05inner\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x13UsedEventTopicInner\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13UsedVecInnerElement\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12publish_topic_type\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12with_non_pub_error\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x03\xe9\x00\x00\x00\x04\x00\x00\x07\xd0\x00\x00\x00\x0fUsedNonPubError\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12with_wasm_imported\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01s\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x07StructA\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14UsedVecElementNested\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x05inner\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x13UsedVecInnerElement\x00\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\tvec_inner\x00\x00\x00\x00\x00\x03\xea\x00\x00\x07\xd0\x00\x00\x00\x16UsedVecInnerVecElement\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13publish_nested_data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x15UsedPanicErrorEnumRef\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Boom\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14publish_nested_topic\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14with_panic_error_ref\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04fail\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14with_panic_raw_error\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04fail\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x15UsedEventWithDataType\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x19used_event_with_data_type\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07payload\x00\x00\x00\x07\xd0\x00\x00\x00\x11UsedEventDataType\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16UsedTupleReturnElement\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16UsedVecInnerVecElement\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03val\x00\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16UsedEventWithTopicType\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1aused_event_with_topic_type\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x07\xd0\x00\x00\x00\x12UsedEventTopicType\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x06amount\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17UsedEventWithNestedData\x00\x00\x00\x00\x01\x00\x00\x00\x1bused_event_with_nested_data\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04kind\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x07payload\x00\x00\x00\x07\xd0\x00\x00\x00\x12UsedEventDataOuter\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18UnusedNonContractFnParam\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01x\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18UsedEventWithNestedTopic\x00\x00\x00\x01\x00\x00\x00\x1cused_event_with_nested_topic\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04info\x00\x00\x07\xd0\x00\x00\x00\x13UsedEventTopicOuter\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x06amount\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19UnusedNonContractFnReturn\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01x\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x02\x00\x00\x00\xe3Context of a single authorized call performed by an address.\n\nCustom account contracts that implement `__check_auth` special function\nreceive a list of `Context` values corresponding to all the calls that\nneed to be authorized.\x00\x00\x00\x00\x00\x00\x00\x00\x07Context\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x14Contract invocation.\x00\x00\x00\x08Contract\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0fContractContext\x00\x00\x00\x00\x01\x00\x00\x00=Contract that has a constructor with no arguments is created.\x00\x00\x00\x00\x00\x00\x14CreateContractHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x1bCreateContractHostFnContext\x00\x00\x00\x00\x01\x00\x00\x00DContract that has a constructor with 1 or more arguments is created.\x00\x00\x00\x1cCreateContractWithCtorHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00*CreateContractWithConstructorHostFnContext\x00\x00\x00\x00\x00\x01\x00\x00\x00\xbdAuthorization context of a single contract call.\n\nThis struct corresponds to a `require_auth_for_args` call for an address\nfrom `contract` function with `fn_name` name and `args` arguments.\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fContractContext\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x04args\x00\x00\x03\xea\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08contract\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x07fn_name\x00\x00\x00\x00\x11\x00\x00\x00\x02\x00\x00\x00_Contract executable used for creating a new contract and used in\n`CreateContractHostFnContext`.\x00\x00\x00\x00\x00\x00\x00\x00\x12ContractExecutable\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Wasm\x00\x00\x00\x01\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x01\x00\x00\x008Value of contract node in InvokerContractAuthEntry tree.\x00\x00\x00\x00\x00\x00\x00\x15SubContractInvocation\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x07context\x00\x00\x00\x07\xd0\x00\x00\x00\x0fContractContext\x00\x00\x00\x00\x00\x00\x00\x00\x0fsub_invocations\x00\x00\x00\x03\xea\x00\x00\x07\xd0\x00\x00\x00\x18InvokerContractAuthEntry\x00\x00\x00\x02\x00\x00\x01/A node in the tree of authorizations performed on behalf of the current\ncontract as invoker of the contracts deeper in the call stack.\n\nThis is used as an argument of `authorize_as_current_contract` host function.\n\nThis tree corresponds `require_auth[_for_args]` calls on behalf of the\ncurrent contract.\x00\x00\x00\x00\x00\x00\x00\x00\x18InvokerContractAuthEntry\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x12Invoke a contract.\x00\x00\x00\x00\x00\x08Contract\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x15SubContractInvocation\x00\x00\x00\x00\x00\x00\x01\x00\x00\x005Create a contract passing 0 arguments to constructor.\x00\x00\x00\x00\x00\x00\x14CreateContractHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x1bCreateContractHostFnContext\x00\x00\x00\x00\x01\x00\x00\x00=Create a contract passing 0 or more arguments to constructor.\x00\x00\x00\x00\x00\x00\x1cCreateContractWithCtorHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00*CreateContractWithConstructorHostFnContext\x00\x00\x00\x00\x00\x01\x00\x00\x00vAuthorization context for `create_contract` host function that creates a\nnew contract on behalf of authorizer address.\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1bCreateContractHostFnContext\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\nexecutable\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12ContractExecutable\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04salt\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x01\x00\x00\x00\xd6Authorization context for `create_contract` host function that creates a\nnew contract on behalf of authorizer address.\nThis is the same as `CreateContractHostFnContext`, but also has\ncontract constructor arguments.\x00\x00\x00\x00\x00\x00\x00\x00\x00*CreateContractWithConstructorHostFnContext\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x10constructor_args\x00\x00\x03\xea\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nexecutable\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12ContractExecutable\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04salt\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nExecutable\x00\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Wasm\x00\x00\x00\x01\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStellarAsset\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07Account\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumA\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumB\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x02\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05EnumC\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x07StructA\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0cStructTupleA\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorA\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorB\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06ErrorC\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02E1\x00\x00\x00\x00\x00d\x00\x00\x00\x00\x00\x00\x00\x02E2\x00\x00\x00\x00\x00e\x00\x00\x00\x00\x00\x00\x00\x02E3\x00\x00\x00\x00\x00f\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventA\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_a\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventB\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_b\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x13\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f3\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06EventC\x00\x00\x00\x00\x00\x01\x00\x00\x00\x07event_c\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02f3\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructA\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructB\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07StructC\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02f1\x00\x00\x00\x00\x03\xea\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02f2\x00\x00\x00\x00\x00\x13\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntA\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntB\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08EnumIntC\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02V1\x00\x00\x00\x00\x00d\x00\x00\x00\x00\x00\x00\x00\x02V2\x00\x00\x00\x00\x00\xc8\x00\x00\x00\x00\x00\x00\x00\x02V3\x00\x00\x00\x00\x01,\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleA\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleB\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStructTupleC\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x00\x0b\x00\x956\x1ccontractspecv0.rssdk.graphv0SpGrV\x01\x00\x02\xa2=N\xc1p\x95\x90\xb2/\xd4:\xe6\xc6\xae\xa2Z\xdbw\xdf\x9bT\xc6\x1a\xdd\xf1\x7f=u\xbdz\x07\xeb\x00\x00SpGrV\x01\x00\x02\'\x1b\x00DSH^\xcc\x19\x8f\x93\xda\x937\xd01\"v\x96k\xce\xf4\xe7\xbact)\xb3KY\t\x89\x00\x00SpGrV\x01\x00\x02\xa0\xdd\x8f\xdc\xc9W\xbe\xc2P;\x8c\xbd\xe5\x17V\x11\xf5\xfc_\x82X@\x0e\x8f4\xab|\xdc\xf7\xfd\x96D\x00\x02\xb6\x1c\xfd\xdfhY-d\xc190\xf9\xa0\xde\x1b&\xc5y\xfe\x80R\x860\xa4\xa2GE\xd7\xcd,YJ\xcf)\x97]S\xb2\xfd)9\x03!Po\x97\xbb%\x93l\x96\xc9V\xcf\xa97\x9d\r\xf3\x0c\xe5\x1f.[SpGrV\x01\x00\x02\xe9R\xa7\xe8b\x99\xa2\xc3\x15$]1\x88\xb5~p\x1c\xe0\xc5.\xac\x12\xb8\xbd\xd5t\xfd[\x98B\xb7d\x00\x00SpGrV\x01\x00\x02\x1d1\xd6\xfb\x88\xd2=\xe3}\xcd\xe8\xd8\xc1 \xd0\x9c\xfe\xab|\xdd\xaf!>\xa6=\xbf8`\xcd\x82CR\x00\x00SpGrV\x01\x00\x02\xb9\x01\xafj\xe0c\xa3\rk\x83\xec\x83DA\xd9\\q\xfbtE\xc0\xf8\x83\xdd\x84\xc9\xb0\x95\x18\x98pd\x00\x00SpGrV\x01\x00\x01K\xe6\x8ej\x19\x9en\xbd\xccv\xd2:}`\x07\xddn\xe9\x904>\x9b^h\xa7\x04%Be#r\x9b\x00\x00SpGrV\x01\x00\x01\xe6\xaa\xefz\x17i$\x15\x95\x112\x06\xef\xd7R\xa8\xc9\x83\xf2\xc8\x87i\xadz\x1e\xdc\x8e\x90\x1c-\x80`\x00\x00SpGrV\x01\x00\x01\x16\xd6\xdf\xe7\xdb\xb4W@\x9b\x92\x97\xb9\x1a\x14\xeeK\xbf6\xfe\x92\xab`\xa1\xe3\xc8r\\\"T0\xb8!\x00\x00SpGrV\x01\x00\x02\xb6\x1c\xfd\xdfhY-d\xc190\xf9\xa0\xde\x1b&\xc5y\xfe\x80R\x860\xa4\xa2GE\xd7\xcd,YJ\x00\x00SpGrV\x01\x00\x02\xf3\xc4\xd3\x8c\xc1w\xe9\x18\x7f\xbdXAi{P7\xbe\xa3riQ*,\x95\xa2\xb0\xe6\x9fo#&`\x00\x00SpGrV\x01\x00\x02\xa3\x16\n\x8f\xc9\x92\xd2\x11\xfe\x9f\x8b\x9a\x1f L\xd2\x0f\xec\x8a\xc7\xcdwU\x85\xc5\x166\xe7|\xad)N\x00\x00SpGrV\x01\x00\x02V]\x80\\~\x1a\x08/\xa1\x13\xf0r\x98\xa8\xc8\x9c\xdfS\x1b\xbc\x80\x10nP\x81\xfd-\x90\n\xab\x99\t\x00\x00SpGrV\x01\x00\x02,\x9c\xc0_\xed_)\x85\x9b\x01\xac\x9d\xf9OMlv*\xfbE\x8f\xab\x8f.\xdaQ\x161\xc1\x07\xbap\x00\x00SpGrV\x01\x00\x02`\xca\xda\x19\xb9c\xf0/\xb0T\x02-\x98\x95\xbd\xbb\x87\xbf-\x9d\x1bp\xf0=\x96\xf2D\xf6yT\xdc\xd4\x00\x00SpGrV\x01\x00\x02\xcf)\x97]S\xb2\xfd)9\x03!Po\x97\xbb%\x93l\x96\xc9V\xcf\xa97\x9d\r\xf3\x0c\xe5\x1f.[\x00\x00SpGrV\x01\x00\x02x\xd98\x9c\x1ao\xac\x8c\x08v\x8b\xec\xbf\xeb\xbd~\xd0\xb8F\xaa\xbc\x12<\xa0\x89\xe1L&\x9e\x04\xfc\xa0\x00\x00SpGrV\x01\x00\x02\xc5=\x81\xc1\"\xafT\xd9\x03\x9b\x9a]\xc4mcc\xa0y|\x12j\xe5\x9e\xb4_A\xfb\x08j#\x99\x9b\x00\x00SpGrV\x01\x00\x02\x86\xf7:L*\xf3\x0b\x94\xd8\x8bM1m\x13\xed\x8fJ}\xb4\xc1\x15u\xd0\xd3\xb6Xe\nj6\x84\"\x00\x00SpGrV\x01\x00\x02\xe6Q\xd5T\x13\x8a\xb7l\xa1E\xc4q\x84\x01\xf9Y\xe49\x83\xb5jd\\5\xf1]\xf2\xbb\x14\x00\x00SpGrV\x01\x00\x02X\x03\xf6t\xc7\xd0\x01\"\x961\xf3\x1e\xad~\xda\xcc\xb4YQl\xb8N\x0f\x89&\x95m\x90\n\xab\xd4\xe3\x00\x01\x84\x08Y\xae\xa0\xf128\x93a\xcd\xa3\x96yv\rTB\xfb/\x85\xee\x8e?\x01\x9fp\x91\x01U\x12\x83SpGrV\x01\x00\x02\'\xbd_A\r\x9a\x89\x02l\x941T>\xcd\xc3\xafg\xb6\x01\xa4D\x15\xa9\xf5\xfd\x1d\r\xfe\xb8\xe90A\x00\x01K\xdf\'8m/\xe8\x1dr\xe0\'{3\xa9\xe0\\\x0c\xeb\xc4\xe3\xb3\nA\xfey\xf4\x11\x13\xd2\x08{~SpGrV\x01\x00\x01v1\x0eP\xa9C\xc7*\xce\xf5\x10\x1d\xb2\xaeFR|\n\x1e\x88\x8bB~\x8e\xc3\xb8\xdf\x1b\xd1\x0cx\xeb\x00\x00SpGrV\x01\x00\x02p\x8c\x0fN!\x082\xd8n\x8c\xea\x0fh\x9c\xb8\xd8\xbe\xddnI\xa0\x91\xcdb3\xd8\x07t\x0c\xcd\xfa\xb0\x00\x00SpGrV\x01\x00\x02\xc2\xf4N\xbf\xebqvp\xb8\xb6\xbe\t\x99\xef\xb0\xf8\xc1G\xfa;\x1c\xd1\x9bg\xb3\xdbS\x92\xf6\"-@\x00\x00SpGrV\x01\x00\x02K\xdf\'8m/\xe8\x1dr\xe0\'{3\xa9\xe0\\\x0c\xeb\xc4\xe3\xb3\nA\xfey\xf4\x11\x13\xd2\x08{~\x00\x00SpGrV\x01\x00\x02@\xb9LO\xf9\xd1\xe8\xe2\xbb\x94X\x08\xab\x8a\xaf\x95(\xcd\x91\x1f\x96\xce\t\xff\x86|\xb4\xb6\x84K\xed \x00\x00SpGrV\x01\x00\x02\xde\x1dMa\x01\xec\xb0A\nT\x8b\x1e\xbb\x88\x034\xcfwRz\x7f\x1b\x05\xc2b1\xe7r8{\xce\xc7\x00\x00SpGrV\x01\x00\x00,\xccnmf\x98\xf0\x1f\xb7\x1e\xc6\x9b\xb8\x1d`\xdeVb\xcc\xd9\xd5;\xc9\x17E:\x18\x96i?\xees\x00\x01Hh\xdc\xaaa\x8d\xf7\re\xda\x8d\xd7\x15\x1b\xfb\x07v\x9e\x94}\x06\x18\x88\xf7{\xcc\xb0C\xcb\xa3\xb6~SpGrV\x01\x00\x009AZ\x8d\xc6\x89R\xa2A\xb7\xff\xf2d\xef\xb2b\xd6\x93\x96\x8a\xf6\xf3\xf3\xe2\x8f\xcc\x88T\x13\x10a\xdb\x00\x02X\x03\xf6t\xc7\xd0\x01\"\x961\xf3\x1e\xad~\xda\xcc\xb4YQl\xb8N\x0f\x89&\x95m\x90\n\xab\xd4\xe3\xc2\xf4N\xbf\xebqvp\xb8\xb6\xbe\t\x99\xef\xb0\xf8\xc1G\xfa;\x1c\xd1\x9bg\xb3\xdbS\x92\xf6\"-@SpGrV\x01\x00\x00\x921\x17mb\xdb@#\x02]\xc0o\x95\xa30x\x9e\x8e\x0e5\r\xc0\xc2\xe7-G\x90\x19\x1cf\xc8=\x00\x01\xde\x1dMa\x01\xec\xb0A\nT\x8b\x1e\xbb\x88\x034\xcfwRz\x7f\x1b\x05\xc2b1\xe7r8{\xce\xc7SpGrV\x01\x00\x02\xd9_\x99\"=\xc6FM\xa7U\x9d\xc5\x8b\x9b\xee\x99!\x86}\x99|P\x15\x8e\x16\x0e&\xe5p\xa3]\xe4\x00\x00SpGrV\x01\x00\x02=V\x92A(\x981\x88\xf58\xbe\x9e5*+\xf5>J\x9c\x88&\x1a\xd7\x86S\xdc\xf8\xffz\'\xf5\xd3\x00\x00SpGrV\x01\x00\x02\xc2 \x1b\xdc\xc8gxZ{C<0\";\xe6w\xb4\xf6l\xfa|\xbe\x9b\xfc\x9612\x9e0\x02\x89\x0e\x00\x00SpGrV\x01\x00\x02\xb3/\x97\xd5\x06\xbd3Bb\xd9\xac\xadF\x00\xb4v\xad\x10<\xc2\xfb\xaf\x97\xf4fy1\xc1,\xba\x07\xa9\x00\x00SpGrV\x01\x00\x02?\xd9\xb3q\xdep>\xf3\xab\xb06G\x9d\xb5\x9cd\x9c\x97\xa5T\xcc\xa1\x98*\x83\xe90\xdd\xdb#\x186\x00\x01u2\x0b\x97\xae\xcd\x86\xbf\x0b(\x18\x06\x90x\xae?\xceC\xbe\x7f\xc9\x9c= \xb0\xa5\xd0=j\x91\xfd\xbbSpGrV\x01\x00\x02*\\\x9c\xf4e\xaa\x1e]V\xdcG\x0f>f\xb3N\xf3\xa9\xf5\t\x86y\xbf\x00\x11Q\t\xf3\xc8\xae\xf4E\x00\x02\xe6Q\xd5T\x13\x8a\xb7l\xa1E\xc4q\x84\x01\xf9Y\xe49\x83\xf3\xab\xb06G\x9d\xb5\x9cd\x9c\x97\xa5T\xcc\xa1\x98*\x83\xe90\xdd\xdb#\x186SpGrV\x01\x00\x02u2\x0b\x97\xae\xcd\x86\xbf\x0b(\x18\x06\x90x\xae?\xceC\xbe\x7f\xc9\x9c= \xb0\xa5\xd0=j\x91\xfd\xbb\x00\x01*\\\x9c\xf4e\xaa\x1e]V\xdcG\x0f>f\xb3N\xf3\xa9\xf5\t\x86y\xbf\x00\x11Q\t\xf3\xc8\xae\xf4ESpGrV\x01\x00\x01[Q+\xe9\xde\xd5\xf2>`4p2\xd1G\xec\xe6\xac\x1a\x85\x03{\x04W3\x14\xde|\xac\xdc\x9bl\x99\x00\x02@\xb9LO\xf9\xd1\xe8\xe2\xbb\x94X\x08\xab\x8a\xaf\x95(\xcd\x91\x1f\x96\xce\t\xff\x86|\xb4\xb6\x84K\xed \'\xbd_A\r\x9a\x89\x02l\x941T>\xcd\xc3\xafg\xb6\x01\xa4D\x15\xa9\xf5\xfd\x1d\r\xfe\xb8\xe90ASpGrV\x01\x00\x00\x98;\xeb\x9f\x1c\xdf\xf3\xd2\x90E\x08\xce)e\x16\xdazb\xaeB}\xa9\x8d\xdd6P\xa9g\xc5\xea\xb7m\x00\x01\xb3/\x97\xd5\x06\xbd3Bb\xd9\xac\xadF\x00\xb4v\xad\x10<\xc2\xfb\xaf\x97\xf4fy1\xc1,\xba\x07\xa9SpGrV\x01\x00\x006\x94\xf3\xa9\x15\x8b\x93\xda*\xc1\x84\x00\x00SpGrV\x01\x00\x02\'\xf2\xa2\xb9\xd0)\xc0u \x17\xc1\xe1\xcc5t\"\x83\xad\x90)\x86\xd5j\x85\x1cD\xc9\x0f|\xb2\x01\x1a\x00\x01\x0c\xf0\xf6w\xfd\x1a\x1b\x94\x8e\xdb9\xf07\x16K{\xce\xe5no\xb5>\x94\xf3\xa9\x15\x8b\x93\xda*\xc1\x84SpGrV\x01\x00\x02\xf5\xd4\x9b\xa3\xccI\x13\xf7\xbf7!\xf53\"u\xb3a\xe3\x1e0\xcdc?P5Zh\xdb\xcc\xb5\x81\xf6\x00\x00SpGrV\x01\x00\x02\x84\x08Y\xae\xa0\xf128\x93a\xcd\xa3\x96yv\rTB\xfb/\x85\xee\x8e?\x01\x9fp\x91\x01U\x12\x83\x00\x00SpGrV\x01\x00\x02\r\xb76\xae\x93D\xef\x1aa\xb8\x95\x90\xd0\x15\xf7\x9aq]\x18w\x11\x92-\x99\x8e\n\x11\xfe\xe2sdQ\x00\x00SpGrV\x01\x00\x00b\xc2\xbdU\xd1\x05\x81o\xa4\x12\xb3\"\xe5\xb0H\x19\x8a\x02M\xe6\xe2\xb4\xc6\x9e\x98\xb7{\xcd\x1f\\\xb0\x15\x00\x01\x86\xf7:L*\xf3\x0b\x94\xd8\x8bM1m\x13\xed\x8fJ}\xb4\xc1\x15u\xd0\xd3\xb6Xe\nj6\x84\"SpGrV\x01\x00\x00\x13\xb2]FU\xec\xf3\xbb%\x0c6Veq\xda\x82q\x96\xd1F\x96\xaday`\xfe\xef\\3\x1aB\n\x00\x01p\x8c\x0fN!\x082\xd8n\x8c\xea\x0fh\x9c\xb8\xd8\xbe\xddnI\xa0\x91\xcdb3\xd8\x07t\x0c\xcd\xfa\xb0SpGrV\x01\x00\x00d0\x1d$\nPH\x95\xf0\xbc\xe3\xae\xb2\xd6QK\xe9\x92\xc4\xf3$S\xb9\xff\xd9\xafR4JZ\x9c\x83\x00\x036\xb3\x0f\xc2\xa9\r\x8a\xe1\xb2\xd9\x87Gc\x0ed\x89\xe7i\\\xef\x88\x07\xfc\"\xd8\x10\x97*$\xbc]&\xa3J\xcf\xf7D\x93\x0bB]\x95\xeb\xfe\x03y\x83e5\\\x16\xeb\x94Ne\xe6Xw\x1f&\xf7\xc0pT=V\x92A(\x981\x88\xf58\xbe\x9e5*+\xf5>J\x9c\x88&\x1a\xd7\x86S\xdc\xf8\xffz\'\xf5\xd3SpGrV\x01\x00\x02\x8b\x89\x1f#\xbd\x157\xf4Gx\xa2a\x0ehQ\xe4\xdd\x02O0\x0b\x96\xeb\x0f\xb6\x00\xa3\x91)\xf9;\x19\x00\x00SpGrV\x01\x00\x026\xc8\x1co\xa3\xfa}e0\xac\x8c\x1c\x938\xca\xc9\xa2\x8c\x156\x97~\x0f\xb2GV\xad\xb7\x1a\x1bT\xaa\x00\x00SpGrV\x01\x00\x026\x83?\xf0\xcdW\xb1/\x84\x83\xf4\xb9w\xfcY1^\xd2iW\x04\xf2\x84\xb9\n\x15 \xc2\x16\xce\x95\x08\x00\x00SpGrV\x01\x00\x02\x94\xc7w/_\xebXc\xa9\x03\x88\x02\x07^\x08\xa2\x8e_\x97\xfe\x1a\x86o\x86\xf0h\x0e\xd5Q],\xce\x00\x016\x83?\xf0\xcdW\xb1/\x84\x83\xf4\xb9w\xfcY1^\xd2iW\x04\xf2\x84\xb9\n\x15 \xc2\x16\xce\x95\x08SpGrV\x01\x00\x02\xb4\xabN]\xe3\xeaA\xd6AQ\x80Y\xe9H\xaa6L/k\xb0\x17\xcdg\x92=\x8f\x8dA\xeaXP\x18\x00\x00SpGrV\x01\x00\x00\xc2\x7f\t\x92\x8d\xa6\xe9Pv\xc6\xab\xcf\x07Q\x98\x10\xd5\xd8|\x85\xe7\x12\xf6\x8aR\xa0]\xff\x1e~\xccV\x00\x016\xc8\x1co\xa3\xfa}e0\xac\x8c\x1c\x938\xca\xc9\xa2\x8c\x156\x97~\x0f\xb2GV\xad\xb7\x1a\x1bT\xaaSpGrV\x01\x00\x02\x13?J\x12d\xden|\xe9\xd0`\x82\xf0\x19\xd4s\x1e\xa4\x87\xe1\xe6p.-\xa2\x1b\xb1\xae[\xcc`\xcc\x00\x02\xb4\xabN]\xe3\xeaA\xd6AQ\x80Y\xe9H\xaa6L/k\xb0\x17\xcdg\x92=\x8f\x8dA\xeaXP\x18\xcf@%X\xde+J@\xc4\xe7\xb8=\xdd(\x16za\xe2\xb0\xa6\x9e>\xc6h\x18\xc6\xdfl\x00s\xa3DSpGrV\x01\x00\x00U\x86\x1b\x93v\xa5\x8c\x81\x9c\xf5\xb4\xf4\xd7\xd5\x8c?\xe4\xb4?;{\x9a\xe957p\xfd-\x8e\x91\xfb\xb9\x00\x00SpGrV\x01\x00\x00\x95\x02\"L\x8a\x81*\x08\x17c\xae#g\t\xb6\x02\rt\x03\x9e\xe5D\xf2\xfd\xd5\x94\x04\xa4\x0cG\x88\xbd\x00\x01u2\x0b\x97\xae\xcd\x86\xbf\x0b(\x18\x06\x90x\xae?\xceC\xbe\x7f\xc9\x9c= \xb0\xa5\xd0=j\x91\xfd\xbbSpGrV\x01\x00\x02!v\x9b\xbb<\xd2\x9f\xc9\xfd|\x8e\xd7\x8f`\x80\xf9M\x8e\xb8\x98*l\xbfx\xce\xaa\xa6\n;i\x96x\x00\x00SpGrV\x01\x00\x01q\xa3z;6\xa6R\x01\xa6-V\x13\x03\xcc\xff\x03\x84\x1f\xfb\xbe`v\xba\x0e\xe9\xd3\x0f\xf8$#t0\x00\x01\xc2 \x1b\xdc\xc8gxZ{C<0\";\xe6w\xb4\xf6l\xfa|\xbe\x9b\xfc\x9612\x9e0\x02\x89\x0eSpGrV\x01\x00\x00?\xbe1a\xd0/\xc8\xee\xc8\xfc\xf1\xfe\x0e\xb6\x81`\x91\xeao\x10\xc5\xc4\xa0L^\xdd\xf4j\x01F,Z\x00\x01\xa3\x16\n\x8f\xc9\x92\xd2\x11\xfe\x9f\x8b\x9a\x1f L\xd2\x0f\xec\x8a\xc7\xcdwU\x85\xc5\x166\xe7|\xad)NSpGrV\x01\x00\x00=\xc9^7\x8a\xd6\xc3\x91\x81\xea\x1aw\xf0&\x84\xc5=w\xbe\xce\xa3Q\xaa)\xa3\xe1z\x05\xc3\x90\xe9\xfe\x00\x01\x13?J\x12d\xden|\xe9\xd0`\x82\xf0\x19\xd4s\x1e\xa4\x87\xe1\xe6p.-\xa2\x1b\xb1\xae[\xcc`\xccSpGrV\x01\x00\x02Y\xa66\xb3\xecxE\x13\xdaZ\xbe\xa2r?J\xa2D\xc2\xd8\xb5\x1d8\xd1tn\x9d\x10\x86\x04\x1a\xf2\x1b\x00\x00SpGrV\x01\x00\x02\xcf@%X\xde+J@\xc4\xe7\xb8=\xdd(\x16za\xe2\xb0\xa6\x9e>\xc6h\x18\xc6\xdfl\x00s\xa3D\x00\x00SpGrV\x01\x00\x01q^\xe2&\x9di\x9d\x0e\xea\x19\xc6\xe7{\xdd\xcf\xfc\xf1\xe5\x81\x94u\xd0\x08A\x93\xc9\"\xee\xbe\xa0h\xef\x00\x01\xf5\xd4\x9b\xa3\xccI\x13\xf7\xbf7!\xf53\"u\xb3a\xe3\x1e0\xcdc?P5Zh\xdb\xcc\xb5\x81\xf6SpGrV\x01\x00\x00\xc6\xf0\xfd2g\x89\x8d\x16\x10\xe1P\x83<\xf6(\x19\xc4\x81\x8120\xe7\x14\xa6\xa7\x90\xd9\xe4\xd3\x9d\xaa\x0e\x00\x00SpGrV\x01\x00\x01 \xfbl\x04B\x82\xc0\xb4.\xec\xfdE\xa0\x8d\xca\xea\xd9\"\xc2\xf1\xcf\xe4-\xe2|\x1b&\x9eF\xc1e0\x00\x01\'\xf2\xa2\xb9\xd0)\xc0u \x17\xc1\xe1\xcc5t\"\x83\xad\x90)\x86\xd5j\x85\x1cD\xc9\x0f|\xb2\x01\x1aSpGrV\x01\x00\x00\xb5z-\x08C&*\xbe\x83:\x87\"\xe9$|\xd8\xfa\xfeB\xea\xf0.\xb6W\xf0\x86][o\xcb\x8c\xe5\x00\x00SpGrV\x01\x00\x00\xb6\x92\x87\x14\xa1\xab\x9b\xe8\x85\xa5\x8c\xe6\xf5\x150\x82\x81\x1c\x9d\x9a\xef\x16C\x04{=\x7f<\xfd\r\xf1a\x00\x00SpGrV\x01\x00\x00\xee\xec\xcb\x84V\xda\x92P\"t\'\xe64\xde\x853\xcb\xd44Z\x04\x1c\x13\xca\xcd\xf9\xb3\xab^\xdb\x91\xb4\x00\x00SpGrV\x01\x00\x00\xe3\x01\xf3\xbf\xd9\x995\x9a\xba\x90\rF\xc6\xb3^\x86\x12L\xffR\xf0\xbd\x0b\xc0N\xc0\xe1f\x13\x88w\x84\x00\x01Y\xa66\xb3\xecxE\x13\xdaZ\xbe\xa2r?J\xa2D\xc2\xd8\xb5\x1d8\xd1tn\x9d\x10\x86\x04\x1a\xf2\x1bSpGrV\x01\x00\x02\x81\xbc\xdb\xb4\xc1\xcb\xbd\xc5\x8a\x8d\xbc\xf2\x19kdi@]\xbe\xc3\xbf\x97lX\x84d=\x90\x1b\xc8\xc5\x86\x00\x00SpGrV\x01\x00\x01\xe3\xf2\x9b5%a\xfb\xd6pv\xcf\xd0q\x91\x9f\xae\x8d\x9d\x8dLKjc\xed&r;W\x13f\x8c\xba\x00\x01\x94\xc7w/_\xebXc\xa9\x03\x88\x02\x07^\x08\xa2\x8e_\x97\xfe\x1a\x86o\x86\xf0h\x0e\xd5Q],\xceSpGrV\x01\x00\x00\xee\x97\xa6+\xa5\xb6\xc5 b\xed\x18RU\x89z\',\x9ffq\xc0c\xbfZ\xcar\x14^oz\xf6_\x00\x00SpGrV\x01\x00\x00D\xbeG?\x1c\x8c\xb2\x96\xbcS\xed\xb1`\xb3\x1a\xb6>\xe397\xc1\x9e\x19\x18#\x81\xd1\xcb\x85O\xb6\xea\x00\x01\xa9<\xd8+\xb7\xa7\r\x17\xf1\x12\x1e\x03\xeb9\xb4\xa9\'\xfc\x11\xab\x86>\xb5jd\\5\xf1]\xf2\xbb\x14SpGrV\x01\x00\x00\xa3\x98\xd5x\xf0O\"\x89\xdc>\xfe\xc4\xd4\xdf\xc1\x8aN\x19v\xed\xaa\t\x85p\xc5\xa5[\xef\xb0\xd6>\xae\x00\x01\xb6\x1c\xfd\xdfhY-d\xc190\xf9\xa0\xde\x1b&\xc5y\xfe\x80R\x860\xa4\xa2GE\xd7\xcd,YJSpGrV\x01\x00\x02\x7fe\x1c\n\x87g\x1d\xc0\x06x\xb0\xae8\x04\x1eO(Q\xf0\xe5\xb2\xef.\xd8\x95\xe1;*\xa4\x96\xf49\x00\x00SpGrV\x01\x00\x00\x85\x91`+\xaez\xee\x08\x9a\\\x18\xab1\xab\x13\xf6\xc6%\xfbj\xf2\xff/\x98E\xe6\xc9\xa7L\x83\x86\xbb\x00\x00SpGrV\x01\x00\x00\xa3\x15\xec\xffg\x02E\xabPG\xb9\x01Q\xf0\x00\xe0 \xebF\xa3\xce\xe4\x9a\xda\xbfC\xbe[\x16|\x0cy\x00\x00SpGrV\x01\x00\x00\xcdB\x02\xf7\xfd\x86\xae<*\x7fR\xee9\x815\"K\xa8\x1c\x18<\x812\xfc\xf0s\xd3U\xd9\xbdD\x16\x00\x00SpGrV\x01\x00\x00\xa8\x16\x96\x10I\xdc\x18\xfb-\xcc.P\xe4\x8a\x8f\x88\x04&\x8a\xc61@\x9af,\xb9c5R\x00,\"\x00\x00SpGrV\x01\x00\x02\xa3J\xcf\xf7D\x93\x0bB]\x95\xeb\xfe\x03y\x83e5\\\x16\xeb\x94Ne\xe6Xw\x1f&\xf7\xc0pT\x00\x03\xf1\xf9\x90\x07E*e\xfd\x08\x8c\xc2\xb1\x10\xfd\xca\xae6T\x9e)[\xdb\xee_\xfa\xed\xcaE\x9bv\x98\xec\x15\xe5\x1a,\xc0\xc7\xef\xd4\xe0\xda\x0e\x16\x87\x1a\xae\xe73X\x1d2\x8a\x8aP\xab\x81\xef\x18\x8e:\xa2\xa9ns\x94\x0c\x1926\x1d\x90\x19\xc8\x8b=\xbe\xaf\xd7n\xcd=z\t\xb27\xa5.\xde:>\x03\xcd7\x12\xafSpGrV\x01\x00\x02\xf1\xf9\x90\x07E*e\xfd\x08\x8c\xc2\xb1\x10\xfd\xca\xae6T\x9e)[\xdb\xee_\xfa\xed\xcaE\x9bv\x98\xec\x00\x00SpGrV\x01\x00\x02\xb6\xb1Hy\xda\xca\xaf\xcc\x1f\x01\x07y\x9a#g}2\x1c.Q0Vf\xc7ze\xacm\x01\xf5Y\xcc\x00\x00SpGrV\x01\x00\x02\x9e)H\x8e\xf0\x01{{\xce\x9fdO\x0eD\xc0,\x0f\xe8\xee\'\x845r\x9f\xeb`\xd0\x12H\x17\x96g\x00\x02\xf1\xf9\x90\x07E*e\xfd\x08\x8c\xc2\xb1\x10\xfd\xca\xae6T\x9e)[\xdb\xee_\xfa\xed\xcaE\x9bv\x98\xecULqD\xd3\xfa:\x1f\x0c\xa5\xb7\x04\xe5H\x8b\x91J\x9e\x0fe\x7f\x9f[\xdbG#\xc7o\xb0\xf4\xcf\xe6SpGrV\x01\x00\x02ULqD\xd3\xfa:\x1f\x0c\xa5\xb7\x04\xe5H\x8b\x91J\x9e\x0fe\x7f\x9f[\xdbG#\xc7o\xb0\xf4\xcf\xe6\x00\x03\x9e)H\x8e\xf0\x01{{\xce\x9fdO\x0eD\xc0,\x0f\xe8\xee\'\x845r\x9f\xeb`\xd0\x12H\x17\x96g\x15\xe5\x1a,\xc0\xc7\xef\xd4\xe0\xda\x0e\x16\x87\x1a\xae\xe73X\x1d2\x8a\x8aP\xab\x81\xef\x18\x8e:\xa2\xa9ns\x94\x0c\x1926\x1d\x90\x19\xc8\x8b=\xbe\xaf\xd7n\xcd=z\t\xb27\xa5.\xde:>\x03\xcd7\x12\xafSpGrV\x01\x00\x02\x15\xe5\x1a,\xc0\xc7\xef\xd4\xe0\xda\x0e\x16\x87\x1a\xae\xe73X\x1d2\x8a\x8aP\xab\x81\xef\x18\x8e:\xa2\xa9n\x00\x01\xb6\xb1Hy\xda\xca\xaf\xcc\x1f\x01\x07y\x9a#g}2\x1c.Q0Vf\xc7ze\xacm\x01\xf5Y\xccSpGrV\x01\x00\x02s\x94\x0c\x1926\x1d\x90\x19\xc8\x8b=\xbe\xaf\xd7n\xcd=z\t\xb27\xa5.\xde:>\x03\xcd7\x12\xaf\x00\x01\xb6\xb1Hy\xda\xca\xaf\xcc\x1f\x01\x07y\x9a#g}2\x1c.Q0Vf\xc7ze\xacm\x01\xf5Y\xccSpGrV\x01\x00\x02L|{\r\xf4\xf2\x1a\xa8\xf6\x981\xe2K\xcb\x824N\xe6\x97\xed\xdf\xc2\x1cck\xd6\xceW\x9cx\x10\x1e\x00\x00SpGrV\x01\x00\x02\xa2=N\xc1p\x95\x90\xb2/\xd4:\xe6\xc6\xae\xa2Z\xdbw\xdf\x9bT\xc6\x1a\xdd\xf1\x7f=u\xbdz\x07\xeb\x00\x00SpGrV\x01\x00\x02\'\x1b\x00DSH^\xcc\x19\x8f\x93\xda\x937\xd01\"v\x96k\xce\xf4\xe7\xbact)\xb3KY\t\x89\x00\x00SpGrV\x01\x00\x02\xa0\xdd\x8f\xdc\xc9W\xbe\xc2P;\x8c\xbd\xe5\x17V\x11\xf5\xfc_\x82X@\x0e\x8f4\xab|\xdc\xf7\xfd\x96D\x00\x02\xb6\x1c\xfd\xdfhY-d\xc190\xf9\xa0\xde\x1b&\xc5y\xfe\x80R\x860\xa4\xa2GE\xd7\xcd,YJ\xcf)\x97]S\xb2\xfd)9\x03!Po\x97\xbb%\x93l\x96\xc9V\xcf\xa97\x9d\r\xf3\x0c\xe5\x1f.[SpGrV\x01\x00\x02\xe9R\xa7\xe8b\x99\xa2\xc3\x15$]1\x88\xb5~p\x1c\xe0\xc5.\xac\x12\xb8\xbd\xd5t\xfd[\x98B\xb7d\x00\x00SpGrV\x01\x00\x02\x1d1\xd6\xfb\x88\xd2=\xe3}\xcd\xe8\xd8\xc1 \xd0\x9c\xfe\xab|\xdd\xaf!>\xa6=\xbf8`\xcd\x82CR\x00\x00SpGrV\x01\x00\x02\xb9\x01\xafj\xe0c\xa3\rk\x83\xec\x83DA\xd9\\q\xfbtE\xc0\xf8\x83\xdd\x84\xc9\xb0\x95\x18\x98pd\x00\x00SpGrV\x01\x00\x01K\xe6\x8ej\x19\x9en\xbd\xccv\xd2:}`\x07\xddn\xe9\x904>\x9b^h\xa7\x04%Be#r\x9b\x00\x00SpGrV\x01\x00\x01\xe6\xaa\xefz\x17i$\x15\x95\x112\x06\xef\xd7R\xa8\xc9\x83\xf2\xc8\x87i\xadz\x1e\xdc\x8e\x90\x1c-\x80`\x00\x00SpGrV\x01\x00\x01\x16\xd6\xdf\xe7\xdb\xb4W@\x9b\x92\x97\xb9\x1a\x14\xeeK\xbf6\xfe\x92\xab`\xa1\xe3\xc8r\\\"T0\xb8!\x00\x00SpGrV\x01\x00\x02\xb6\x1c\xfd\xdfhY-d\xc190\xf9\xa0\xde\x1b&\xc5y\xfe\x80R\x860\xa4\xa2GE\xd7\xcd,YJ\x00\x00SpGrV\x01\x00\x02\xf3\xc4\xd3\x8c\xc1w\xe9\x18\x7f\xbdXAi{P7\xbe\xa3riQ*,\x95\xa2\xb0\xe6\x9fo#&`\x00\x00SpGrV\x01\x00\x02\xa3\x16\n\x8f\xc9\x92\xd2\x11\xfe\x9f\x8b\x9a\x1f L\xd2\x0f\xec\x8a\xc7\xcdwU\x85\xc5\x166\xe7|\xad)N\x00\x00SpGrV\x01\x00\x02V]\x80\\~\x1a\x08/\xa1\x13\xf0r\x98\xa8\xc8\x9c\xdfS\x1b\xbc\x80\x10nP\x81\xfd-\x90\n\xab\x99\t\x00\x00SpGrV\x01\x00\x02,\x9c\xc0_\xed_)\x85\x9b\x01\xac\x9d\xf9OMlv*\xfbE\x8f\xab\x8f.\xdaQ\x161\xc1\x07\xbap\x00\x00SpGrV\x01\x00\x02`\xca\xda\x19\xb9c\xf0/\xb0T\x02-\x98\x95\xbd\xbb\x87\xbf-\x9d\x1bp\xf0=\x96\xf2D\xf6yT\xdc\xd4\x00\x00SpGrV\x01\x00\x02\xcf)\x97]S\xb2\xfd)9\x03!Po\x97\xbb%\x93l\x96\xc9V\xcf\xa97\x9d\r\xf3\x0c\xe5\x1f.[\x00\x00SpGrV\x01\x00\x02x\xd98\x9c\x1ao\xac\x8c\x08v\x8b\xec\xbf\xeb\xbd~\xd0\xb8F\xaa\xbc\x12<\xa0\x89\xe1L&\x9e\x04\xfc\xa0\x00\x00SpGrV\x01\x00\x02\xc5=\x81\xc1\"\xafT\xd9\x03\x9b\x9a]\xc4mcc\xa0y|\x12j\xe5\x9e\xb4_A\xfb\x08j#\x99\x9b\x00\x00\x00\x1e\x11contractenvmetav0\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x00\x00O\x0econtractmetav0\x00\x00\x00\x00\x00\x00\x00\x05rsver\x00\x00\x00\x00\x00\x00\x061.91.0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12rssdk_spec_shaking\x00\x00\x00\x00\x00\x012\x00\x00\x00"; extern crate test; #[rustc_test_marker = "test::test_spec_shaking_v2"] #[doc(hidden)] @@ -21930,8 +27665,37 @@ mod test { fn test_spec_shaking_v2() { let entries = soroban_spec::read::from_wasm(WASM).unwrap(); let markers = soroban_spec::shaking::find_all(WASM); + let graph = soroban_spec::shaking::find_graph(WASM).unwrap(); + if !!graph.entries.is_empty() { + ::core::panicking::panic("assertion failed: !graph.entries.is_empty()") + } let filtered: Vec<_> = - soroban_spec::shaking::filter(entries.iter().cloned(), &markers).collect(); + soroban_spec::shaking::filter(entries.iter().cloned(), &markers, &graph) + .unwrap() + .collect(); + let shaken = soroban_spec::strip::shake_contract_spec(WASM).unwrap(); + match (&soroban_spec::read::from_wasm(&shaken).unwrap(), &filtered) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::None, + ); + } + } + }; + if !soroban_spec::shaking::find_graph(&shaken) + .unwrap() + .entries + .is_empty() + { + ::core::panicking::panic( + "assertion failed: soroban_spec::shaking::find_graph(&shaken).unwrap().entries.is_empty()", + ) + } let filtered_names: HashSet = filtered.iter().filter_map(entry_name).collect(); let fn_names: Vec = filtered @@ -21945,14 +27709,19 @@ mod test { }) .collect(); for expected_fn in [ + "__constructor", "with_param", + "with_context", "with_return", "with_error", "with_panic_error", + "with_panic_error_ref", "with_assert_error", "with_panic_raw_error", "with_vec", + "with_vec_nested", "with_map", + "with_recursion", "publish_simple", "publish_topic_type", "publish_data_type", @@ -21967,6 +27736,7 @@ mod test { "with_non_pub_error", "with_tuple", "with_tuple_return", + "__check_auth", ] { if !fn_names.contains(&expected_fn.into()) { { @@ -21975,18 +27745,30 @@ mod test { } } let used = [ + "UsedConstructorMeta", + "Context", "UsedParamStruct", "UsedReturnEnum", "UsedParamIntEnum", "UsedErrorEnum", + "UsedAuthErrorEnum", "UsedPanicErrorEnum", + "UsedPanicErrorEnumRef", "UsedAssertErrorEnum", "UsedNestedInStruct", "UsedVecElement", "UsedMapKey", "UsedMapVal", + "UsedVecInnerVecElement", + "UsedVecInnerElement", + "UsedVecElementNested", "UsedOptionElement", "UsedResultOk", + "CustomSignature", + "ContractContext", + "CreateContractHostFnContext", + "CreateContractWithConstructorHostFnContext", + "ContractExecutable", "UsedEventSimple", "UsedEventTopicType", "UsedEventWithTopicType", @@ -22008,6 +27790,10 @@ mod test { "UsedNonPubError", "StructC", "StructA", + "UsedRecursiveRoot", + "UsedRecursiveNode", + "UsedRecursiveLeaf", + "UsedLeaf", ]; for name in used { if !filtered_names.contains(name) { @@ -22021,6 +27807,45 @@ mod test { } } } + if !filtered.iter().any(|e| { + #[allow(non_exhaustive_omitted_patterns)] + match e { + ScSpecEntry::UdtUnionV0(u) if u.name.to_utf8_string_lossy() == "Context" => true, + _ => false, + } + }) { + { + ::core::panicking::panic_fmt(format_args!( + "SDK auth Context should be retained as a reachable contract spec UDT", + )); + } + } + if !filtered.iter().any(|e| { + #[allow(non_exhaustive_omitted_patterns)] + match e { + ScSpecEntry::UdtStructV0(s) if s.name.to_utf8_string_lossy() == "Context" => true, + _ => false, + } + }) { + { + ::core::panicking::panic_fmt(format_args!( + "User-defined Context should be retained as a reachable contract spec UDT", + )); + } + } + match (&markers.len(), &9) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::None, + ); + } + } + }; let unused = [ "UnusedStruct", "UnusedEnum", @@ -22047,6 +27872,9 @@ mod test { "EventA", "EventB", "EventC", + "Executable", + "InvokerContractAuthEntry", + "SubContractInvocation", ]; let all_names: HashSet = entries.iter().filter_map(entry_name).collect(); @@ -22072,6 +27900,19 @@ mod test { } } } + match (&(all_names.len() - filtered_names.len()), &unused.len()) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::None, + ); + } + } + }; } /// Extract the name from a non-function spec entry. fn entry_name(entry: &ScSpecEntry) -> Option { diff --git a/tests-expanded/test_spec_shaking_v2_wasm32v1-none.rs b/tests-expanded/test_spec_shaking_v2_wasm32v1-none.rs index b063e0c8a..4be0b9c5f 100644 --- a/tests-expanded/test_spec_shaking_v2_wasm32v1-none.rs +++ b/tests-expanded/test_spec_shaking_v2_wasm32v1-none.rs @@ -5,8 +5,8 @@ extern crate core; #[prelude_import] use core::prelude::rust_2021::*; use soroban_sdk::{ - assert_with_error, contract, contracterror, contractevent, contractimpl, contracttype, - panic_with_error, Env, Map, Symbol, Vec, + assert_with_error, auth::CustomAccountInterface, contract, contracterror, contractevent, + contractimpl, contracttype, crypto::Hash, panic_with_error, Env, Map, Symbol, Vec, }; pub struct Contract; ///ContractArgs is a type for building arg lists for functions defined in "Contract". @@ -81,18 +81,19 @@ impl UsedParamStruct { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fUsedParamStruct\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x04\0\0\0\0\0\0\0\x06nested\0\0\0\0\x07\xd0\0\0\0\x12UsedNestedInStruct\0\0" } } -impl soroban_sdk::SpecShakingMarker for UsedParamStruct { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1X\x03\xf6t\xc7\xd0\x01\""; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedParamStruct { + const SPEC_TYPE_ID: [u8; 32] = *b"X\x03\xf6t\xc7\xd0\x01\"\x961\xf3\x1e\xad~\xda\xcc\xb4YQl\xb8N\x0f\x89&\x95m\x90\n\xab\xd4\xe3"; } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDPARAMSTRUCT: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 2, + *b"X\x03\xf6t\xc7\xd0\x01\"\x961\xf3\x1e\xad~\xda\xcc\xb4YQl\xb8N\x0f\x89&\x95m\x90\n\xab\xd4\xe3", + [::SPEC_TYPE_ID], +); impl soroban_sdk::TryFromVal for UsedParamStruct { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -145,6 +146,214 @@ impl soroban_sdk::TryFromVal for soroban_sdk <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } +pub struct UsedConstructorMeta { + pub val: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedConstructorMeta { + #[inline] + fn clone(&self) -> UsedConstructorMeta { + UsedConstructorMeta { + val: ::core::clone::Clone::clone(&self.val), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedConstructorMeta { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedConstructorMeta", + "val", + &&self.val, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedConstructorMeta { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedConstructorMeta {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedConstructorMeta { + #[inline] + fn eq(&self, other: &UsedConstructorMeta) -> bool { + self.val == other.val + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDCONSTRUCTORMETA: [u8; 56usize] = UsedConstructorMeta::spec_xdr(); +impl UsedConstructorMeta { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedConstructorMeta\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedConstructorMeta { + const SPEC_TYPE_ID: [u8; 32] = *b"6\xc8\x1co\xa3\xfa}e0\xac\x8c\x1c\x938\xca\xc9\xa2\x8c\x156\x97~\x0f\xb2GV\xad\xb7\x1a\x1bT\xaa"; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDCONSTRUCTORMETA: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"6\xc8\x1co\xa3\xfa}e0\xac\x8c\x1c\x938\xca\xc9\xa2\x8c\x156\x97~\x0f\xb2GV\xad\xb7\x1a\x1bT\xaa", + [], +); +impl soroban_sdk::TryFromVal for UsedConstructorMeta { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedConstructorMeta, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedConstructorMeta, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +pub struct Context { + pub val: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for Context { + #[inline] + fn clone(&self) -> Context { + Context { + val: ::core::clone::Clone::clone(&self.val), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for Context { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish(f, "Context", "val", &&self.val) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for Context { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for Context {} +#[automatically_derived] +impl ::core::cmp::PartialEq for Context { + #[inline] + fn eq(&self, other: &Context) -> bool { + self.val == other.val + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_CONTEXT: [u8; 44usize] = Context::spec_xdr(); +impl Context { + pub const fn spec_xdr() -> [u8; 44usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x07Context\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for Context { + const SPEC_TYPE_ID: [u8; 32] = + *b"\x86\xf7:L*\xf3\x0b\x94\xd8\x8bM1m\x13\xed\x8fJ}\xb4\xc1\x15u\xd0\xd3\xb6Xe\nj6\x84\""; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_CONTEXT: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\x86\xf7:L*\xf3\x0b\x94\xd8\x8bM1m\x13\xed\x8fJ}\xb4\xc1\x15u\xd0\xd3\xb6Xe\nj6\x84\"", + [], + ); +impl soroban_sdk::TryFromVal for Context { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &Context, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&Context, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} pub enum UsedReturnEnum { A(u32), B(i64), @@ -206,18 +415,19 @@ impl UsedReturnEnum { *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x0eUsedReturnEnum\0\0\0\0\0\x02\0\0\0\x01\0\0\0\0\0\0\0\x01A\0\0\0\0\0\0\x01\0\0\0\x04\0\0\0\x01\0\0\0\0\0\0\0\x01B\0\0\0\0\0\0\x01\0\0\0\x07" } } -impl soroban_sdk::SpecShakingMarker for UsedReturnEnum { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xe7\xcf\x9b1n\x15\x13\xfe"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedReturnEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"\xe7\xcf\x9b1n\x15\x13\xfe+*\x08\xd9L\x80\xdd\xef0\x8e\xe4\xcc\x12tD\xe3<\x80\xfc\x0b\t\x7fgc"; } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDRETURNENUM: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\xe7\xcf\x9b1n\x15\x13\xfe+*\x08\xd9L\x80\xdd\xef0\x8e\xe4\xcc\x12tD\xe3<\x80\xfc\x0b\t\x7fgc", + [], +); impl soroban_sdk::TryFromVal for UsedReturnEnum { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -349,16 +559,19 @@ impl UsedParamIntEnum { *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x10UsedParamIntEnum\0\0\0\x02\0\0\0\0\0\0\0\x01X\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01Y\0\0\0\0\0\0\x02" } } -impl soroban_sdk::SpecShakingMarker for UsedParamIntEnum { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xc2\xf4N\xbf\xebqvp"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedParamIntEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"\xc2\xf4N\xbf\xebqvp\xb8\xb6\xbe\t\x99\xef\xb0\xf8\xc1G\xfa;\x1c\xd1\x9bg\xb3\xdbS\x92\xf6\"-@"; } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDPARAMINTENUM: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\xc2\xf4N\xbf\xebqvp\xb8\xb6\xbe\t\x99\xef\xb0\xf8\xc1G\xfa;\x1c\xd1\x9bg\xb3\xdbS\x92\xf6\"-@", + [], +); impl soroban_sdk::TryFromVal for UsedParamIntEnum { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -449,7 +662,10 @@ impl UsedErrorEnum { *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\rUsedErrorEnum\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x08NotFound\0\0\0\x01\0\0\0\0\0\0\0\x07Invalid\0\0\0\0\x02" } } -impl soroban_sdk::SpecShakingMarker for UsedErrorEnum { +impl soroban_sdk::spec_shaking::SpecTypeId for UsedErrorEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"Hh\xdc\xaaa\x8d\xf7\re\xda\x8d\xd7\x15\x1b\xfb\x07v\x9e\x94}\x06\x18\x88\xf7{\xcc\xb0C\xcb\xa3\xb6~"; +} +impl soroban_sdk::spec_shaking::SpecShakingMarker for UsedErrorEnum { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() { @@ -459,6 +675,16 @@ impl soroban_sdk::SpecShakingMarker for UsedErrorEnum { } } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDERRORENUM: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"Hh\xdc\xaaa\x8d\xf7\re\xda\x8d\xd7\x15\x1b\xfb\x07v\x9e\x94}\x06\x18\x88\xf7{\xcc\xb0C\xcb\xa3\xb6~", + [], +); impl TryFrom for UsedErrorEnum { type Error = soroban_sdk::Error; #[inline(always)] @@ -566,66 +792,88 @@ impl soroban_sdk::TryFromVal for soroban_sdk:: <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub enum UsedPanicErrorEnum { - Boom = 1, +pub enum UsedAuthErrorEnum { + NotFound = 1, + Invalid = 2, } #[automatically_derived] -impl ::core::marker::Copy for UsedPanicErrorEnum {} +impl ::core::marker::Copy for UsedAuthErrorEnum {} #[automatically_derived] -impl ::core::clone::Clone for UsedPanicErrorEnum { +impl ::core::clone::Clone for UsedAuthErrorEnum { #[inline] - fn clone(&self) -> UsedPanicErrorEnum { + fn clone(&self) -> UsedAuthErrorEnum { *self } } #[automatically_derived] -impl ::core::fmt::Debug for UsedPanicErrorEnum { +impl ::core::fmt::Debug for UsedAuthErrorEnum { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str(f, "Boom") + ::core::fmt::Formatter::write_str( + f, + match self { + UsedAuthErrorEnum::NotFound => "NotFound", + UsedAuthErrorEnum::Invalid => "Invalid", + }, + ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedPanicErrorEnum { +impl ::core::cmp::Eq for UsedAuthErrorEnum { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () {} } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedPanicErrorEnum {} +impl ::core::marker::StructuralPartialEq for UsedAuthErrorEnum {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedPanicErrorEnum { +impl ::core::cmp::PartialEq for UsedAuthErrorEnum { #[inline] - fn eq(&self, other: &UsedPanicErrorEnum) -> bool { - true + fn eq(&self, other: &UsedAuthErrorEnum) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDPANICERRORENUM: [u8; 56usize] = UsedPanicErrorEnum::spec_xdr(); -impl UsedPanicErrorEnum { - pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x12UsedPanicErrorEnum\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04Boom\0\0\0\x01" +pub static __SPEC_XDR_TYPE_USEDAUTHERRORENUM: [u8; 80usize] = UsedAuthErrorEnum::spec_xdr(); +impl UsedAuthErrorEnum { + pub const fn spec_xdr() -> [u8; 80usize] { + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x11UsedAuthErrorEnum\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x08NotFound\0\0\0\x01\0\0\0\0\0\0\0\x07Invalid\0\0\0\0\x02" } } -impl soroban_sdk::SpecShakingMarker for UsedPanicErrorEnum { +impl soroban_sdk::spec_shaking::SpecTypeId for UsedAuthErrorEnum { + const SPEC_TYPE_ID: [u8; 32] = + *b"=V\x92A(\x981\x88\xf58\xbe\x9e5*+\xf5>J\x9c\x88&\x1a\xd7\x86S\xdc\xf8\xffz'\xf5\xd3"; +} +impl soroban_sdk::spec_shaking::SpecShakingMarker for UsedAuthErrorEnum { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() { { - static MARKER: [u8; 14usize] = *b"SpEcV1\r\xb76\xae\x93D\xef\x1a"; + static MARKER: [u8; 14usize] = *b"SpEcV1=V\x92A(\x981\x88"; let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; } } } -impl TryFrom for UsedPanicErrorEnum { +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDAUTHERRORENUM: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"=V\x92A(\x981\x88\xf58\xbe\x9e5*+\xf5>J\x9c\x88&\x1a\xd7\x86S\xdc\xf8\xffz'\xf5\xd3", + [], + ); +impl TryFrom for UsedAuthErrorEnum { type Error = soroban_sdk::Error; #[inline(always)] fn try_from(error: soroban_sdk::Error) -> Result { if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { let discriminant = error.get_code(); Ok(match discriminant { - 1u32 => Self::Boom, + 1u32 => Self::NotFound, + 2u32 => Self::Invalid, _ => return Err(error), }) } else { @@ -633,62 +881,65 @@ impl TryFrom for UsedPanicErrorEnum { } } } -impl TryFrom<&soroban_sdk::Error> for UsedPanicErrorEnum { +impl TryFrom<&soroban_sdk::Error> for UsedAuthErrorEnum { type Error = soroban_sdk::Error; #[inline(always)] fn try_from(error: &soroban_sdk::Error) -> Result { <_ as TryFrom>::try_from(*error) } } -impl From for soroban_sdk::Error { +impl From for soroban_sdk::Error { #[inline(always)] - fn from(val: UsedPanicErrorEnum) -> soroban_sdk::Error { - <_ as From<&UsedPanicErrorEnum>>::from(&val) + fn from(val: UsedAuthErrorEnum) -> soroban_sdk::Error { + <_ as From<&UsedAuthErrorEnum>>::from(&val) } } -impl From<&UsedPanicErrorEnum> for soroban_sdk::Error { +impl From<&UsedAuthErrorEnum> for soroban_sdk::Error { #[inline(always)] - fn from(val: &UsedPanicErrorEnum) -> soroban_sdk::Error { + fn from(val: &UsedAuthErrorEnum) -> soroban_sdk::Error { match val { - UsedPanicErrorEnum::Boom => soroban_sdk::Error::from_contract_error(1u32), + UsedAuthErrorEnum::NotFound => soroban_sdk::Error::from_contract_error(1u32), + UsedAuthErrorEnum::Invalid => soroban_sdk::Error::from_contract_error(2u32), } } } -impl TryFrom for UsedPanicErrorEnum { +impl TryFrom for UsedAuthErrorEnum { type Error = soroban_sdk::InvokeError; #[inline(always)] fn try_from(error: soroban_sdk::InvokeError) -> Result { match error { soroban_sdk::InvokeError::Abort => Err(error), soroban_sdk::InvokeError::Contract(code) => Ok(match code { - 1u32 => Self::Boom, + 1u32 => Self::NotFound, + 2u32 => Self::Invalid, _ => return Err(error), }), } } } -impl TryFrom<&soroban_sdk::InvokeError> for UsedPanicErrorEnum { +impl TryFrom<&soroban_sdk::InvokeError> for UsedAuthErrorEnum { type Error = soroban_sdk::InvokeError; #[inline(always)] fn try_from(error: &soroban_sdk::InvokeError) -> Result { <_ as TryFrom>::try_from(*error) } } -impl From for soroban_sdk::InvokeError { +impl From for soroban_sdk::InvokeError { #[inline(always)] - fn from(val: UsedPanicErrorEnum) -> soroban_sdk::InvokeError { - <_ as From<&UsedPanicErrorEnum>>::from(&val) + fn from(val: UsedAuthErrorEnum) -> soroban_sdk::InvokeError { + <_ as From<&UsedAuthErrorEnum>>::from(&val) } } -impl From<&UsedPanicErrorEnum> for soroban_sdk::InvokeError { +impl From<&UsedAuthErrorEnum> for soroban_sdk::InvokeError { #[inline(always)] - fn from(val: &UsedPanicErrorEnum) -> soroban_sdk::InvokeError { + fn from(val: &UsedAuthErrorEnum) -> soroban_sdk::InvokeError { match val { - UsedPanicErrorEnum::Boom => soroban_sdk::InvokeError::Contract(1u32), + UsedAuthErrorEnum::NotFound => soroban_sdk::InvokeError::Contract(1u32), + UsedAuthErrorEnum::Invalid => soroban_sdk::InvokeError::Contract(2u32), } } } -impl soroban_sdk::TryFromVal for UsedPanicErrorEnum { +impl soroban_sdk::TryFromVal for UsedAuthErrorEnum { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( @@ -700,89 +951,100 @@ impl soroban_sdk::TryFromVal for UsedPanicEr error.try_into().map_err(|_| soroban_sdk::ConversionError) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedPanicErrorEnum, + val: &UsedAuthErrorEnum, ) -> Result { let error: soroban_sdk::Error = val.into(); Ok(error.into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedPanicErrorEnum, + val: &&UsedAuthErrorEnum, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub enum UsedAssertErrorEnum { - Bad = 1, +pub enum UsedPanicErrorEnum { + Boom = 1, } #[automatically_derived] -impl ::core::marker::Copy for UsedAssertErrorEnum {} +impl ::core::marker::Copy for UsedPanicErrorEnum {} #[automatically_derived] -impl ::core::clone::Clone for UsedAssertErrorEnum { +impl ::core::clone::Clone for UsedPanicErrorEnum { #[inline] - fn clone(&self) -> UsedAssertErrorEnum { + fn clone(&self) -> UsedPanicErrorEnum { *self } } #[automatically_derived] -impl ::core::fmt::Debug for UsedAssertErrorEnum { +impl ::core::fmt::Debug for UsedPanicErrorEnum { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str(f, "Bad") + ::core::fmt::Formatter::write_str(f, "Boom") } } #[automatically_derived] -impl ::core::cmp::Eq for UsedAssertErrorEnum { +impl ::core::cmp::Eq for UsedPanicErrorEnum { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () {} } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedAssertErrorEnum {} +impl ::core::marker::StructuralPartialEq for UsedPanicErrorEnum {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedAssertErrorEnum { +impl ::core::cmp::PartialEq for UsedPanicErrorEnum { #[inline] - fn eq(&self, other: &UsedAssertErrorEnum) -> bool { + fn eq(&self, other: &UsedPanicErrorEnum) -> bool { true } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDASSERTERRORENUM: [u8; 56usize] = UsedAssertErrorEnum::spec_xdr(); -impl UsedAssertErrorEnum { +pub static __SPEC_XDR_TYPE_USEDPANICERRORENUM: [u8; 56usize] = UsedPanicErrorEnum::spec_xdr(); +impl UsedPanicErrorEnum { pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x13UsedAssertErrorEnum\0\0\0\0\x01\0\0\0\0\0\0\0\x03Bad\0\0\0\0\x01" + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x12UsedPanicErrorEnum\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04Boom\0\0\0\x01" } } -impl soroban_sdk::SpecShakingMarker for UsedAssertErrorEnum { +impl soroban_sdk::spec_shaking::SpecTypeId for UsedPanicErrorEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"\r\xb76\xae\x93D\xef\x1aa\xb8\x95\x90\xd0\x15\xf7\x9aq]\x18w\x11\x92-\x99\x8e\n\x11\xfe\xe2sdQ"; +} +impl soroban_sdk::spec_shaking::SpecShakingMarker for UsedPanicErrorEnum { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() { { - static MARKER: [u8; 14usize] = *b"SpEcV1\x8b\x89\x1f#\xbd\x157\xf4"; + static MARKER: [u8; 14usize] = *b"SpEcV1\r\xb76\xae\x93D\xef\x1a"; let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; } } } -impl TryFrom for UsedAssertErrorEnum { +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDPANICERRORENUM: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\r\xb76\xae\x93D\xef\x1aa\xb8\x95\x90\xd0\x15\xf7\x9aq]\x18w\x11\x92-\x99\x8e\n\x11\xfe\xe2sdQ", + [], +); +impl TryFrom for UsedPanicErrorEnum { type Error = soroban_sdk::Error; #[inline(always)] fn try_from(error: soroban_sdk::Error) -> Result { if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { let discriminant = error.get_code(); Ok(match discriminant { - 1u32 => Self::Bad, + 1u32 => Self::Boom, _ => return Err(error), }) } else { @@ -790,62 +1052,62 @@ impl TryFrom for UsedAssertErrorEnum { } } } -impl TryFrom<&soroban_sdk::Error> for UsedAssertErrorEnum { +impl TryFrom<&soroban_sdk::Error> for UsedPanicErrorEnum { type Error = soroban_sdk::Error; #[inline(always)] fn try_from(error: &soroban_sdk::Error) -> Result { <_ as TryFrom>::try_from(*error) } } -impl From for soroban_sdk::Error { +impl From for soroban_sdk::Error { #[inline(always)] - fn from(val: UsedAssertErrorEnum) -> soroban_sdk::Error { - <_ as From<&UsedAssertErrorEnum>>::from(&val) + fn from(val: UsedPanicErrorEnum) -> soroban_sdk::Error { + <_ as From<&UsedPanicErrorEnum>>::from(&val) } } -impl From<&UsedAssertErrorEnum> for soroban_sdk::Error { +impl From<&UsedPanicErrorEnum> for soroban_sdk::Error { #[inline(always)] - fn from(val: &UsedAssertErrorEnum) -> soroban_sdk::Error { + fn from(val: &UsedPanicErrorEnum) -> soroban_sdk::Error { match val { - UsedAssertErrorEnum::Bad => soroban_sdk::Error::from_contract_error(1u32), + UsedPanicErrorEnum::Boom => soroban_sdk::Error::from_contract_error(1u32), } } } -impl TryFrom for UsedAssertErrorEnum { +impl TryFrom for UsedPanicErrorEnum { type Error = soroban_sdk::InvokeError; #[inline(always)] fn try_from(error: soroban_sdk::InvokeError) -> Result { match error { soroban_sdk::InvokeError::Abort => Err(error), soroban_sdk::InvokeError::Contract(code) => Ok(match code { - 1u32 => Self::Bad, + 1u32 => Self::Boom, _ => return Err(error), }), } } } -impl TryFrom<&soroban_sdk::InvokeError> for UsedAssertErrorEnum { +impl TryFrom<&soroban_sdk::InvokeError> for UsedPanicErrorEnum { type Error = soroban_sdk::InvokeError; #[inline(always)] fn try_from(error: &soroban_sdk::InvokeError) -> Result { <_ as TryFrom>::try_from(*error) } } -impl From for soroban_sdk::InvokeError { +impl From for soroban_sdk::InvokeError { #[inline(always)] - fn from(val: UsedAssertErrorEnum) -> soroban_sdk::InvokeError { - <_ as From<&UsedAssertErrorEnum>>::from(&val) + fn from(val: UsedPanicErrorEnum) -> soroban_sdk::InvokeError { + <_ as From<&UsedPanicErrorEnum>>::from(&val) } } -impl From<&UsedAssertErrorEnum> for soroban_sdk::InvokeError { +impl From<&UsedPanicErrorEnum> for soroban_sdk::InvokeError { #[inline(always)] - fn from(val: &UsedAssertErrorEnum) -> soroban_sdk::InvokeError { + fn from(val: &UsedPanicErrorEnum) -> soroban_sdk::InvokeError { match val { - UsedAssertErrorEnum::Bad => soroban_sdk::InvokeError::Contract(1u32), + UsedPanicErrorEnum::Boom => soroban_sdk::InvokeError::Contract(1u32), } } } -impl soroban_sdk::TryFromVal for UsedAssertErrorEnum { +impl soroban_sdk::TryFromVal for UsedPanicErrorEnum { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( @@ -857,296 +1119,335 @@ impl soroban_sdk::TryFromVal for UsedAssertE error.try_into().map_err(|_| soroban_sdk::ConversionError) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedAssertErrorEnum, + val: &UsedPanicErrorEnum, ) -> Result { let error: soroban_sdk::Error = val.into(); Ok(error.into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedAssertErrorEnum, + val: &&UsedPanicErrorEnum, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( + <_ as soroban_sdk::TryFromVal>::try_from_val( env, *val, ) } } -pub struct UsedNestedInStruct { - pub val: i64, +pub enum UsedPanicErrorEnumRef { + Boom = 1, } #[automatically_derived] -impl ::core::clone::Clone for UsedNestedInStruct { +impl ::core::marker::Copy for UsedPanicErrorEnumRef {} +#[automatically_derived] +impl ::core::clone::Clone for UsedPanicErrorEnumRef { #[inline] - fn clone(&self) -> UsedNestedInStruct { - UsedNestedInStruct { - val: ::core::clone::Clone::clone(&self.val), - } + fn clone(&self) -> UsedPanicErrorEnumRef { + *self } } #[automatically_derived] -impl ::core::fmt::Debug for UsedNestedInStruct { +impl ::core::fmt::Debug for UsedPanicErrorEnumRef { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( - f, - "UsedNestedInStruct", - "val", - &&self.val, - ) + ::core::fmt::Formatter::write_str(f, "Boom") } } #[automatically_derived] -impl ::core::cmp::Eq for UsedNestedInStruct { +impl ::core::cmp::Eq for UsedPanicErrorEnumRef { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - } + fn assert_receiver_is_total_eq(&self) -> () {} } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedNestedInStruct {} +impl ::core::marker::StructuralPartialEq for UsedPanicErrorEnumRef {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedNestedInStruct { +impl ::core::cmp::PartialEq for UsedPanicErrorEnumRef { #[inline] - fn eq(&self, other: &UsedNestedInStruct) -> bool { - self.val == other.val + fn eq(&self, other: &UsedPanicErrorEnumRef) -> bool { + true } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDNESTEDINSTRUCT: [u8; 56usize] = UsedNestedInStruct::spec_xdr(); -impl UsedNestedInStruct { - pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedNestedInStruct\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x07" +pub static __SPEC_XDR_TYPE_USEDPANICERRORENUMREF: [u8; 60usize] = UsedPanicErrorEnumRef::spec_xdr(); +impl UsedPanicErrorEnumRef { + pub const fn spec_xdr() -> [u8; 60usize] { + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x15UsedPanicErrorEnumRef\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04Boom\0\0\0\x01" } } -impl soroban_sdk::SpecShakingMarker for UsedNestedInStruct { +impl soroban_sdk::spec_shaking::SpecTypeId for UsedPanicErrorEnumRef { + const SPEC_TYPE_ID: [u8; 32] = *b"!v\x9b\xbb<\xd2\x9f\xc9\xfd|\x8e\xd7\x8f`\x80\xf9M\x8e\xb8\x98*l\xbfx\xce\xaa\xa6\n;i\x96x"; +} +impl soroban_sdk::spec_shaking::SpecShakingMarker for UsedPanicErrorEnumRef { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() { - ::spec_shaking_marker(); { - static MARKER: [u8; 14usize] = *b"SpEcV1\x84\x08Y\xae\xa0\xf128"; + static MARKER: [u8; 14usize] = *b"SpEcV1!v\x9b\xbb<\xd2\x9f\xc9"; let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; } } } -impl soroban_sdk::TryFromVal for UsedNestedInStruct { - type Error = soroban_sdk::ConversionError; - fn try_from_val( - env: &soroban_sdk::Env, - val: &soroban_sdk::Val, - ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; - let map: MapObject = val.try_into().map_err(|_| ConversionError)?; - env.map_unpack_to_slice(map, &KEYS, &mut vals) - .map_err(|_| ConversionError)?; - Ok(Self { - val: vals[0] - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?, - }) +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDPANICERRORENUMREF: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"!v\x9b\xbb<\xd2\x9f\xc9\xfd|\x8e\xd7\x8f`\x80\xf9M\x8e\xb8\x98*l\xbfx\xce\xaa\xa6\n;i\x96x", + [], +); +impl TryFrom for UsedPanicErrorEnumRef { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: soroban_sdk::Error) -> Result { + if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { + let discriminant = error.get_code(); + Ok(match discriminant { + 1u32 => Self::Boom, + _ => return Err(error), + }) + } else { + Err(error) + } } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; - fn try_from_val( - env: &soroban_sdk::Env, - val: &UsedNestedInStruct, - ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; - Ok(env - .map_new_from_slices(&KEYS, &vals) - .map_err(|_| ConversionError)? - .into()) +impl TryFrom<&soroban_sdk::Error> for UsedPanicErrorEnumRef { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: &soroban_sdk::Error) -> Result { + <_ as TryFrom>::try_from(*error) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; +impl From for soroban_sdk::Error { #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &&UsedNestedInStruct, - ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) + fn from(val: UsedPanicErrorEnumRef) -> soroban_sdk::Error { + <_ as From<&UsedPanicErrorEnumRef>>::from(&val) } } -pub struct UsedVecElement { - pub data: u32, -} -#[automatically_derived] -impl ::core::clone::Clone for UsedVecElement { - #[inline] - fn clone(&self) -> UsedVecElement { - UsedVecElement { - data: ::core::clone::Clone::clone(&self.data), +impl From<&UsedPanicErrorEnumRef> for soroban_sdk::Error { + #[inline(always)] + fn from(val: &UsedPanicErrorEnumRef) -> soroban_sdk::Error { + match val { + UsedPanicErrorEnumRef::Boom => soroban_sdk::Error::from_contract_error(1u32), } } } -#[automatically_derived] -impl ::core::fmt::Debug for UsedVecElement { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedVecElement", "data", &&self.data) - } -} -#[automatically_derived] -impl ::core::cmp::Eq for UsedVecElement { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; +impl TryFrom for UsedPanicErrorEnumRef { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: soroban_sdk::InvokeError) -> Result { + match error { + soroban_sdk::InvokeError::Abort => Err(error), + soroban_sdk::InvokeError::Contract(code) => Ok(match code { + 1u32 => Self::Boom, + _ => return Err(error), + }), + } } } -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedVecElement {} -#[automatically_derived] -impl ::core::cmp::PartialEq for UsedVecElement { - #[inline] - fn eq(&self, other: &UsedVecElement) -> bool { - self.data == other.data +impl TryFrom<&soroban_sdk::InvokeError> for UsedPanicErrorEnumRef { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: &soroban_sdk::InvokeError) -> Result { + <_ as TryFrom>::try_from(*error) } } -#[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDVECELEMENT: [u8; 52usize] = UsedVecElement::spec_xdr(); -impl UsedVecElement { - pub const fn spec_xdr() -> [u8; 52usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0eUsedVecElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" +impl From for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: UsedPanicErrorEnumRef) -> soroban_sdk::InvokeError { + <_ as From<&UsedPanicErrorEnumRef>>::from(&val) } } -impl soroban_sdk::SpecShakingMarker for UsedVecElement { - #[doc(hidden)] +impl From<&UsedPanicErrorEnumRef> for soroban_sdk::InvokeError { #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xe2\x01y\xc9\x9a\xf8\xedt"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; + fn from(val: &UsedPanicErrorEnumRef) -> soroban_sdk::InvokeError { + match val { + UsedPanicErrorEnumRef::Boom => soroban_sdk::InvokeError::Contract(1u32), } } } -impl soroban_sdk::TryFromVal for UsedVecElement { +impl soroban_sdk::TryFromVal for UsedPanicErrorEnumRef { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; - let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; - let map: MapObject = val.try_into().map_err(|_| ConversionError)?; - env.map_unpack_to_slice(map, &KEYS, &mut vals) - .map_err(|_| ConversionError)?; - Ok(Self { - data: vals[0] - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?, - }) + use soroban_sdk::TryIntoVal; + let error: soroban_sdk::Error = val.try_into_val(env)?; + error.try_into().map_err(|_| soroban_sdk::ConversionError) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedVecElement, + val: &UsedPanicErrorEnumRef, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; - let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; - Ok(env - .map_new_from_slices(&KEYS, &vals) - .map_err(|_| ConversionError)? - .into()) + let error: soroban_sdk::Error = val.into(); + Ok(error.into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedVecElement, + val: &&UsedPanicErrorEnumRef, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) } } -pub enum UsedMapKey { - K1 = 1, - K2 = 2, +pub enum UsedAssertErrorEnum { + Bad = 1, } #[automatically_derived] -impl ::core::marker::Copy for UsedMapKey {} +impl ::core::marker::Copy for UsedAssertErrorEnum {} #[automatically_derived] -impl ::core::clone::Clone for UsedMapKey { +impl ::core::clone::Clone for UsedAssertErrorEnum { #[inline] - fn clone(&self) -> UsedMapKey { + fn clone(&self) -> UsedAssertErrorEnum { *self } } #[automatically_derived] -impl ::core::fmt::Debug for UsedMapKey { +impl ::core::fmt::Debug for UsedAssertErrorEnum { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( - f, - match self { - UsedMapKey::K1 => "K1", - UsedMapKey::K2 => "K2", - }, - ) + ::core::fmt::Formatter::write_str(f, "Bad") } } #[automatically_derived] -impl ::core::cmp::Eq for UsedMapKey { +impl ::core::cmp::Eq for UsedAssertErrorEnum { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () {} } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedMapKey {} +impl ::core::marker::StructuralPartialEq for UsedAssertErrorEnum {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedMapKey { +impl ::core::cmp::PartialEq for UsedAssertErrorEnum { #[inline] - fn eq(&self, other: &UsedMapKey) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr + fn eq(&self, other: &UsedAssertErrorEnum) -> bool { + true } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDMAPKEY: [u8; 64usize] = UsedMapKey::spec_xdr(); -impl UsedMapKey { - pub const fn spec_xdr() -> [u8; 64usize] { - *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\nUsedMapKey\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02K1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02K2\0\0\0\0\0\x02" +pub static __SPEC_XDR_TYPE_USEDASSERTERRORENUM: [u8; 56usize] = UsedAssertErrorEnum::spec_xdr(); +impl UsedAssertErrorEnum { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x13UsedAssertErrorEnum\0\0\0\0\x01\0\0\0\0\0\0\0\x03Bad\0\0\0\0\x01" } } -impl soroban_sdk::SpecShakingMarker for UsedMapKey { +impl soroban_sdk::spec_shaking::SpecTypeId for UsedAssertErrorEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"\x8b\x89\x1f#\xbd\x157\xf4Gx\xa2a\x0ehQ\xe4\xdd\x02O0\x0b\x96\xeb\x0f\xb6\0\xa3\x91)\xf9;\x19"; +} +impl soroban_sdk::spec_shaking::SpecShakingMarker for UsedAssertErrorEnum { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() { { - static MARKER: [u8; 14usize] = *b"SpEcV1[\xf4R\xdf\xdd\xb4\xb0\xbc"; + static MARKER: [u8; 14usize] = *b"SpEcV1\x8b\x89\x1f#\xbd\x157\xf4"; let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; } } } -impl soroban_sdk::TryFromVal for UsedMapKey { +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDASSERTERRORENUM: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\x8b\x89\x1f#\xbd\x157\xf4Gx\xa2a\x0ehQ\xe4\xdd\x02O0\x0b\x96\xeb\x0f\xb6\0\xa3\x91)\xf9;\x19", + [], +); +impl TryFrom for UsedAssertErrorEnum { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: soroban_sdk::Error) -> Result { + if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { + let discriminant = error.get_code(); + Ok(match discriminant { + 1u32 => Self::Bad, + _ => return Err(error), + }) + } else { + Err(error) + } + } +} +impl TryFrom<&soroban_sdk::Error> for UsedAssertErrorEnum { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: &soroban_sdk::Error) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::Error { + #[inline(always)] + fn from(val: UsedAssertErrorEnum) -> soroban_sdk::Error { + <_ as From<&UsedAssertErrorEnum>>::from(&val) + } +} +impl From<&UsedAssertErrorEnum> for soroban_sdk::Error { + #[inline(always)] + fn from(val: &UsedAssertErrorEnum) -> soroban_sdk::Error { + match val { + UsedAssertErrorEnum::Bad => soroban_sdk::Error::from_contract_error(1u32), + } + } +} +impl TryFrom for UsedAssertErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: soroban_sdk::InvokeError) -> Result { + match error { + soroban_sdk::InvokeError::Abort => Err(error), + soroban_sdk::InvokeError::Contract(code) => Ok(match code { + 1u32 => Self::Bad, + _ => return Err(error), + }), + } + } +} +impl TryFrom<&soroban_sdk::InvokeError> for UsedAssertErrorEnum { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: &soroban_sdk::InvokeError) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: UsedAssertErrorEnum) -> soroban_sdk::InvokeError { + <_ as From<&UsedAssertErrorEnum>>::from(&val) + } +} +impl From<&UsedAssertErrorEnum> for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: &UsedAssertErrorEnum) -> soroban_sdk::InvokeError { + match val { + UsedAssertErrorEnum::Bad => soroban_sdk::InvokeError::Contract(1u32), + } + } +} +impl soroban_sdk::TryFromVal for UsedAssertErrorEnum { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( @@ -1154,162 +1455,162 @@ impl soroban_sdk::TryFromVal for UsedMapKey val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::TryIntoVal; - let discriminant: u32 = val.try_into_val(env)?; - Ok(match discriminant { - 1u32 => Self::K1, - 2u32 => Self::K2, - _ => Err(soroban_sdk::ConversionError {})?, - }) + let error: soroban_sdk::Error = val.try_into_val(env)?; + error.try_into().map_err(|_| soroban_sdk::ConversionError) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedMapKey, + val: &UsedAssertErrorEnum, ) -> Result { - Ok(match val { - UsedMapKey::K1 => 1u32.into(), - UsedMapKey::K2 => 2u32.into(), - }) + let error: soroban_sdk::Error = val.into(); + Ok(error.into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedMapKey, + val: &&UsedAssertErrorEnum, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) } } -pub struct UsedMapVal { - pub v: u32, +pub struct UsedNestedInStruct { + pub val: i64, } #[automatically_derived] -impl ::core::clone::Clone for UsedMapVal { +impl ::core::clone::Clone for UsedNestedInStruct { #[inline] - fn clone(&self) -> UsedMapVal { - UsedMapVal { - v: ::core::clone::Clone::clone(&self.v), + fn clone(&self) -> UsedNestedInStruct { + UsedNestedInStruct { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedMapVal { +impl ::core::fmt::Debug for UsedNestedInStruct { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedMapVal", "v", &&self.v) + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedNestedInStruct", + "val", + &&self.val, + ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedMapVal { +impl ::core::cmp::Eq for UsedNestedInStruct { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedMapVal {} +impl ::core::marker::StructuralPartialEq for UsedNestedInStruct {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedMapVal { +impl ::core::cmp::PartialEq for UsedNestedInStruct { #[inline] - fn eq(&self, other: &UsedMapVal) -> bool { - self.v == other.v + fn eq(&self, other: &UsedNestedInStruct) -> bool { + self.val == other.val } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDMAPVAL: [u8; 48usize] = UsedMapVal::spec_xdr(); -impl UsedMapVal { - pub const fn spec_xdr() -> [u8; 48usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\nUsedMapVal\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDNESTEDINSTRUCT: [u8; 56usize] = UsedNestedInStruct::spec_xdr(); +impl UsedNestedInStruct { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedNestedInStruct\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x07" } } -impl soroban_sdk::SpecShakingMarker for UsedMapVal { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xaaX8\xde\xef\xbb6%"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedNestedInStruct { + const SPEC_TYPE_ID: [u8; 32] = *b"\x84\x08Y\xae\xa0\xf128\x93a\xcd\xa3\x96yv\rTB\xfb/\x85\xee\x8e?\x01\x9fp\x91\x01U\x12\x83"; } -impl soroban_sdk::TryFromVal for UsedMapVal { +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDNESTEDINSTRUCT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\x84\x08Y\xae\xa0\xf128\x93a\xcd\xa3\x96yv\rTB\xfb/\x85\xee\x8e?\x01\x9fp\x91\x01U\x12\x83", + [], +); +impl soroban_sdk::TryFromVal for UsedNestedInStruct { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["v"]; + const KEYS: [&'static str; 1usize] = ["val"]; let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - v: vals[0] + val: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedMapVal, + val: &UsedNestedInStruct, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["v"]; - let vals: [Val; 1usize] = [(&val.v).try_into_val(env).map_err(|_| ConversionError)?]; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedMapVal, + val: &&UsedNestedInStruct, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) } } -pub struct UsedOptionElement { +pub struct UsedVecElement { pub data: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedOptionElement { +impl ::core::clone::Clone for UsedVecElement { #[inline] - fn clone(&self) -> UsedOptionElement { - UsedOptionElement { + fn clone(&self) -> UsedVecElement { + UsedVecElement { data: ::core::clone::Clone::clone(&self.data), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedOptionElement { +impl ::core::fmt::Debug for UsedVecElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( - f, - "UsedOptionElement", - "data", - &&self.data, - ) + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedVecElement", "data", &&self.data) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedOptionElement { +impl ::core::cmp::Eq for UsedVecElement { #[inline] #[doc(hidden)] #[coverage(off)] @@ -1318,33 +1619,34 @@ impl ::core::cmp::Eq for UsedOptionElement { } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedOptionElement {} +impl ::core::marker::StructuralPartialEq for UsedVecElement {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedOptionElement { +impl ::core::cmp::PartialEq for UsedVecElement { #[inline] - fn eq(&self, other: &UsedOptionElement) -> bool { + fn eq(&self, other: &UsedVecElement) -> bool { self.data == other.data } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDOPTIONELEMENT: [u8; 56usize] = UsedOptionElement::spec_xdr(); -impl UsedOptionElement { - pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedOptionElement\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDVECELEMENT: [u8; 52usize] = UsedVecElement::spec_xdr(); +impl UsedVecElement { + pub const fn spec_xdr() -> [u8; 52usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0eUsedVecElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UsedOptionElement { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xb3/\x97\xd5\x06\xbd3B"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedVecElement { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xe2\x01y\xc9\x9a\xf8\xedt%\xbcu\xa0\x89 \xbc \x8e\xa2!\xe5H\xa5\xf6r\xa9DK6/\xe7]6"; } -impl soroban_sdk::TryFromVal for UsedOptionElement { +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDVECELEMENT: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xe2\x01y\xc9\x9a\xf8\xedt%\xbcu\xa0\x89 \xbc \x8e\xa2!\xe5H\xa5\xf6r\xa9DK6/\xe7]6", + [], + ); +impl soroban_sdk::TryFromVal for UsedVecElement { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -1363,11 +1665,11 @@ impl soroban_sdk::TryFromVal for UsedOptionE }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedOptionElement, + val: &UsedVecElement, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["data"]; @@ -1378,431 +1680,452 @@ impl soroban_sdk::TryFromVal for soroban_sd .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedOptionElement, + val: &&UsedVecElement, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub struct UsedResultOk { - pub data: u32, +pub enum UsedMapKey { + K1 = 1, + K2 = 2, } #[automatically_derived] -impl ::core::clone::Clone for UsedResultOk { +impl ::core::marker::Copy for UsedMapKey {} +#[automatically_derived] +impl ::core::clone::Clone for UsedMapKey { #[inline] - fn clone(&self) -> UsedResultOk { - UsedResultOk { - data: ::core::clone::Clone::clone(&self.data), - } + fn clone(&self) -> UsedMapKey { + *self } } #[automatically_derived] -impl ::core::fmt::Debug for UsedResultOk { +impl ::core::fmt::Debug for UsedMapKey { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedResultOk", "data", &&self.data) + ::core::fmt::Formatter::write_str( + f, + match self { + UsedMapKey::K1 => "K1", + UsedMapKey::K2 => "K2", + }, + ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedResultOk { +impl ::core::cmp::Eq for UsedMapKey { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - } + fn assert_receiver_is_total_eq(&self) -> () {} } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedResultOk {} +impl ::core::marker::StructuralPartialEq for UsedMapKey {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedResultOk { +impl ::core::cmp::PartialEq for UsedMapKey { #[inline] - fn eq(&self, other: &UsedResultOk) -> bool { - self.data == other.data + fn eq(&self, other: &UsedMapKey) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDRESULTOK: [u8; 48usize] = UsedResultOk::spec_xdr(); -impl UsedResultOk { - pub const fn spec_xdr() -> [u8; 48usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0cUsedResultOk\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" +pub static __SPEC_XDR_TYPE_USEDMAPKEY: [u8; 64usize] = UsedMapKey::spec_xdr(); +impl UsedMapKey { + pub const fn spec_xdr() -> [u8; 64usize] { + *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\nUsedMapKey\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02K1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02K2\0\0\0\0\0\x02" } } -impl soroban_sdk::SpecShakingMarker for UsedResultOk { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1k\xe4zxB\xd1+\x02"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedMapKey { + const SPEC_TYPE_ID: [u8; 32] = *b"[\xf4R\xdf\xdd\xb4\xb0\xbc\xe0\x96b:H\xc4\xda\xe4'\xee@\xd9\x1e\xf5!\x8aa\xf3hT$\xad\0\xcd"; } -impl soroban_sdk::TryFromVal for UsedResultOk { +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDMAPKEY: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"[\xf4R\xdf\xdd\xb4\xb0\xbc\xe0\x96b:H\xc4\xda\xe4'\xee@\xd9\x1e\xf5!\x8aa\xf3hT$\xad\0\xcd", + [], +); +impl soroban_sdk::TryFromVal for UsedMapKey { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; - let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; - let map: MapObject = val.try_into().map_err(|_| ConversionError)?; - env.map_unpack_to_slice(map, &KEYS, &mut vals) - .map_err(|_| ConversionError)?; - Ok(Self { - data: vals[0] - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?, + use soroban_sdk::TryIntoVal; + let discriminant: u32 = val.try_into_val(env)?; + Ok(match discriminant { + 1u32 => Self::K1, + 2u32 => Self::K2, + _ => Err(soroban_sdk::ConversionError {})?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedResultOk, + val: &UsedMapKey, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["data"]; - let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; - Ok(env - .map_new_from_slices(&KEYS, &vals) - .map_err(|_| ConversionError)? - .into()) + Ok(match val { + UsedMapKey::K1 => 1u32.into(), + UsedMapKey::K2 => 2u32.into(), + }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedResultOk, + val: &&UsedMapKey, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub struct UsedEventSimple { - pub kind: Symbol, - pub amount: i128, +pub struct UsedMapVal { + pub v: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventSimple { +impl ::core::clone::Clone for UsedMapVal { #[inline] - fn clone(&self) -> UsedEventSimple { - UsedEventSimple { - kind: ::core::clone::Clone::clone(&self.kind), - amount: ::core::clone::Clone::clone(&self.amount), + fn clone(&self) -> UsedMapVal { + UsedMapVal { + v: ::core::clone::Clone::clone(&self.v), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventSimple { +impl ::core::fmt::Debug for UsedMapVal { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( - f, - "UsedEventSimple", - "kind", - &self.kind, - "amount", - &&self.amount, - ) + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedMapVal", "v", &&self.v) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventSimple { +impl ::core::cmp::Eq for UsedMapVal { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventSimple {} +impl ::core::marker::StructuralPartialEq for UsedMapVal {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventSimple { +impl ::core::cmp::PartialEq for UsedMapVal { #[inline] - fn eq(&self, other: &UsedEventSimple) -> bool { - self.amount == other.amount && self.kind == other.kind + fn eq(&self, other: &UsedMapVal) -> bool { + self.v == other.v } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_EVENT_USEDEVENTSIMPLE: [u8; 112usize] = UsedEventSimple::spec_xdr(); -impl UsedEventSimple { - pub const fn spec_xdr() -> [u8; 112usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x0fUsedEventSimple\0\0\0\0\x01\0\0\0\x11used_event_simple\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" +pub static __SPEC_XDR_TYPE_USEDMAPVAL: [u8; 48usize] = UsedMapVal::spec_xdr(); +impl UsedMapVal { + pub const fn spec_xdr() -> [u8; 48usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\nUsedMapVal\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UsedEventSimple { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1v1\x0eP\xa9C\xc7*"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedMapVal { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xaaX8\xde\xef\xbb6%\xb2\xe5DxT\xd07Jk\x12\xd3\x97<\xc5b\x1c\x9f'\xd7\x85\x98\x1e\x1dX"; } -impl soroban_sdk::Event for UsedEventSimple { - fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { - use soroban_sdk::IntoVal; - (&{ soroban_sdk::Symbol::new(env, "used_event_simple") }, { - let v: soroban_sdk::Val = self.kind.into_val(env); - v +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDMAPVAL: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xaaX8\xde\xef\xbb6%\xb2\xe5DxT\xd07Jk\x12\xd3\x97<\xc5b\x1c\x9f'\xd7\x85\x98\x1e\x1dX", + [], + ); +impl soroban_sdk::TryFromVal for UsedMapVal { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["v"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + v: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, }) - .into_val(env) } - fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { - use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["amount"]; - let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; - env.map_new_from_slices(&KEYS, &vals) - .unwrap_infallible() - .into() +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedMapVal, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["v"]; + let vals: [Val; 1usize] = [(&val.v).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) } } -impl UsedEventSimple { - pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); - <_ as soroban_sdk::Event>::publish(self, env); +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedMapVal, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub enum UsedEventTopicType { - Transfer = 1, - Mint = 2, +pub struct UsedOptionElement { + pub data: u32, } #[automatically_derived] -impl ::core::marker::Copy for UsedEventTopicType {} -#[automatically_derived] -impl ::core::clone::Clone for UsedEventTopicType { +impl ::core::clone::Clone for UsedOptionElement { #[inline] - fn clone(&self) -> UsedEventTopicType { - *self + fn clone(&self) -> UsedOptionElement { + UsedOptionElement { + data: ::core::clone::Clone::clone(&self.data), + } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventTopicType { +impl ::core::fmt::Debug for UsedOptionElement { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( + ::core::fmt::Formatter::debug_struct_field1_finish( f, - match self { - UsedEventTopicType::Transfer => "Transfer", - UsedEventTopicType::Mint => "Mint", - }, + "UsedOptionElement", + "data", + &&self.data, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventTopicType { +impl ::core::cmp::Eq for UsedOptionElement { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventTopicType {} +impl ::core::marker::StructuralPartialEq for UsedOptionElement {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventTopicType { +impl ::core::cmp::PartialEq for UsedOptionElement { #[inline] - fn eq(&self, other: &UsedEventTopicType) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr + fn eq(&self, other: &UsedOptionElement) -> bool { + self.data == other.data } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDEVENTTOPICTYPE: [u8; 76usize] = UsedEventTopicType::spec_xdr(); -impl UsedEventTopicType { - pub const fn spec_xdr() -> [u8; 76usize] { - *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventTopicType\0\0\0\0\0\x02\0\0\0\0\0\0\0\x08Transfer\0\0\0\x01\0\0\0\0\0\0\0\x04Mint\0\0\0\x02" +pub static __SPEC_XDR_TYPE_USEDOPTIONELEMENT: [u8; 56usize] = UsedOptionElement::spec_xdr(); +impl UsedOptionElement { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedOptionElement\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UsedEventTopicType { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xf5\xd4\x9b\xa3\xccI\x13\xf7"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedOptionElement { + const SPEC_TYPE_ID: [u8; 32] = *b"\xb3/\x97\xd5\x06\xbd3Bb\xd9\xac\xadF\0\xb4v\xad\x10<\xc2\xfb\xaf\x97\xf4fy1\xc1,\xba\x07\xa9"; } -impl soroban_sdk::TryFromVal for UsedEventTopicType { +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDOPTIONELEMENT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\xb3/\x97\xd5\x06\xbd3Bb\xd9\xac\xadF\0\xb4v\xad\x10<\xc2\xfb\xaf\x97\xf4fy1\xc1,\xba\x07\xa9", + [], +); +impl soroban_sdk::TryFromVal for UsedOptionElement { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::TryIntoVal; - let discriminant: u32 = val.try_into_val(env)?; - Ok(match discriminant { - 1u32 => Self::Transfer, - 2u32 => Self::Mint, - _ => Err(soroban_sdk::ConversionError {})?, + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + data: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventTopicType, + val: &UsedOptionElement, ) -> Result { - Ok(match val { - UsedEventTopicType::Transfer => 1u32.into(), - UsedEventTopicType::Mint => 2u32.into(), - }) + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventTopicType, + val: &&UsedOptionElement, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub struct UsedEventWithTopicType { - pub kind: UsedEventTopicType, - pub amount: i128, +pub struct UsedResultOk { + pub data: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventWithTopicType { +impl ::core::clone::Clone for UsedResultOk { #[inline] - fn clone(&self) -> UsedEventWithTopicType { - UsedEventWithTopicType { - kind: ::core::clone::Clone::clone(&self.kind), - amount: ::core::clone::Clone::clone(&self.amount), + fn clone(&self) -> UsedResultOk { + UsedResultOk { + data: ::core::clone::Clone::clone(&self.data), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventWithTopicType { +impl ::core::fmt::Debug for UsedResultOk { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( - f, - "UsedEventWithTopicType", - "kind", - &self.kind, - "amount", - &&self.amount, - ) + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedResultOk", "data", &&self.data) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventWithTopicType { +impl ::core::cmp::Eq for UsedResultOk { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventWithTopicType {} +impl ::core::marker::StructuralPartialEq for UsedResultOk {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventWithTopicType { +impl ::core::cmp::PartialEq for UsedResultOk { #[inline] - fn eq(&self, other: &UsedEventWithTopicType) -> bool { - self.amount == other.amount && self.kind == other.kind + fn eq(&self, other: &UsedResultOk) -> bool { + self.data == other.data } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_EVENT_USEDEVENTWITHTOPICTYPE: [u8; 152usize] = - UsedEventWithTopicType::spec_xdr(); -impl UsedEventWithTopicType { - pub const fn spec_xdr() -> [u8; 152usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x16UsedEventWithTopicType\0\0\0\0\0\x01\0\0\0\x1aused_event_with_topic_type\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\x07\xd0\0\0\0\x12UsedEventTopicType\0\0\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" +pub static __SPEC_XDR_TYPE_USEDRESULTOK: [u8; 48usize] = UsedResultOk::spec_xdr(); +impl UsedResultOk { + pub const fn spec_xdr() -> [u8; 48usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0cUsedResultOk\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UsedEventWithTopicType { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1q^\xe2&\x9di\x9d\x0e"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedResultOk { + const SPEC_TYPE_ID: [u8; 32] = *b"k\xe4zxB\xd1+\x02\xad\x01R\xc2\xd1\xb9:\x9d\x8e\xb2\xfb~\xee\xf9\x80\x156\x90 \x02\\x\xe2\xe1"; } -impl soroban_sdk::Event for UsedEventWithTopicType { - fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { - use soroban_sdk::IntoVal; - ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_topic_type") }, - { - let v: soroban_sdk::Val = self.kind.into_val(env); - v - }, - ) - .into_val(env) +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDRESULTOK: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"k\xe4zxB\xd1+\x02\xad\x01R\xc2\xd1\xb9:\x9d\x8e\xb2\xfb~\xee\xf9\x80\x156\x90 \x02\\x\xe2\xe1", + [], +); +impl soroban_sdk::TryFromVal for UsedResultOk { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + data: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) } - fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { - use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["amount"]; - let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; - env.map_new_from_slices(&KEYS, &vals) - .unwrap_infallible() - .into() +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedResultOk, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["data"]; + let vals: [Val; 1usize] = [(&val.data).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) } } -impl UsedEventWithTopicType { - pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); - <_ as soroban_sdk::Event>::publish(self, env); +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedResultOk, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub struct UsedEventDataType { - pub x: u32, - pub y: u32, +pub struct CustomSignature { + pub nonce: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventDataType { +impl ::core::clone::Clone for CustomSignature { #[inline] - fn clone(&self) -> UsedEventDataType { - UsedEventDataType { - x: ::core::clone::Clone::clone(&self.x), - y: ::core::clone::Clone::clone(&self.y), + fn clone(&self) -> CustomSignature { + CustomSignature { + nonce: ::core::clone::Clone::clone(&self.nonce), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventDataType { +impl ::core::fmt::Debug for CustomSignature { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( + ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedEventDataType", - "x", - &self.x, - "y", - &&self.y, + "CustomSignature", + "nonce", + &&self.nonce, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventDataType { +impl ::core::cmp::Eq for CustomSignature { #[inline] #[doc(hidden)] #[coverage(off)] @@ -1811,465 +2134,557 @@ impl ::core::cmp::Eq for UsedEventDataType { } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventDataType {} +impl ::core::marker::StructuralPartialEq for CustomSignature {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventDataType { +impl ::core::cmp::PartialEq for CustomSignature { #[inline] - fn eq(&self, other: &UsedEventDataType) -> bool { - self.x == other.x && self.y == other.y + fn eq(&self, other: &CustomSignature) -> bool { + self.nonce == other.nonce } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDEVENTDATATYPE: [u8; 72usize] = UsedEventDataType::spec_xdr(); -impl UsedEventDataType { - pub const fn spec_xdr() -> [u8; 72usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedEventDataType\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x04\0\0\0\0\0\0\0\x01y\0\0\0\0\0\0\x04" - } -} -impl soroban_sdk::SpecShakingMarker for UsedEventDataType { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xc2 \x1b\xdc\xc8gxZ"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } -} -impl soroban_sdk::TryFromVal for UsedEventDataType { +pub static __SPEC_XDR_TYPE_CUSTOMSIGNATURE: [u8; 56usize] = CustomSignature::spec_xdr(); +impl CustomSignature { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fCustomSignature\0\0\0\0\x01\0\0\0\0\0\0\0\x05nonce\0\0\0\0\0\0\x04" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for CustomSignature { + const SPEC_TYPE_ID: [u8; 32] = *b"6\xb3\x0f\xc2\xa9\r\x8a\xe1\xb2\xd9\x87Gc\x0ed\x89\xe7i\\\xef\x88\x07\xfc\"\xd8\x10\x97*$\xbc]&"; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_CUSTOMSIGNATURE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"6\xb3\x0f\xc2\xa9\r\x8a\xe1\xb2\xd9\x87Gc\x0ed\x89\xe7i\\\xef\x88\x07\xfc\"\xd8\x10\x97*$\xbc]&", + [], +); +impl soroban_sdk::TryFromVal for CustomSignature { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 2usize] = ["x", "y"]; - let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + const KEYS: [&'static str; 1usize] = ["nonce"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - x: vals[0] - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?, - y: vals[1] + nonce: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventDataType, + val: &CustomSignature, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 2usize] = ["x", "y"]; - let vals: [Val; 2usize] = [ - (&val.x).try_into_val(env).map_err(|_| ConversionError)?, - (&val.y).try_into_val(env).map_err(|_| ConversionError)?, - ]; + const KEYS: [&'static str; 1usize] = ["nonce"]; + let vals: [Val; 1usize] = [(&val.nonce) + .try_into_val(env) + .map_err(|_| ConversionError)?]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventDataType, + val: &&CustomSignature, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub struct UsedEventWithDataType { +pub struct UsedEventSimple { pub kind: Symbol, - pub payload: UsedEventDataType, + pub amount: i128, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventWithDataType { +impl ::core::clone::Clone for UsedEventSimple { #[inline] - fn clone(&self) -> UsedEventWithDataType { - UsedEventWithDataType { + fn clone(&self) -> UsedEventSimple { + UsedEventSimple { kind: ::core::clone::Clone::clone(&self.kind), - payload: ::core::clone::Clone::clone(&self.payload), + amount: ::core::clone::Clone::clone(&self.amount), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventWithDataType { +impl ::core::fmt::Debug for UsedEventSimple { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field2_finish( f, - "UsedEventWithDataType", + "UsedEventSimple", "kind", &self.kind, - "payload", - &&self.payload, + "amount", + &&self.amount, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventWithDataType { +impl ::core::cmp::Eq for UsedEventSimple { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventWithDataType {} +impl ::core::marker::StructuralPartialEq for UsedEventSimple {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventWithDataType { +impl ::core::cmp::PartialEq for UsedEventSimple { #[inline] - fn eq(&self, other: &UsedEventWithDataType) -> bool { - self.kind == other.kind && self.payload == other.payload + fn eq(&self, other: &UsedEventSimple) -> bool { + self.amount == other.amount && self.kind == other.kind } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_EVENT_USEDEVENTWITHDATATYPE: [u8; 152usize] = - UsedEventWithDataType::spec_xdr(); -impl UsedEventWithDataType { - pub const fn spec_xdr() -> [u8; 152usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x15UsedEventWithDataType\0\0\0\0\0\0\x01\0\0\0\x19used_event_with_data_type\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x11UsedEventDataType\0\0\0\0\0\0\0\0\0\0\x02" - } -} -impl soroban_sdk::SpecShakingMarker for UsedEventWithDataType { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1q\xa3z;6\xa6R\x01"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } +pub static __SPEC_XDR_EVENT_USEDEVENTSIMPLE: [u8; 112usize] = UsedEventSimple::spec_xdr(); +impl UsedEventSimple { + pub const fn spec_xdr() -> [u8; 112usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x0fUsedEventSimple\0\0\0\0\x01\0\0\0\x11used_event_simple\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" } } -impl soroban_sdk::Event for UsedEventWithDataType { +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_EVENT_USEDEVENTSIMPLE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 1, + *b"v1\x0eP\xa9C\xc7*\xce\xf5\x10\x1d\xb2\xaeFR|\n\x1e\x88\x8bB~\x8e\xc3\xb8\xdf\x1b\xd1\x0cx\xeb", + [], +); +impl soroban_sdk::Event for UsedEventSimple { fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { use soroban_sdk::IntoVal; - ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_data_type") }, - { - let v: soroban_sdk::Val = self.kind.into_val(env); - v - }, - ) - .into_val(env) - } - fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { + (&{ soroban_sdk::Symbol::new(env, "used_event_simple") }, { + let v: soroban_sdk::Val = self.kind.into_val(env); + v + }) + .into_val(env) + } + fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["payload"]; - let vals: [soroban_sdk::Val; 1usize] = [self.payload.into_val(env)]; + const KEYS: [&'static str; 1usize] = ["amount"]; + let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; env.map_new_from_slices(&KEYS, &vals) .unwrap_infallible() .into() } } -impl UsedEventWithDataType { +impl UsedEventSimple { pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); + { + static MARKER: [u8; 14usize] = *b"SpEcV1v1\x0eP\xa9C\xc7*"; + let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; + } <_ as soroban_sdk::Event>::publish(self, env); } } -pub struct UsedEventTopicOuter { - pub inner: UsedEventTopicInner, +pub enum UsedEventTopicType { + Transfer = 1, + Mint = 2, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventTopicOuter { +impl ::core::marker::Copy for UsedEventTopicType {} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventTopicType { #[inline] - fn clone(&self) -> UsedEventTopicOuter { - UsedEventTopicOuter { - inner: ::core::clone::Clone::clone(&self.inner), - } + fn clone(&self) -> UsedEventTopicType { + *self } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventTopicOuter { +impl ::core::fmt::Debug for UsedEventTopicType { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( + ::core::fmt::Formatter::write_str( f, - "UsedEventTopicOuter", - "inner", - &&self.inner, + match self { + UsedEventTopicType::Transfer => "Transfer", + UsedEventTopicType::Mint => "Mint", + }, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventTopicOuter { +impl ::core::cmp::Eq for UsedEventTopicType { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - } + fn assert_receiver_is_total_eq(&self) -> () {} } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventTopicOuter {} +impl ::core::marker::StructuralPartialEq for UsedEventTopicType {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventTopicOuter { +impl ::core::cmp::PartialEq for UsedEventTopicType { #[inline] - fn eq(&self, other: &UsedEventTopicOuter) -> bool { - self.inner == other.inner + fn eq(&self, other: &UsedEventTopicType) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDEVENTTOPICOUTER: [u8; 84usize] = UsedEventTopicOuter::spec_xdr(); -impl UsedEventTopicOuter { - pub const fn spec_xdr() -> [u8; 84usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedEventTopicOuter\0\0\0\0\x01\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x13UsedEventTopicInner\0" +pub static __SPEC_XDR_TYPE_USEDEVENTTOPICTYPE: [u8; 76usize] = UsedEventTopicType::spec_xdr(); +impl UsedEventTopicType { + pub const fn spec_xdr() -> [u8; 76usize] { + *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventTopicType\0\0\0\0\0\x02\0\0\0\0\0\0\0\x08Transfer\0\0\0\x01\0\0\0\0\0\0\0\x04Mint\0\0\0\x02" } } -impl soroban_sdk::SpecShakingMarker for UsedEventTopicOuter { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\x94\xc7w/_\xebXc"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedEventTopicType { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xf5\xd4\x9b\xa3\xccI\x13\xf7\xbf7!\xf53\"u\xb3a\xe3\x1e0\xcdc?P5Zh\xdb\xcc\xb5\x81\xf6"; } -impl soroban_sdk::TryFromVal for UsedEventTopicOuter { +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDEVENTTOPICTYPE: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xf5\xd4\x9b\xa3\xccI\x13\xf7\xbf7!\xf53\"u\xb3a\xe3\x1e0\xcdc?P5Zh\xdb\xcc\xb5\x81\xf6", + [], + ); +impl soroban_sdk::TryFromVal for UsedEventTopicType { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["inner"]; - let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; - let map: MapObject = val.try_into().map_err(|_| ConversionError)?; - env.map_unpack_to_slice(map, &KEYS, &mut vals) - .map_err(|_| ConversionError)?; - Ok(Self { - inner: vals[0] - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?, + use soroban_sdk::TryIntoVal; + let discriminant: u32 = val.try_into_val(env)?; + Ok(match discriminant { + 1u32 => Self::Transfer, + 2u32 => Self::Mint, + _ => Err(soroban_sdk::ConversionError {})?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventTopicOuter, + val: &UsedEventTopicType, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["inner"]; - let vals: [Val; 1usize] = [(&val.inner) - .try_into_val(env) - .map_err(|_| ConversionError)?]; - Ok(env - .map_new_from_slices(&KEYS, &vals) - .map_err(|_| ConversionError)? - .into()) + Ok(match val { + UsedEventTopicType::Transfer => 1u32.into(), + UsedEventTopicType::Mint => 2u32.into(), + }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventTopicOuter, + val: &&UsedEventTopicType, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( + <_ as soroban_sdk::TryFromVal>::try_from_val( env, *val, ) } } -pub struct UsedEventTopicInner { - pub val: u32, +pub struct UsedEventWithTopicType { + pub kind: UsedEventTopicType, + pub amount: i128, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventTopicInner { +impl ::core::clone::Clone for UsedEventWithTopicType { #[inline] - fn clone(&self) -> UsedEventTopicInner { - UsedEventTopicInner { - val: ::core::clone::Clone::clone(&self.val), + fn clone(&self) -> UsedEventWithTopicType { + UsedEventWithTopicType { + kind: ::core::clone::Clone::clone(&self.kind), + amount: ::core::clone::Clone::clone(&self.amount), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventTopicInner { +impl ::core::fmt::Debug for UsedEventWithTopicType { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish( + ::core::fmt::Formatter::debug_struct_field2_finish( f, - "UsedEventTopicInner", - "val", - &&self.val, + "UsedEventWithTopicType", + "kind", + &self.kind, + "amount", + &&self.amount, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventTopicInner { +impl ::core::cmp::Eq for UsedEventWithTopicType { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventTopicInner {} +impl ::core::marker::StructuralPartialEq for UsedEventWithTopicType {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventTopicInner { +impl ::core::cmp::PartialEq for UsedEventWithTopicType { #[inline] - fn eq(&self, other: &UsedEventTopicInner) -> bool { - self.val == other.val + fn eq(&self, other: &UsedEventWithTopicType) -> bool { + self.amount == other.amount && self.kind == other.kind } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDEVENTTOPICINNER: [u8; 56usize] = UsedEventTopicInner::spec_xdr(); -impl UsedEventTopicInner { - pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedEventTopicInner\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" +pub static __SPEC_XDR_EVENT_USEDEVENTWITHTOPICTYPE: [u8; 152usize] = + UsedEventWithTopicType::spec_xdr(); +impl UsedEventWithTopicType { + pub const fn spec_xdr() -> [u8; 152usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x16UsedEventWithTopicType\0\0\0\0\0\x01\0\0\0\x1aused_event_with_topic_type\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\x07\xd0\0\0\0\x12UsedEventTopicType\0\0\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" } } -impl soroban_sdk::SpecShakingMarker for UsedEventTopicInner { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_EVENT_USEDEVENTWITHTOPICTYPE: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 1, + *b"q^\xe2&\x9di\x9d\x0e\xea\x19\xc6\xe7{\xdd\xcf\xfc\xf1\xe5\x81\x94u\xd0\x08A\x93\xc9\"\xee\xbe\xa0h\xef", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::Event for UsedEventWithTopicType { + fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { + use soroban_sdk::IntoVal; + ( + &{ soroban_sdk::Symbol::new(env, "used_event_with_topic_type") }, + { + let v: soroban_sdk::Val = self.kind.into_val(env); + v + }, + ) + .into_val(env) + } + fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { + use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; + const KEYS: [&'static str; 1usize] = ["amount"]; + let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; + env.map_new_from_slices(&KEYS, &vals) + .unwrap_infallible() + .into() + } +} +impl UsedEventWithTopicType { + pub fn publish(&self, env: &soroban_sdk::Env) { { - static MARKER: [u8; 14usize] = *b"SpEcV16\x83?\xf0\xcdW\xb1/"; + static MARKER: [u8; 14usize] = *b"SpEcV1q^\xe2&\x9di\x9d\x0e"; let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; } + <_ as soroban_sdk::Event>::publish(self, env); } } -impl soroban_sdk::TryFromVal for UsedEventTopicInner { +pub struct UsedEventDataType { + pub x: u32, + pub y: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventDataType { + #[inline] + fn clone(&self) -> UsedEventDataType { + UsedEventDataType { + x: ::core::clone::Clone::clone(&self.x), + y: ::core::clone::Clone::clone(&self.y), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventDataType { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UsedEventDataType", + "x", + &self.x, + "y", + &&self.y, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventDataType { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventDataType {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventDataType { + #[inline] + fn eq(&self, other: &UsedEventDataType) -> bool { + self.x == other.x && self.y == other.y + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDEVENTDATATYPE: [u8; 72usize] = UsedEventDataType::spec_xdr(); +impl UsedEventDataType { + pub const fn spec_xdr() -> [u8; 72usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedEventDataType\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x04\0\0\0\0\0\0\0\x01y\0\0\0\0\0\0\x04" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedEventDataType { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xc2 \x1b\xdc\xc8gxZ{C<0\";\xe6w\xb4\xf6l\xfa|\xbe\x9b\xfc\x9612\x9e0\x02\x89\x0e"; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDEVENTDATATYPE: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xc2 \x1b\xdc\xc8gxZ{C<0\";\xe6w\xb4\xf6l\xfa|\xbe\x9b\xfc\x9612\x9e0\x02\x89\x0e", + [], + ); +impl soroban_sdk::TryFromVal for UsedEventDataType { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + const KEYS: [&'static str; 2usize] = ["x", "y"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - val: vals[0] + x: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, - }) + y: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventTopicInner, + val: &UsedEventDataType, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + const KEYS: [&'static str; 2usize] = ["x", "y"]; + let vals: [Val; 2usize] = [ + (&val.x).try_into_val(env).map_err(|_| ConversionError)?, + (&val.y).try_into_val(env).map_err(|_| ConversionError)?, + ]; Ok(env .map_new_from_slices(&KEYS, &vals) .map_err(|_| ConversionError)? .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventTopicInner, + val: &&UsedEventDataType, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub struct UsedEventWithNestedTopic { - pub info: UsedEventTopicOuter, - pub amount: i128, +pub struct UsedEventWithDataType { + pub kind: Symbol, + pub payload: UsedEventDataType, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventWithNestedTopic { +impl ::core::clone::Clone for UsedEventWithDataType { #[inline] - fn clone(&self) -> UsedEventWithNestedTopic { - UsedEventWithNestedTopic { - info: ::core::clone::Clone::clone(&self.info), - amount: ::core::clone::Clone::clone(&self.amount), + fn clone(&self) -> UsedEventWithDataType { + UsedEventWithDataType { + kind: ::core::clone::Clone::clone(&self.kind), + payload: ::core::clone::Clone::clone(&self.payload), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventWithNestedTopic { +impl ::core::fmt::Debug for UsedEventWithDataType { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field2_finish( f, - "UsedEventWithNestedTopic", - "info", - &self.info, - "amount", - &&self.amount, + "UsedEventWithDataType", + "kind", + &self.kind, + "payload", + &&self.payload, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventWithNestedTopic { +impl ::core::cmp::Eq for UsedEventWithDataType { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventWithNestedTopic {} +impl ::core::marker::StructuralPartialEq for UsedEventWithDataType {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventWithNestedTopic { +impl ::core::cmp::PartialEq for UsedEventWithDataType { #[inline] - fn eq(&self, other: &UsedEventWithNestedTopic) -> bool { - self.amount == other.amount && self.info == other.info + fn eq(&self, other: &UsedEventWithDataType) -> bool { + self.kind == other.kind && self.payload == other.payload } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_EVENT_USEDEVENTWITHNESTEDTOPIC: [u8; 152usize] = - UsedEventWithNestedTopic::spec_xdr(); -impl UsedEventWithNestedTopic { +pub static __SPEC_XDR_EVENT_USEDEVENTWITHDATATYPE: [u8; 152usize] = + UsedEventWithDataType::spec_xdr(); +impl UsedEventWithDataType { pub const fn spec_xdr() -> [u8; 152usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x18UsedEventWithNestedTopic\0\0\0\x01\0\0\0\x1cused_event_with_nested_topic\0\0\0\x02\0\0\0\0\0\0\0\x04info\0\0\x07\xd0\0\0\0\x13UsedEventTopicOuter\0\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" - } -} -impl soroban_sdk::SpecShakingMarker for UsedEventWithNestedTopic { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xe3\xf2\x9b5%a\xfb\xd6"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x15UsedEventWithDataType\0\0\0\0\0\0\x01\0\0\0\x19used_event_with_data_type\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x11UsedEventDataType\0\0\0\0\0\0\0\0\0\0\x02" } } -impl soroban_sdk::Event for UsedEventWithNestedTopic { +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_EVENT_USEDEVENTWITHDATATYPE: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 1, + *b"q\xa3z;6\xa6R\x01\xa6-V\x13\x03\xcc\xff\x03\x84\x1f\xfb\xbe`v\xba\x0e\xe9\xd3\x0f\xf8$#t0", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::Event for UsedEventWithDataType { fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { use soroban_sdk::IntoVal; ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_nested_topic") }, + &{ soroban_sdk::Symbol::new(env, "used_event_with_data_type") }, { - let v: soroban_sdk::Val = self.info.into_val(env); + let v: soroban_sdk::Val = self.kind.into_val(env); v }, ) @@ -2277,80 +2692,85 @@ impl soroban_sdk::Event for UsedEventWithNestedTopic { } fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["amount"]; - let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; + const KEYS: [&'static str; 1usize] = ["payload"]; + let vals: [soroban_sdk::Val; 1usize] = [self.payload.into_val(env)]; env.map_new_from_slices(&KEYS, &vals) .unwrap_infallible() .into() } } -impl UsedEventWithNestedTopic { +impl UsedEventWithDataType { pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); + { + static MARKER: [u8; 14usize] = *b"SpEcV1q\xa3z;6\xa6R\x01"; + let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; + } <_ as soroban_sdk::Event>::publish(self, env); } } -pub struct UsedEventDataOuter { - pub inner: UsedEventDataInner, +pub struct UsedEventTopicOuter { + pub inner: UsedEventTopicInner, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventDataOuter { +impl ::core::clone::Clone for UsedEventTopicOuter { #[inline] - fn clone(&self) -> UsedEventDataOuter { - UsedEventDataOuter { + fn clone(&self) -> UsedEventTopicOuter { + UsedEventTopicOuter { inner: ::core::clone::Clone::clone(&self.inner), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventDataOuter { +impl ::core::fmt::Debug for UsedEventTopicOuter { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedEventDataOuter", + "UsedEventTopicOuter", "inner", &&self.inner, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventDataOuter { +impl ::core::cmp::Eq for UsedEventTopicOuter { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventDataOuter {} +impl ::core::marker::StructuralPartialEq for UsedEventTopicOuter {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventDataOuter { +impl ::core::cmp::PartialEq for UsedEventTopicOuter { #[inline] - fn eq(&self, other: &UsedEventDataOuter) -> bool { + fn eq(&self, other: &UsedEventTopicOuter) -> bool { self.inner == other.inner } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDEVENTDATAOUTER: [u8; 84usize] = UsedEventDataOuter::spec_xdr(); -impl UsedEventDataOuter { +pub static __SPEC_XDR_TYPE_USEDEVENTTOPICOUTER: [u8; 84usize] = UsedEventTopicOuter::spec_xdr(); +impl UsedEventTopicOuter { pub const fn spec_xdr() -> [u8; 84usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventDataOuter\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x12UsedEventDataInner\0\0" + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedEventTopicOuter\0\0\0\0\x01\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x13UsedEventTopicInner\0" } } -impl soroban_sdk::SpecShakingMarker for UsedEventDataOuter { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1'\xf2\xa2\xb9\xd0)\xc0u"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedEventTopicOuter { + const SPEC_TYPE_ID: [u8; 32] = *b"\x94\xc7w/_\xebXc\xa9\x03\x88\x02\x07^\x08\xa2\x8e_\x97\xfe\x1a\x86o\x86\xf0h\x0e\xd5Q],\xce"; } -impl soroban_sdk::TryFromVal for UsedEventDataOuter { +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDEVENTTOPICOUTER: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 2, + *b"\x94\xc7w/_\xebXc\xa9\x03\x88\x02\x07^\x08\xa2\x8e_\x97\xfe\x1a\x86o\x86\xf0h\x0e\xd5Q],\xce", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::TryFromVal for UsedEventTopicOuter { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -2369,11 +2789,11 @@ impl soroban_sdk::TryFromVal for UsedEventDa }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventDataOuter, + val: &UsedEventTopicOuter, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["inner"]; @@ -2386,44 +2806,44 @@ impl soroban_sdk::TryFromVal for soroban_s .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventDataOuter, + val: &&UsedEventTopicOuter, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( + <_ as soroban_sdk::TryFromVal>::try_from_val( env, *val, ) } } -pub struct UsedEventDataInner { +pub struct UsedEventTopicInner { pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventDataInner { +impl ::core::clone::Clone for UsedEventTopicInner { #[inline] - fn clone(&self) -> UsedEventDataInner { - UsedEventDataInner { + fn clone(&self) -> UsedEventTopicInner { + UsedEventTopicInner { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventDataInner { +impl ::core::fmt::Debug for UsedEventTopicInner { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedEventDataInner", + "UsedEventTopicInner", "val", &&self.val, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventDataInner { +impl ::core::cmp::Eq for UsedEventTopicInner { #[inline] #[doc(hidden)] #[coverage(off)] @@ -2432,33 +2852,35 @@ impl ::core::cmp::Eq for UsedEventDataInner { } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventDataInner {} +impl ::core::marker::StructuralPartialEq for UsedEventTopicInner {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventDataInner { +impl ::core::cmp::PartialEq for UsedEventTopicInner { #[inline] - fn eq(&self, other: &UsedEventDataInner) -> bool { + fn eq(&self, other: &UsedEventTopicInner) -> bool { self.val == other.val } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDEVENTDATAINNER: [u8; 56usize] = UsedEventDataInner::spec_xdr(); -impl UsedEventDataInner { +pub static __SPEC_XDR_TYPE_USEDEVENTTOPICINNER: [u8; 56usize] = UsedEventTopicInner::spec_xdr(); +impl UsedEventTopicInner { pub const fn spec_xdr() -> [u8; 56usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventDataInner\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedEventTopicInner\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UsedEventDataInner { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\x0c\xf0\xf6w\xfd\x1a\x1b\x94"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedEventTopicInner { + const SPEC_TYPE_ID: [u8; 32] = *b"6\x83?\xf0\xcdW\xb1/\x84\x83\xf4\xb9w\xfcY1^\xd2iW\x04\xf2\x84\xb9\n\x15 \xc2\x16\xce\x95\x08"; } -impl soroban_sdk::TryFromVal for UsedEventDataInner { +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDEVENTTOPICINNER: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"6\x83?\xf0\xcdW\xb1/\x84\x83\xf4\xb9w\xfcY1^\xd2iW\x04\xf2\x84\xb9\n\x15 \xc2\x16\xce\x95\x08", + [], +); +impl soroban_sdk::TryFromVal for UsedEventTopicInner { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -2477,11 +2899,11 @@ impl soroban_sdk::TryFromVal for UsedEventDa }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedEventDataInner, + val: &UsedEventTopicInner, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["val"]; @@ -2492,92 +2914,88 @@ impl soroban_sdk::TryFromVal for soroban_s .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedEventDataInner, + val: &&UsedEventTopicInner, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( + <_ as soroban_sdk::TryFromVal>::try_from_val( env, *val, ) } } -pub struct UsedEventWithNestedData { - pub kind: Symbol, - pub payload: UsedEventDataOuter, +pub struct UsedEventWithNestedTopic { + pub info: UsedEventTopicOuter, + pub amount: i128, } #[automatically_derived] -impl ::core::clone::Clone for UsedEventWithNestedData { +impl ::core::clone::Clone for UsedEventWithNestedTopic { #[inline] - fn clone(&self) -> UsedEventWithNestedData { - UsedEventWithNestedData { - kind: ::core::clone::Clone::clone(&self.kind), - payload: ::core::clone::Clone::clone(&self.payload), + fn clone(&self) -> UsedEventWithNestedTopic { + UsedEventWithNestedTopic { + info: ::core::clone::Clone::clone(&self.info), + amount: ::core::clone::Clone::clone(&self.amount), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedEventWithNestedData { +impl ::core::fmt::Debug for UsedEventWithNestedTopic { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field2_finish( f, - "UsedEventWithNestedData", - "kind", - &self.kind, - "payload", - &&self.payload, + "UsedEventWithNestedTopic", + "info", + &self.info, + "amount", + &&self.amount, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedEventWithNestedData { +impl ::core::cmp::Eq for UsedEventWithNestedTopic { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedEventWithNestedData {} +impl ::core::marker::StructuralPartialEq for UsedEventWithNestedTopic {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedEventWithNestedData { +impl ::core::cmp::PartialEq for UsedEventWithNestedTopic { #[inline] - fn eq(&self, other: &UsedEventWithNestedData) -> bool { - self.kind == other.kind && self.payload == other.payload + fn eq(&self, other: &UsedEventWithNestedTopic) -> bool { + self.amount == other.amount && self.info == other.info } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_EVENT_USEDEVENTWITHNESTEDDATA: [u8; 152usize] = - UsedEventWithNestedData::spec_xdr(); -impl UsedEventWithNestedData { +pub static __SPEC_XDR_EVENT_USEDEVENTWITHNESTEDTOPIC: [u8; 152usize] = + UsedEventWithNestedTopic::spec_xdr(); +impl UsedEventWithNestedTopic { pub const fn spec_xdr() -> [u8; 152usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x17UsedEventWithNestedData\0\0\0\0\x01\0\0\0\x1bused_event_with_nested_data\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x12UsedEventDataOuter\0\0\0\0\0\0\0\0\0\x02" - } -} -impl soroban_sdk::SpecShakingMarker for UsedEventWithNestedData { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1 \xfbl\x04B\x82\xc0\xb4"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x18UsedEventWithNestedTopic\0\0\0\x01\0\0\0\x1cused_event_with_nested_topic\0\0\0\x02\0\0\0\0\0\0\0\x04info\0\0\x07\xd0\0\0\0\x13UsedEventTopicOuter\0\0\0\0\x01\0\0\0\0\0\0\0\x06amount\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" } } -impl soroban_sdk::Event for UsedEventWithNestedData { +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_EVENT_USEDEVENTWITHNESTEDTOPIC: [u8; 74usize] = + soroban_sdk::spec_shaking::encode_graph_record::<74usize, 1usize>( + 1, + *b"\xe3\xf2\x9b5%a\xfb\xd6pv\xcf\xd0q\x91\x9f\xae\x8d\x9d\x8dLKjc\xed&r;W\x13f\x8c\xba", + [::SPEC_TYPE_ID], + ); +impl soroban_sdk::Event for UsedEventWithNestedTopic { fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { use soroban_sdk::IntoVal; ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_nested_data") }, + &{ soroban_sdk::Symbol::new(env, "used_event_with_nested_topic") }, { - let v: soroban_sdk::Val = self.kind.into_val(env); + let v: soroban_sdk::Val = self.info.into_val(env); v }, ) @@ -2585,281 +3003,1632 @@ impl soroban_sdk::Event for UsedEventWithNestedData { } fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["payload"]; - let vals: [soroban_sdk::Val; 1usize] = [self.payload.into_val(env)]; + const KEYS: [&'static str; 1usize] = ["amount"]; + let vals: [soroban_sdk::Val; 1usize] = [self.amount.into_val(env)]; env.map_new_from_slices(&KEYS, &vals) .unwrap_infallible() .into() } } -impl UsedEventWithNestedData { +impl UsedEventWithNestedTopic { pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); + { + static MARKER: [u8; 14usize] = *b"SpEcV1\xe3\xf2\x9b5%a\xfb\xd6"; + let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; + } <_ as soroban_sdk::Event>::publish(self, env); } } -pub enum UsedRefTopicType { - Send = 1, - Recv = 2, +pub struct UsedEventDataOuter { + pub inner: UsedEventDataInner, } #[automatically_derived] -impl ::core::marker::Copy for UsedRefTopicType {} -#[automatically_derived] -impl ::core::clone::Clone for UsedRefTopicType { +impl ::core::clone::Clone for UsedEventDataOuter { #[inline] - fn clone(&self) -> UsedRefTopicType { - *self + fn clone(&self) -> UsedEventDataOuter { + UsedEventDataOuter { + inner: ::core::clone::Clone::clone(&self.inner), + } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedRefTopicType { +impl ::core::fmt::Debug for UsedEventDataOuter { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( + ::core::fmt::Formatter::debug_struct_field1_finish( f, - match self { - UsedRefTopicType::Send => "Send", - UsedRefTopicType::Recv => "Recv", - }, + "UsedEventDataOuter", + "inner", + &&self.inner, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedRefTopicType { +impl ::core::cmp::Eq for UsedEventDataOuter { #[inline] #[doc(hidden)] #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedRefTopicType {} +impl ::core::marker::StructuralPartialEq for UsedEventDataOuter {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedRefTopicType { +impl ::core::cmp::PartialEq for UsedEventDataOuter { #[inline] - fn eq(&self, other: &UsedRefTopicType) -> bool { - let __self_discr = ::core::intrinsics::discriminant_value(self); - let __arg1_discr = ::core::intrinsics::discriminant_value(other); - __self_discr == __arg1_discr + fn eq(&self, other: &UsedEventDataOuter) -> bool { + self.inner == other.inner } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDREFTOPICTYPE: [u8; 68usize] = UsedRefTopicType::spec_xdr(); -impl UsedRefTopicType { - pub const fn spec_xdr() -> [u8; 68usize] { - *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x10UsedRefTopicType\0\0\0\x02\0\0\0\0\0\0\0\x04Send\0\0\0\x01\0\0\0\0\0\0\0\x04Recv\0\0\0\x02" +pub static __SPEC_XDR_TYPE_USEDEVENTDATAOUTER: [u8; 84usize] = UsedEventDataOuter::spec_xdr(); +impl UsedEventDataOuter { + pub const fn spec_xdr() -> [u8; 84usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventDataOuter\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x12UsedEventDataInner\0\0" } } -impl soroban_sdk::SpecShakingMarker for UsedRefTopicType { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - { - static MARKER: [u8; 14usize] = *b"SpEcV1@\xb9LO\xf9\xd1\xe8\xe2"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedEventDataOuter { + const SPEC_TYPE_ID: [u8; 32] = *b"'\xf2\xa2\xb9\xd0)\xc0u \x17\xc1\xe1\xcc5t\"\x83\xad\x90)\x86\xd5j\x85\x1cD\xc9\x0f|\xb2\x01\x1a"; } -impl soroban_sdk::TryFromVal for UsedRefTopicType { +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDEVENTDATAOUTER: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 2, + *b"'\xf2\xa2\xb9\xd0)\xc0u \x17\xc1\xe1\xcc5t\"\x83\xad\x90)\x86\xd5j\x85\x1cD\xc9\x0f|\xb2\x01\x1a", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::TryFromVal for UsedEventDataOuter { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::TryIntoVal; - let discriminant: u32 = val.try_into_val(env)?; - Ok(match discriminant { - 1u32 => Self::Send, - 2u32 => Self::Recv, - _ => Err(soroban_sdk::ConversionError {})?, + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["inner"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + inner: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; - #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedRefTopicType, + val: &UsedEventDataOuter, ) -> Result { - Ok(match val { - UsedRefTopicType::Send => 1u32.into(), - UsedRefTopicType::Recv => 2u32.into(), - }) + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["inner"]; + let vals: [Val; 1usize] = [(&val.inner) + .try_into_val(env) + .map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedRefTopicType, + val: &&UsedEventDataOuter, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) } } -pub struct UsedRefDataType { - pub nested: UsedRefDataInner, +pub struct UsedEventDataInner { + pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedRefDataType { +impl ::core::clone::Clone for UsedEventDataInner { #[inline] - fn clone(&self) -> UsedRefDataType { - UsedRefDataType { - nested: ::core::clone::Clone::clone(&self.nested), + fn clone(&self) -> UsedEventDataInner { + UsedEventDataInner { + val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedRefDataType { +impl ::core::fmt::Debug for UsedEventDataInner { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedRefDataType", - "nested", - &&self.nested, + "UsedEventDataInner", + "val", + &&self.val, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedRefDataType { +impl ::core::cmp::Eq for UsedEventDataInner { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedRefDataType {} +impl ::core::marker::StructuralPartialEq for UsedEventDataInner {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedRefDataType { +impl ::core::cmp::PartialEq for UsedEventDataInner { #[inline] - fn eq(&self, other: &UsedRefDataType) -> bool { - self.nested == other.nested + fn eq(&self, other: &UsedEventDataInner) -> bool { + self.val == other.val } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDREFDATATYPE: [u8; 76usize] = UsedRefDataType::spec_xdr(); -impl UsedRefDataType { - pub const fn spec_xdr() -> [u8; 76usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fUsedRefDataType\0\0\0\0\x01\0\0\0\0\0\0\0\x06nested\0\0\0\0\x07\xd0\0\0\0\x10UsedRefDataInner" +pub static __SPEC_XDR_TYPE_USEDEVENTDATAINNER: [u8; 56usize] = UsedEventDataInner::spec_xdr(); +impl UsedEventDataInner { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UsedEventDataInner\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UsedRefDataType { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1'\xbd_A\r\x9a\x89\x02"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UsedEventDataInner { + const SPEC_TYPE_ID: [u8; 32] = *b"\x0c\xf0\xf6w\xfd\x1a\x1b\x94\x8e\xdb9\xf07\x16K{\xce\xe5no\xb5>\x94\xf3\xa9\x15\x8b\x93\xda*\xc1\x84"; } -impl soroban_sdk::TryFromVal for UsedRefDataType { +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDEVENTDATAINNER: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\x0c\xf0\xf6w\xfd\x1a\x1b\x94\x8e\xdb9\xf07\x16K{\xce\xe5no\xb5>\x94\xf3\xa9\x15\x8b\x93\xda*\xc1\x84", + [], +); +impl soroban_sdk::TryFromVal for UsedEventDataInner { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["nested"]; + const KEYS: [&'static str; 1usize] = ["val"]; let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; let map: MapObject = val.try_into().map_err(|_| ConversionError)?; env.map_unpack_to_slice(map, &KEYS, &mut vals) .map_err(|_| ConversionError)?; Ok(Self { - nested: vals[0] + val: vals[0] .try_into_val(env) .map_err(|_| soroban_sdk::ConversionError)?, }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedEventDataInner, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedEventDataInner, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +pub struct UsedEventWithNestedData { + pub kind: Symbol, + pub payload: UsedEventDataOuter, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedEventWithNestedData { + #[inline] + fn clone(&self) -> UsedEventWithNestedData { + UsedEventWithNestedData { + kind: ::core::clone::Clone::clone(&self.kind), + payload: ::core::clone::Clone::clone(&self.payload), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedEventWithNestedData { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UsedEventWithNestedData", + "kind", + &self.kind, + "payload", + &&self.payload, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedEventWithNestedData { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedEventWithNestedData {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedEventWithNestedData { + #[inline] + fn eq(&self, other: &UsedEventWithNestedData) -> bool { + self.kind == other.kind && self.payload == other.payload + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_EVENT_USEDEVENTWITHNESTEDDATA: [u8; 152usize] = + UsedEventWithNestedData::spec_xdr(); +impl UsedEventWithNestedData { + pub const fn spec_xdr() -> [u8; 152usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x17UsedEventWithNestedData\0\0\0\0\x01\0\0\0\x1bused_event_with_nested_data\0\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x12UsedEventDataOuter\0\0\0\0\0\0\0\0\0\x02" + } +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_EVENT_USEDEVENTWITHNESTEDDATA: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 1, + *b" \xfbl\x04B\x82\xc0\xb4.\xec\xfdE\xa0\x8d\xca\xea\xd9\"\xc2\xf1\xcf\xe4-\xe2|\x1b&\x9eF\xc1e0", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::Event for UsedEventWithNestedData { + fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { + use soroban_sdk::IntoVal; + ( + &{ soroban_sdk::Symbol::new(env, "used_event_with_nested_data") }, + { + let v: soroban_sdk::Val = self.kind.into_val(env); + v + }, + ) + .into_val(env) + } + fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { + use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; + const KEYS: [&'static str; 1usize] = ["payload"]; + let vals: [soroban_sdk::Val; 1usize] = [self.payload.into_val(env)]; + env.map_new_from_slices(&KEYS, &vals) + .unwrap_infallible() + .into() + } +} +impl UsedEventWithNestedData { + pub fn publish(&self, env: &soroban_sdk::Env) { + { + static MARKER: [u8; 14usize] = *b"SpEcV1 \xfbl\x04B\x82\xc0\xb4"; + let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; + } + <_ as soroban_sdk::Event>::publish(self, env); + } +} +pub enum UsedRefTopicType { + Send = 1, + Recv = 2, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedRefTopicType {} +#[automatically_derived] +impl ::core::clone::Clone for UsedRefTopicType { + #[inline] + fn clone(&self) -> UsedRefTopicType { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedRefTopicType { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + UsedRefTopicType::Send => "Send", + UsedRefTopicType::Recv => "Recv", + }, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedRefTopicType { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedRefTopicType {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedRefTopicType { + #[inline] + fn eq(&self, other: &UsedRefTopicType) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDREFTOPICTYPE: [u8; 68usize] = UsedRefTopicType::spec_xdr(); +impl UsedRefTopicType { + pub const fn spec_xdr() -> [u8; 68usize] { + *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x10UsedRefTopicType\0\0\0\x02\0\0\0\0\0\0\0\x04Send\0\0\0\x01\0\0\0\0\0\0\0\x04Recv\0\0\0\x02" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedRefTopicType { + const SPEC_TYPE_ID: [u8; 32] = *b"@\xb9LO\xf9\xd1\xe8\xe2\xbb\x94X\x08\xab\x8a\xaf\x95(\xcd\x91\x1f\x96\xce\t\xff\x86|\xb4\xb6\x84K\xed "; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDREFTOPICTYPE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"@\xb9LO\xf9\xd1\xe8\xe2\xbb\x94X\x08\xab\x8a\xaf\x95(\xcd\x91\x1f\x96\xce\t\xff\x86|\xb4\xb6\x84K\xed ", + [], +); +impl soroban_sdk::TryFromVal for UsedRefTopicType { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let discriminant: u32 = val.try_into_val(env)?; + Ok(match discriminant { + 1u32 => Self::Send, + 2u32 => Self::Recv, + _ => Err(soroban_sdk::ConversionError {})?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedRefTopicType, + ) -> Result { + Ok(match val { + UsedRefTopicType::Send => 1u32.into(), + UsedRefTopicType::Recv => 2u32.into(), + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedRefTopicType, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +pub struct UsedRefDataType { + pub nested: UsedRefDataInner, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedRefDataType { + #[inline] + fn clone(&self) -> UsedRefDataType { + UsedRefDataType { + nested: ::core::clone::Clone::clone(&self.nested), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedRefDataType { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedRefDataType", + "nested", + &&self.nested, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedRefDataType { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedRefDataType {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedRefDataType { + #[inline] + fn eq(&self, other: &UsedRefDataType) -> bool { + self.nested == other.nested + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDREFDATATYPE: [u8; 76usize] = UsedRefDataType::spec_xdr(); +impl UsedRefDataType { + pub const fn spec_xdr() -> [u8; 76usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fUsedRefDataType\0\0\0\0\x01\0\0\0\0\0\0\0\x06nested\0\0\0\0\x07\xd0\0\0\0\x10UsedRefDataInner" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedRefDataType { + const SPEC_TYPE_ID: [u8; 32] = *b"'\xbd_A\r\x9a\x89\x02l\x941T>\xcd\xc3\xafg\xb6\x01\xa4D\x15\xa9\xf5\xfd\x1d\r\xfe\xb8\xe90A"; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDREFDATATYPE: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 2, + *b"'\xbd_A\r\x9a\x89\x02l\x941T>\xcd\xc3\xafg\xb6\x01\xa4D\x15\xa9\xf5\xfd\x1d\r\xfe\xb8\xe90A", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::TryFromVal for UsedRefDataType { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["nested"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + nested: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedRefDataType, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["nested"]; + let vals: [Val; 1usize] = [(&val.nested) + .try_into_val(env) + .map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedRefDataType, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +pub struct UsedRefDataInner { + pub val: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedRefDataInner { + #[inline] + fn clone(&self) -> UsedRefDataInner { + UsedRefDataInner { + val: ::core::clone::Clone::clone(&self.val), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedRefDataInner { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedRefDataInner", "val", &&self.val) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedRefDataInner { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedRefDataInner {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedRefDataInner { + #[inline] + fn eq(&self, other: &UsedRefDataInner) -> bool { + self.val == other.val + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDREFDATAINNER: [u8; 52usize] = UsedRefDataInner::spec_xdr(); +impl UsedRefDataInner { + pub const fn spec_xdr() -> [u8; 52usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedRefDataInner\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedRefDataInner { + const SPEC_TYPE_ID: [u8; 32] = + *b"K\xdf'8m/\xe8\x1dr\xe0'{3\xa9\xe0\\\x0c\xeb\xc4\xe3\xb3\nA\xfey\xf4\x11\x13\xd2\x08{~"; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDREFDATAINNER: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"K\xdf'8m/\xe8\x1dr\xe0'{3\xa9\xe0\\\x0c\xeb\xc4\xe3\xb3\nA\xfey\xf4\x11\x13\xd2\x08{~", + [], + ); +impl soroban_sdk::TryFromVal for UsedRefDataInner { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedRefDataInner, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedRefDataInner, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +pub struct UsedEventWithRefs<'a> { + pub kind: &'a UsedRefTopicType, + pub payload: &'a UsedRefDataType, +} +#[automatically_derived] +impl<'a> ::core::clone::Clone for UsedEventWithRefs<'a> { + #[inline] + fn clone(&self) -> UsedEventWithRefs<'a> { + UsedEventWithRefs { + kind: ::core::clone::Clone::clone(&self.kind), + payload: ::core::clone::Clone::clone(&self.payload), + } + } +} +#[automatically_derived] +impl<'a> ::core::fmt::Debug for UsedEventWithRefs<'a> { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UsedEventWithRefs", + "kind", + &self.kind, + "payload", + &&self.payload, + ) + } +} +#[automatically_derived] +impl<'a> ::core::cmp::Eq for UsedEventWithRefs<'a> { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq<&'a UsedRefTopicType>; + let _: ::core::cmp::AssertParamIsEq<&'a UsedRefDataType>; + } +} +#[automatically_derived] +impl<'a> ::core::marker::StructuralPartialEq for UsedEventWithRefs<'a> {} +#[automatically_derived] +impl<'a> ::core::cmp::PartialEq for UsedEventWithRefs<'a> { + #[inline] + fn eq(&self, other: &UsedEventWithRefs<'a>) -> bool { + self.kind == other.kind && self.payload == other.payload + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_EVENT_USEDEVENTWITHREFS: [u8; 156usize] = UsedEventWithRefs::spec_xdr(); +impl<'a> UsedEventWithRefs<'a> { + pub const fn spec_xdr() -> [u8; 156usize] { + *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x11UsedEventWithRefs\0\0\0\0\0\0\x01\0\0\0\x14used_event_with_refs\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\x07\xd0\0\0\0\x10UsedRefTopicType\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x0fUsedRefDataType\0\0\0\0\0\0\0\0\x02" + } +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_EVENT_USEDEVENTWITHREFS: [u8; 106usize] = + soroban_sdk::spec_shaking::encode_graph_record::<106usize, 2usize>( + 1, + *b"[Q+\xe9\xde\xd5\xf2>`4p2\xd1G\xec\xe6\xac\x1a\x85\x03{\x04W3\x14\xde|\xac\xdc\x9bl\x99", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); +impl<'a> soroban_sdk::Event for UsedEventWithRefs<'a> { + fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { + use soroban_sdk::IntoVal; + ( + &{ soroban_sdk::Symbol::new(env, "used_event_with_refs") }, + { + let v: soroban_sdk::Val = self.kind.into_val(env); + v + }, + ) + .into_val(env) + } + fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { + use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; + const KEYS: [&'static str; 1usize] = ["payload"]; + let vals: [soroban_sdk::Val; 1usize] = [self.payload.into_val(env)]; + env.map_new_from_slices(&KEYS, &vals) + .unwrap_infallible() + .into() + } +} +impl<'a> UsedEventWithRefs<'a> { + pub fn publish(&self, env: &soroban_sdk::Env) { + { + static MARKER: [u8; 14usize] = *b"SpEcV1[Q+\xe9\xde\xd5\xf2>"; + let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; + } + <_ as soroban_sdk::Event>::publish(self, env); + } +} +pub struct UsedTupleElement { + pub val: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedTupleElement { + #[inline] + fn clone(&self) -> UsedTupleElement { + UsedTupleElement { + val: ::core::clone::Clone::clone(&self.val), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedTupleElement { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedTupleElement", "val", &&self.val) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedTupleElement { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedTupleElement {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedTupleElement { + #[inline] + fn eq(&self, other: &UsedTupleElement) -> bool { + self.val == other.val + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDTUPLEELEMENT: [u8; 52usize] = UsedTupleElement::spec_xdr(); +impl UsedTupleElement { + pub const fn spec_xdr() -> [u8; 52usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedTupleElement\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedTupleElement { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xde\x1dMa\x01\xec\xb0A\nT\x8b\x1e\xbb\x88\x034\xcfwRz\x7f\x1b\x05\xc2b1\xe7r8{\xce\xc7"; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDTUPLEELEMENT: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xde\x1dMa\x01\xec\xb0A\nT\x8b\x1e\xbb\x88\x034\xcfwRz\x7f\x1b\x05\xc2b1\xe7r8{\xce\xc7", + [], + ); +impl soroban_sdk::TryFromVal for UsedTupleElement { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedTupleElement, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedTupleElement, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +pub struct UsedTupleReturnElement { + pub val: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedTupleReturnElement { + #[inline] + fn clone(&self) -> UsedTupleReturnElement { + UsedTupleReturnElement { + val: ::core::clone::Clone::clone(&self.val), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedTupleReturnElement { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedTupleReturnElement", + "val", + &&self.val, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedTupleReturnElement { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedTupleReturnElement {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedTupleReturnElement { + #[inline] + fn eq(&self, other: &UsedTupleReturnElement) -> bool { + self.val == other.val + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDTUPLERETURNELEMENT: [u8; 60usize] = + UsedTupleReturnElement::spec_xdr(); +impl UsedTupleReturnElement { + pub const fn spec_xdr() -> [u8; 60usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x16UsedTupleReturnElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedTupleReturnElement { + const SPEC_TYPE_ID: [u8; 32] = *b"Y\xa66\xb3\xecxE\x13\xdaZ\xbe\xa2r?J\xa2D\xc2\xd8\xb5\x1d8\xd1tn\x9d\x10\x86\x04\x1a\xf2\x1b"; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDTUPLERETURNELEMENT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"Y\xa66\xb3\xecxE\x13\xdaZ\xbe\xa2r?J\xa2D\xc2\xd8\xb5\x1d8\xd1tn\x9d\x10\x86\x04\x1a\xf2\x1b", + [], +); +impl soroban_sdk::TryFromVal for UsedTupleReturnElement { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedTupleReturnElement, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedTupleReturnElement, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +pub struct UsedVecInnerVecElement { + pub val: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedVecInnerVecElement { + #[inline] + fn clone(&self) -> UsedVecInnerVecElement { + UsedVecInnerVecElement { + val: ::core::clone::Clone::clone(&self.val), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedVecInnerVecElement { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedVecInnerVecElement", + "val", + &&self.val, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedVecInnerVecElement { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedVecInnerVecElement {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedVecInnerVecElement { + #[inline] + fn eq(&self, other: &UsedVecInnerVecElement) -> bool { + self.val == other.val + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDVECINNERVECELEMENT: [u8; 60usize] = + UsedVecInnerVecElement::spec_xdr(); +impl UsedVecInnerVecElement { + pub const fn spec_xdr() -> [u8; 60usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x16UsedVecInnerVecElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedVecInnerVecElement { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xcf@%X\xde+J@\xc4\xe7\xb8=\xdd(\x16za\xe2\xb0\xa6\x9e>\xc6h\x18\xc6\xdfl\0s\xa3D"; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDVECINNERVECELEMENT: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xcf@%X\xde+J@\xc4\xe7\xb8=\xdd(\x16za\xe2\xb0\xa6\x9e>\xc6h\x18\xc6\xdfl\0s\xa3D", + [], + ); +impl soroban_sdk::TryFromVal for UsedVecInnerVecElement { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedVecInnerVecElement, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedVecInnerVecElement, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +pub struct UsedVecInnerElement { + pub val: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedVecInnerElement { + #[inline] + fn clone(&self) -> UsedVecInnerElement { + UsedVecInnerElement { + val: ::core::clone::Clone::clone(&self.val), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedVecInnerElement { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedVecInnerElement", + "val", + &&self.val, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedVecInnerElement { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedVecInnerElement {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedVecInnerElement { + #[inline] + fn eq(&self, other: &UsedVecInnerElement) -> bool { + self.val == other.val + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDVECINNERELEMENT: [u8; 56usize] = UsedVecInnerElement::spec_xdr(); +impl UsedVecInnerElement { + pub const fn spec_xdr() -> [u8; 56usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x13UsedVecInnerElement\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedVecInnerElement { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xb4\xabN]\xe3\xeaA\xd6AQ\x80Y\xe9H\xaa6L/k\xb0\x17\xcdg\x92=\x8f\x8dA\xeaXP\x18"; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDVECINNERELEMENT: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xb4\xabN]\xe3\xeaA\xd6AQ\x80Y\xe9H\xaa6L/k\xb0\x17\xcdg\x92=\x8f\x8dA\xeaXP\x18", + [], + ); +impl soroban_sdk::TryFromVal for UsedVecInnerElement { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedVecInnerElement, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedVecInnerElement, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +pub struct UsedVecElementNested { + pub val: u32, + pub inner: UsedVecInnerElement, + pub vec_inner: Vec, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedVecElementNested { + #[inline] + fn clone(&self) -> UsedVecElementNested { + UsedVecElementNested { + val: ::core::clone::Clone::clone(&self.val), + inner: ::core::clone::Clone::clone(&self.inner), + vec_inner: ::core::clone::Clone::clone(&self.vec_inner), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedVecElementNested { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "UsedVecElementNested", + "val", + &self.val, + "inner", + &self.inner, + "vec_inner", + &&self.vec_inner, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedVecElementNested { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedVecElementNested {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedVecElementNested { + #[inline] + fn eq(&self, other: &UsedVecElementNested) -> bool { + self.val == other.val && self.inner == other.inner && self.vec_inner == other.vec_inner + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDVECELEMENTNESTED: [u8; 156usize] = UsedVecElementNested::spec_xdr(); +impl UsedVecElementNested { + pub const fn spec_xdr() -> [u8; 156usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x14UsedVecElementNested\0\0\0\x03\0\0\0\0\0\0\0\x05inner\0\0\0\0\0\x07\xd0\0\0\0\x13UsedVecInnerElement\0\0\0\0\0\0\0\0\x03val\0\0\0\0\x04\0\0\0\0\0\0\0\tvec_inner\0\0\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x16UsedVecInnerVecElement\0\0" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedVecElementNested { + const SPEC_TYPE_ID: [u8; 32] = *b"\x13?J\x12d\xden|\xe9\xd0`\x82\xf0\x19\xd4s\x1e\xa4\x87\xe1\xe6p.-\xa2\x1b\xb1\xae[\xcc`\xcc"; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDVECELEMENTNESTED: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 2, + *b"\x13?J\x12d\xden|\xe9\xd0`\x82\xf0\x19\xd4s\x1e\xa4\x87\xe1\xe6p.-\xa2\x1b\xb1\xae[\xcc`\xcc", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); +impl soroban_sdk::TryFromVal for UsedVecElementNested { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["inner", "val", "vec_inner"]; + let mut vals: [Val; 3usize] = [Val::VOID.to_val(); 3usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + inner: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + val: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + vec_inner: vals[2] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedVecElementNested, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["inner", "val", "vec_inner"]; + let vals: [Val; 3usize] = [ + (&val.inner) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.val).try_into_val(env).map_err(|_| ConversionError)?, + (&val.vec_inner) + .try_into_val(env) + .map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedVecElementNested, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } +} +struct UsedNonPubStruct { + pub val: u32, +} +#[automatically_derived] +impl ::core::clone::Clone for UsedNonPubStruct { + #[inline] + fn clone(&self) -> UsedNonPubStruct { + UsedNonPubStruct { + val: ::core::clone::Clone::clone(&self.val), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedNonPubStruct { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedNonPubStruct", "val", &&self.val) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedNonPubStruct { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedNonPubStruct {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedNonPubStruct { + #[inline] + fn eq(&self, other: &UsedNonPubStruct) -> bool { + self.val == other.val + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDNONPUBSTRUCT: [u8; 52usize] = UsedNonPubStruct::spec_xdr(); +impl UsedNonPubStruct { + pub const fn spec_xdr() -> [u8; 52usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedNonPubStruct\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedNonPubStruct { + const SPEC_TYPE_ID: [u8; 32] = *b"p\x8c\x0fN!\x082\xd8n\x8c\xea\x0fh\x9c\xb8\xd8\xbe\xddnI\xa0\x91\xcdb3\xd8\x07t\x0c\xcd\xfa\xb0"; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDNONPUBSTRUCT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"p\x8c\x0fN!\x082\xd8n\x8c\xea\x0fh\x9c\xb8\xd8\xbe\xddnI\xa0\x91\xcdb3\xd8\x07t\x0c\xcd\xfa\xb0", + [], +); +impl soroban_sdk::TryFromVal for UsedNonPubStruct { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + val: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UsedNonPubStruct, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 1usize] = ["val"]; + let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UsedNonPubStruct, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +enum UsedNonPubError { + Fail = 1, +} +#[automatically_derived] +impl ::core::marker::Copy for UsedNonPubError {} +#[automatically_derived] +impl ::core::clone::Clone for UsedNonPubError { + #[inline] + fn clone(&self) -> UsedNonPubError { + *self + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UsedNonPubError { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str(f, "Fail") + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UsedNonPubError { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UsedNonPubError {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UsedNonPubError { + #[inline] + fn eq(&self, other: &UsedNonPubError) -> bool { + true + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_USEDNONPUBERROR: [u8; 52usize] = UsedNonPubError::spec_xdr(); +impl UsedNonPubError { + pub const fn spec_xdr() -> [u8; 52usize] { + *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x0fUsedNonPubError\0\0\0\0\x01\0\0\0\0\0\0\0\x04Fail\0\0\0\x01" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedNonPubError { + const SPEC_TYPE_ID: [u8; 32] = *b"\xa9<\xd8+\xb7\xa7\r\x17\xf1\x12\x1e\x03\xeb9\xb4\xa9'\xfc\x11\xab\x86>\xb5jd\\5\xf1]\xf2\xbb\x14"; +} +impl soroban_sdk::spec_shaking::SpecShakingMarker for UsedNonPubError { + #[doc(hidden)] + #[inline(always)] + fn spec_shaking_marker() { + { + static MARKER: [u8; 14usize] = *b"SpEcV1\xa9<\xd8+\xb7\xa7\r\x17"; + let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; + } + } +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDNONPUBERROR: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\xa9<\xd8+\xb7\xa7\r\x17\xf1\x12\x1e\x03\xeb9\xb4\xa9'\xfc\x11\xab\x86>\xb5jd\\5\xf1]\xf2\xbb\x14", + [], +); +impl TryFrom for UsedNonPubError { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: soroban_sdk::Error) -> Result { + if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { + let discriminant = error.get_code(); + Ok(match discriminant { + 1u32 => Self::Fail, + _ => return Err(error), + }) + } else { + Err(error) + } + } +} +impl TryFrom<&soroban_sdk::Error> for UsedNonPubError { + type Error = soroban_sdk::Error; + #[inline(always)] + fn try_from(error: &soroban_sdk::Error) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::Error { + #[inline(always)] + fn from(val: UsedNonPubError) -> soroban_sdk::Error { + <_ as From<&UsedNonPubError>>::from(&val) + } +} +impl From<&UsedNonPubError> for soroban_sdk::Error { + #[inline(always)] + fn from(val: &UsedNonPubError) -> soroban_sdk::Error { + match val { + UsedNonPubError::Fail => soroban_sdk::Error::from_contract_error(1u32), + } + } +} +impl TryFrom for UsedNonPubError { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: soroban_sdk::InvokeError) -> Result { + match error { + soroban_sdk::InvokeError::Abort => Err(error), + soroban_sdk::InvokeError::Contract(code) => Ok(match code { + 1u32 => Self::Fail, + _ => return Err(error), + }), + } + } +} +impl TryFrom<&soroban_sdk::InvokeError> for UsedNonPubError { + type Error = soroban_sdk::InvokeError; + #[inline(always)] + fn try_from(error: &soroban_sdk::InvokeError) -> Result { + <_ as TryFrom>::try_from(*error) + } +} +impl From for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: UsedNonPubError) -> soroban_sdk::InvokeError { + <_ as From<&UsedNonPubError>>::from(&val) + } +} +impl From<&UsedNonPubError> for soroban_sdk::InvokeError { + #[inline(always)] + fn from(val: &UsedNonPubError) -> soroban_sdk::InvokeError { + match val { + UsedNonPubError::Fail => soroban_sdk::InvokeError::Contract(1u32), + } + } +} +impl soroban_sdk::TryFromVal for UsedNonPubError { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let error: soroban_sdk::Error = val.try_into_val(env)?; + error.try_into().map_err(|_| soroban_sdk::ConversionError) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedRefDataType, + val: &UsedNonPubError, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["nested"]; - let vals: [Val; 1usize] = [(&val.nested) - .try_into_val(env) - .map_err(|_| ConversionError)?]; - Ok(env - .map_new_from_slices(&KEYS, &vals) - .map_err(|_| ConversionError)? - .into()) + let error: soroban_sdk::Error = val.into(); + Ok(error.into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedRefDataType, + val: &&UsedNonPubError, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub struct UsedRefDataInner { - pub val: u32, +pub struct UsedRecursiveRoot { + pub val: UsedRecursiveNode, } #[automatically_derived] -impl ::core::clone::Clone for UsedRefDataInner { +impl ::core::clone::Clone for UsedRecursiveRoot { #[inline] - fn clone(&self) -> UsedRefDataInner { - UsedRefDataInner { + fn clone(&self) -> UsedRecursiveRoot { + UsedRecursiveRoot { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedRefDataInner { +impl ::core::fmt::Debug for UsedRecursiveRoot { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedRefDataInner", "val", &&self.val) + ::core::fmt::Formatter::debug_struct_field1_finish( + f, + "UsedRecursiveRoot", + "val", + &&self.val, + ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedRefDataInner { +impl ::core::cmp::Eq for UsedRecursiveRoot { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedRefDataInner {} +impl ::core::marker::StructuralPartialEq for UsedRecursiveRoot {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedRefDataInner { +impl ::core::cmp::PartialEq for UsedRecursiveRoot { #[inline] - fn eq(&self, other: &UsedRefDataInner) -> bool { + fn eq(&self, other: &UsedRecursiveRoot) -> bool { self.val == other.val } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDREFDATAINNER: [u8; 52usize] = UsedRefDataInner::spec_xdr(); -impl UsedRefDataInner { - pub const fn spec_xdr() -> [u8; 52usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedRefDataInner\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" - } -} -impl soroban_sdk::SpecShakingMarker for UsedRefDataInner { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1K\xdf'8m/\xe8\x1d"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } -} -impl soroban_sdk::TryFromVal for UsedRefDataInner { +pub static __SPEC_XDR_TYPE_USEDRECURSIVEROOT: [u8; 80usize] = UsedRecursiveRoot::spec_xdr(); +impl UsedRecursiveRoot { + pub const fn spec_xdr() -> [u8; 80usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedRecursiveRoot\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\x07\xd0\0\0\0\x11UsedRecursiveNode\0\0\0" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedRecursiveRoot { + const SPEC_TYPE_ID: [u8; 32] = *b"u2\x0b\x97\xae\xcd\x86\xbf\x0b(\x18\x06\x90x\xae?\xceC\xbe\x7f\xc9\x9c= \xb0\xa5\xd0=j\x91\xfd\xbb"; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDRECURSIVEROOT: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 2, + *b"u2\x0b\x97\xae\xcd\x86\xbf\x0b(\x18\x06\x90x\xae?\xceC\xbe\x7f\xc9\x9c= \xb0\xa5\xd0=j\x91\xfd\xbb", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::TryFromVal for UsedRecursiveRoot { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -2878,11 +4647,11 @@ impl soroban_sdk::TryFromVal for UsedRefData }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedRefDataInner, + val: &UsedRecursiveRoot, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["val"]; @@ -2893,270 +4662,245 @@ impl soroban_sdk::TryFromVal for soroban_sdk .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedRefDataInner, + val: &&UsedRecursiveRoot, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub struct UsedEventWithRefs<'a> { - pub kind: &'a UsedRefTopicType, - pub payload: &'a UsedRefDataType, +pub enum UsedRecursiveNode { + NotRecursive(UsedLeaf), + Recursive(UsedRecursiveLeaf), } #[automatically_derived] -impl<'a> ::core::clone::Clone for UsedEventWithRefs<'a> { +impl ::core::clone::Clone for UsedRecursiveNode { #[inline] - fn clone(&self) -> UsedEventWithRefs<'a> { - UsedEventWithRefs { - kind: ::core::clone::Clone::clone(&self.kind), - payload: ::core::clone::Clone::clone(&self.payload), + fn clone(&self) -> UsedRecursiveNode { + match self { + UsedRecursiveNode::NotRecursive(__self_0) => { + UsedRecursiveNode::NotRecursive(::core::clone::Clone::clone(__self_0)) + } + UsedRecursiveNode::Recursive(__self_0) => { + UsedRecursiveNode::Recursive(::core::clone::Clone::clone(__self_0)) + } } } } #[automatically_derived] -impl<'a> ::core::fmt::Debug for UsedEventWithRefs<'a> { +impl ::core::fmt::Debug for UsedRecursiveNode { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field2_finish( - f, - "UsedEventWithRefs", - "kind", - &self.kind, - "payload", - &&self.payload, - ) - } -} -#[automatically_derived] -impl<'a> ::core::cmp::Eq for UsedEventWithRefs<'a> { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq<&'a UsedRefTopicType>; - let _: ::core::cmp::AssertParamIsEq<&'a UsedRefDataType>; - } -} -#[automatically_derived] -impl<'a> ::core::marker::StructuralPartialEq for UsedEventWithRefs<'a> {} -#[automatically_derived] -impl<'a> ::core::cmp::PartialEq for UsedEventWithRefs<'a> { - #[inline] - fn eq(&self, other: &UsedEventWithRefs<'a>) -> bool { - self.kind == other.kind && self.payload == other.payload - } -} -#[link_section = "contractspecv0"] -pub static __SPEC_XDR_EVENT_USEDEVENTWITHREFS: [u8; 156usize] = UsedEventWithRefs::spec_xdr(); -impl<'a> UsedEventWithRefs<'a> { - pub const fn spec_xdr() -> [u8; 156usize] { - *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x11UsedEventWithRefs\0\0\0\0\0\0\x01\0\0\0\x14used_event_with_refs\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\x07\xd0\0\0\0\x10UsedRefTopicType\0\0\0\x01\0\0\0\0\0\0\0\x07payload\0\0\0\x07\xd0\0\0\0\x0fUsedRefDataType\0\0\0\0\0\0\0\0\x02" - } -} -impl<'a> soroban_sdk::SpecShakingMarker for UsedEventWithRefs<'a> { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - <&'a UsedRefTopicType as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - <&'a UsedRefDataType as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1[Q+\xe9\xde\xd5\xf2>"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } -} -impl<'a> soroban_sdk::Event for UsedEventWithRefs<'a> { - fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { - use soroban_sdk::IntoVal; - ( - &{ soroban_sdk::Symbol::new(env, "used_event_with_refs") }, - { - let v: soroban_sdk::Val = self.kind.into_val(env); - v - }, - ) - .into_val(env) - } - fn data(&self, env: &soroban_sdk::Env) -> soroban_sdk::Val { - use soroban_sdk::{unwrap::UnwrapInfallible, EnvBase, IntoVal}; - const KEYS: [&'static str; 1usize] = ["payload"]; - let vals: [soroban_sdk::Val; 1usize] = [self.payload.into_val(env)]; - env.map_new_from_slices(&KEYS, &vals) - .unwrap_infallible() - .into() - } -} -impl<'a> UsedEventWithRefs<'a> { - pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); - <_ as soroban_sdk::Event>::publish(self, env); - } -} -pub struct UsedTupleElement { - pub val: u32, -} -#[automatically_derived] -impl ::core::clone::Clone for UsedTupleElement { - #[inline] - fn clone(&self) -> UsedTupleElement { - UsedTupleElement { - val: ::core::clone::Clone::clone(&self.val), + match self { + UsedRecursiveNode::NotRecursive(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "NotRecursive", &__self_0) + } + UsedRecursiveNode::Recursive(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Recursive", &__self_0) + } } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedTupleElement { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedTupleElement", "val", &&self.val) - } -} -#[automatically_derived] -impl ::core::cmp::Eq for UsedTupleElement { +impl ::core::cmp::Eq for UsedRecursiveNode { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedTupleElement {} +impl ::core::marker::StructuralPartialEq for UsedRecursiveNode {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedTupleElement { +impl ::core::cmp::PartialEq for UsedRecursiveNode { #[inline] - fn eq(&self, other: &UsedTupleElement) -> bool { - self.val == other.val + fn eq(&self, other: &UsedRecursiveNode) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + UsedRecursiveNode::NotRecursive(__self_0), + UsedRecursiveNode::NotRecursive(__arg1_0), + ) => __self_0 == __arg1_0, + ( + UsedRecursiveNode::Recursive(__self_0), + UsedRecursiveNode::Recursive(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDTUPLEELEMENT: [u8; 52usize] = UsedTupleElement::spec_xdr(); -impl UsedTupleElement { - pub const fn spec_xdr() -> [u8; 52usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedTupleElement\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" - } -} -impl soroban_sdk::SpecShakingMarker for UsedTupleElement { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xde\x1dMa\x01\xec\xb0A"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } -} -impl soroban_sdk::TryFromVal for UsedTupleElement { +pub static __SPEC_XDR_TYPE_USEDRECURSIVENODE: [u8; 140usize] = UsedRecursiveNode::spec_xdr(); +impl UsedRecursiveNode { + pub const fn spec_xdr() -> [u8; 140usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x11UsedRecursiveNode\0\0\0\0\0\0\x02\0\0\0\x01\0\0\0\0\0\0\0\x0cNotRecursive\0\0\0\x01\0\0\x07\xd0\0\0\0\x08UsedLeaf\0\0\0\x01\0\0\0\0\0\0\0\tRecursive\0\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x11UsedRecursiveLeaf\0\0\0" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedRecursiveNode { + const SPEC_TYPE_ID: [u8; 32] = + *b"*\\\x9c\xf4e\xaa\x1e]V\xdcG\x0f>f\xb3N\xf3\xa9\xf5\t\x86y\xbf\0\x11Q\t\xf3\xc8\xae\xf4E"; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDRECURSIVENODE: [u8; 106usize] = + soroban_sdk::spec_shaking::encode_graph_record::<106usize, 2usize>( + 2, + *b"*\\\x9c\xf4e\xaa\x1e]V\xdcG\x0f>f\xb3N\xf3\xa9\xf5\t\x86y\xbf\0\x11Q\t\xf3\xc8\xae\xf4E", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); +impl soroban_sdk::TryFromVal for UsedRecursiveNode { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, val: &soroban_sdk::Val, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let mut vals: [Val; 1usize] = [Val::VOID.to_val(); 1usize]; - let map: MapObject = val.try_into().map_err(|_| ConversionError)?; - env.map_unpack_to_slice(map, &KEYS, &mut vals) - .map_err(|_| ConversionError)?; - Ok(Self { - val: vals[0] - .try_into_val(env) - .map_err(|_| soroban_sdk::ConversionError)?, - }) + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["NotRecursive", "Recursive"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::NotRecursive( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Recursive( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; + #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &UsedTupleElement, + val: &UsedRecursiveNode, ) -> Result { - use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; - const KEYS: [&'static str; 1usize] = ["val"]; - let vals: [Val; 1usize] = [(&val.val).try_into_val(env).map_err(|_| ConversionError)?]; - Ok(env - .map_new_from_slices(&KEYS, &vals) - .map_err(|_| ConversionError)? - .into()) + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + UsedRecursiveNode::NotRecursive(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"NotRecursive")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + UsedRecursiveNode::Recursive(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Recursive")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedTupleElement, + val: &&UsedRecursiveNode, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -pub struct UsedTupleReturnElement { - pub val: u32, +pub struct UsedRecursiveLeaf { + pub val: Vec, } #[automatically_derived] -impl ::core::clone::Clone for UsedTupleReturnElement { +impl ::core::clone::Clone for UsedRecursiveLeaf { #[inline] - fn clone(&self) -> UsedTupleReturnElement { - UsedTupleReturnElement { + fn clone(&self) -> UsedRecursiveLeaf { + UsedRecursiveLeaf { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedTupleReturnElement { +impl ::core::fmt::Debug for UsedRecursiveLeaf { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ::core::fmt::Formatter::debug_struct_field1_finish( f, - "UsedTupleReturnElement", + "UsedRecursiveLeaf", "val", &&self.val, ) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedTupleReturnElement { +impl ::core::cmp::Eq for UsedRecursiveLeaf { #[inline] #[doc(hidden)] #[coverage(off)] fn assert_receiver_is_total_eq(&self) -> () { - let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedTupleReturnElement {} +impl ::core::marker::StructuralPartialEq for UsedRecursiveLeaf {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedTupleReturnElement { +impl ::core::cmp::PartialEq for UsedRecursiveLeaf { #[inline] - fn eq(&self, other: &UsedTupleReturnElement) -> bool { + fn eq(&self, other: &UsedRecursiveLeaf) -> bool { self.val == other.val } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDTUPLERETURNELEMENT: [u8; 60usize] = - UsedTupleReturnElement::spec_xdr(); -impl UsedTupleReturnElement { - pub const fn spec_xdr() -> [u8; 60usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x16UsedTupleReturnElement\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" - } -} -impl soroban_sdk::SpecShakingMarker for UsedTupleReturnElement { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1Y\xa66\xb3\xecxE\x13"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } -} -impl soroban_sdk::TryFromVal for UsedTupleReturnElement { +pub static __SPEC_XDR_TYPE_USEDRECURSIVELEAF: [u8; 84usize] = UsedRecursiveLeaf::spec_xdr(); +impl UsedRecursiveLeaf { + pub const fn spec_xdr() -> [u8; 84usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x11UsedRecursiveLeaf\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x11UsedRecursiveRoot\0\0\0" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedRecursiveLeaf { + const SPEC_TYPE_ID: [u8; 32] = *b"?\xd9\xb3q\xdep>\xf3\xab\xb06G\x9d\xb5\x9cd\x9c\x97\xa5T\xcc\xa1\x98*\x83\xe90\xdd\xdb#\x186"; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_USEDRECURSIVELEAF: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 2, + *b"?\xd9\xb3q\xdep>\xf3\xab\xb06G\x9d\xb5\x9cd\x9c\x97\xa5T\xcc\xa1\x98*\x83\xe90\xdd\xdb#\x186", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::TryFromVal for UsedRecursiveLeaf { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -3175,11 +4919,11 @@ impl soroban_sdk::TryFromVal for UsedTupleRe }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedTupleReturnElement, + val: &UsedRecursiveLeaf, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["val"]; @@ -3190,39 +4934,37 @@ impl soroban_sdk::TryFromVal for sorob .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedTupleReturnElement, + val: &&UsedRecursiveLeaf, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val( - env, *val, - ) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -struct UsedNonPubStruct { +pub struct UsedLeaf { pub val: u32, } #[automatically_derived] -impl ::core::clone::Clone for UsedNonPubStruct { +impl ::core::clone::Clone for UsedLeaf { #[inline] - fn clone(&self) -> UsedNonPubStruct { - UsedNonPubStruct { + fn clone(&self) -> UsedLeaf { + UsedLeaf { val: ::core::clone::Clone::clone(&self.val), } } } #[automatically_derived] -impl ::core::fmt::Debug for UsedNonPubStruct { +impl ::core::fmt::Debug for UsedLeaf { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedNonPubStruct", "val", &&self.val) + ::core::fmt::Formatter::debug_struct_field1_finish(f, "UsedLeaf", "val", &&self.val) } } #[automatically_derived] -impl ::core::cmp::Eq for UsedNonPubStruct { +impl ::core::cmp::Eq for UsedLeaf { #[inline] #[doc(hidden)] #[coverage(off)] @@ -3231,33 +4973,35 @@ impl ::core::cmp::Eq for UsedNonPubStruct { } } #[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedNonPubStruct {} +impl ::core::marker::StructuralPartialEq for UsedLeaf {} #[automatically_derived] -impl ::core::cmp::PartialEq for UsedNonPubStruct { +impl ::core::cmp::PartialEq for UsedLeaf { #[inline] - fn eq(&self, other: &UsedNonPubStruct) -> bool { + fn eq(&self, other: &UsedLeaf) -> bool { self.val == other.val } } #[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDNONPUBSTRUCT: [u8; 52usize] = UsedNonPubStruct::spec_xdr(); -impl UsedNonPubStruct { - pub const fn spec_xdr() -> [u8; 52usize] { - *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x10UsedNonPubStruct\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" - } -} -impl soroban_sdk::SpecShakingMarker for UsedNonPubStruct { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1p\x8c\x0fN!\x082\xd8"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } -} -impl soroban_sdk::TryFromVal for UsedNonPubStruct { +pub static __SPEC_XDR_TYPE_USEDLEAF: [u8; 44usize] = UsedLeaf::spec_xdr(); +impl UsedLeaf { + pub const fn spec_xdr() -> [u8; 44usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x08UsedLeaf\0\0\0\x01\0\0\0\0\0\0\0\x03val\0\0\0\0\x04" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UsedLeaf { + const SPEC_TYPE_ID: [u8; 32] = *b"\xe6Q\xd5T\x13\x8a\xb7l\xa1E\xc4q\x84\x01\xf9Y\xe49\x83( + 2, + *b"\xe6Q\xd5T\x13\x8a\xb7l\xa1E\xc4q\x84\x01\xf9Y\xe49\x83 for UsedLeaf { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, @@ -3276,11 +5020,11 @@ impl soroban_sdk::TryFromVal for UsedNonPubS }) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; fn try_from_val( env: &soroban_sdk::Env, - val: &UsedNonPubStruct, + val: &UsedLeaf, ) -> Result { use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; const KEYS: [&'static str; 1usize] = ["val"]; @@ -3291,169 +5035,14 @@ impl soroban_sdk::TryFromVal for soroban_sdk .into()) } } -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &&UsedNonPubStruct, - ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) - } -} -enum UsedNonPubError { - Fail = 1, -} -#[automatically_derived] -impl ::core::marker::Copy for UsedNonPubError {} -#[automatically_derived] -impl ::core::clone::Clone for UsedNonPubError { - #[inline] - fn clone(&self) -> UsedNonPubError { - *self - } -} -#[automatically_derived] -impl ::core::fmt::Debug for UsedNonPubError { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str(f, "Fail") - } -} -#[automatically_derived] -impl ::core::cmp::Eq for UsedNonPubError { - #[inline] - #[doc(hidden)] - #[coverage(off)] - fn assert_receiver_is_total_eq(&self) -> () {} -} -#[automatically_derived] -impl ::core::marker::StructuralPartialEq for UsedNonPubError {} -#[automatically_derived] -impl ::core::cmp::PartialEq for UsedNonPubError { - #[inline] - fn eq(&self, other: &UsedNonPubError) -> bool { - true - } -} -#[link_section = "contractspecv0"] -pub static __SPEC_XDR_TYPE_USEDNONPUBERROR: [u8; 52usize] = UsedNonPubError::spec_xdr(); -impl UsedNonPubError { - pub const fn spec_xdr() -> [u8; 52usize] { - *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x0fUsedNonPubError\0\0\0\0\x01\0\0\0\0\0\0\0\x04Fail\0\0\0\x01" - } -} -impl soroban_sdk::SpecShakingMarker for UsedNonPubError { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xa9<\xd8+\xb7\xa7\r\x17"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } -} -impl TryFrom for UsedNonPubError { - type Error = soroban_sdk::Error; - #[inline(always)] - fn try_from(error: soroban_sdk::Error) -> Result { - if error.is_type(soroban_sdk::xdr::ScErrorType::Contract) { - let discriminant = error.get_code(); - Ok(match discriminant { - 1u32 => Self::Fail, - _ => return Err(error), - }) - } else { - Err(error) - } - } -} -impl TryFrom<&soroban_sdk::Error> for UsedNonPubError { - type Error = soroban_sdk::Error; - #[inline(always)] - fn try_from(error: &soroban_sdk::Error) -> Result { - <_ as TryFrom>::try_from(*error) - } -} -impl From for soroban_sdk::Error { - #[inline(always)] - fn from(val: UsedNonPubError) -> soroban_sdk::Error { - <_ as From<&UsedNonPubError>>::from(&val) - } -} -impl From<&UsedNonPubError> for soroban_sdk::Error { - #[inline(always)] - fn from(val: &UsedNonPubError) -> soroban_sdk::Error { - match val { - UsedNonPubError::Fail => soroban_sdk::Error::from_contract_error(1u32), - } - } -} -impl TryFrom for UsedNonPubError { - type Error = soroban_sdk::InvokeError; - #[inline(always)] - fn try_from(error: soroban_sdk::InvokeError) -> Result { - match error { - soroban_sdk::InvokeError::Abort => Err(error), - soroban_sdk::InvokeError::Contract(code) => Ok(match code { - 1u32 => Self::Fail, - _ => return Err(error), - }), - } - } -} -impl TryFrom<&soroban_sdk::InvokeError> for UsedNonPubError { - type Error = soroban_sdk::InvokeError; - #[inline(always)] - fn try_from(error: &soroban_sdk::InvokeError) -> Result { - <_ as TryFrom>::try_from(*error) - } -} -impl From for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: UsedNonPubError) -> soroban_sdk::InvokeError { - <_ as From<&UsedNonPubError>>::from(&val) - } -} -impl From<&UsedNonPubError> for soroban_sdk::InvokeError { - #[inline(always)] - fn from(val: &UsedNonPubError) -> soroban_sdk::InvokeError { - match val { - UsedNonPubError::Fail => soroban_sdk::InvokeError::Contract(1u32), - } - } -} -impl soroban_sdk::TryFromVal for UsedNonPubError { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &soroban_sdk::Val, - ) -> Result { - use soroban_sdk::TryIntoVal; - let error: soroban_sdk::Error = val.try_into_val(env)?; - error.try_into().map_err(|_| soroban_sdk::ConversionError) - } -} -impl soroban_sdk::TryFromVal for soroban_sdk::Val { - type Error = soroban_sdk::ConversionError; - #[inline(always)] - fn try_from_val( - env: &soroban_sdk::Env, - val: &UsedNonPubError, - ) -> Result { - let error: soroban_sdk::Error = val.into(); - Ok(error.into()) - } -} -impl soroban_sdk::TryFromVal for soroban_sdk::Val { +impl soroban_sdk::TryFromVal for soroban_sdk::Val { type Error = soroban_sdk::ConversionError; #[inline(always)] fn try_from_val( env: &soroban_sdk::Env, - val: &&UsedNonPubError, + val: &&UsedLeaf, ) -> Result { - <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } mod wasm_imported { @@ -3787,18 +5376,18 @@ mod wasm_imported { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x07StructA\0\0\0\0\x02\0\0\0\0\0\0\0\x02f1\0\0\0\0\0\x04\0\0\0\0\0\0\0\x02f2\0\0\0\0\0\x01" } } - impl soroban_sdk::SpecShakingMarker for StructA { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xb6\x1c\xfd\xdfhY-d"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } + impl soroban_sdk::spec_shaking::SpecTypeId for StructA { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xb6\x1c\xfd\xdfhY-d\xc190\xf9\xa0\xde\x1b&\xc5y\xfe\x80R\x860\xa4\xa2GE\xd7\xcd,YJ"; } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_STRUCTA: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xb6\x1c\xfd\xdfhY-d\xc190\xf9\xa0\xde\x1b&\xc5y\xfe\x80R\x860\xa4\xa2GE\xd7\xcd,YJ", + [], + ); impl soroban_sdk::TryFromVal for StructA { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -3920,18 +5509,18 @@ mod wasm_imported { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x07StructB\0\0\0\0\x02\0\0\0\0\0\0\0\x02f1\0\0\0\0\0\x07\0\0\0\0\0\0\0\x02f2\0\0\0\0\0\x10" } } - impl soroban_sdk::SpecShakingMarker for StructB { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xf3\xc4\xd3\x8c\xc1w\xe9\x18"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } + impl soroban_sdk::spec_shaking::SpecTypeId for StructB { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xf3\xc4\xd3\x8c\xc1w\xe9\x18\x7f\xbdXAi{P7\xbe\xa3riQ*,\x95\xa2\xb0\xe6\x9fo#&`"; } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_STRUCTB: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xf3\xc4\xd3\x8c\xc1w\xe9\x18\x7f\xbdXAi{P7\xbe\xa3riQ*,\x95\xa2\xb0\xe6\x9fo#&`", + [], + ); impl soroban_sdk::TryFromVal for StructB { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -4053,18 +5642,19 @@ mod wasm_imported { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x07StructC\0\0\0\0\x02\0\0\0\0\0\0\0\x02f1\0\0\0\0\x03\xea\0\0\0\x04\0\0\0\0\0\0\0\x02f2\0\0\0\0\0\x13" } } - impl soroban_sdk::SpecShakingMarker for StructC { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xa3\x16\n\x8f\xc9\x92\xd2\x11"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } - } + impl soroban_sdk::spec_shaking::SpecTypeId for StructC { + const SPEC_TYPE_ID: [u8; 32] = *b"\xa3\x16\n\x8f\xc9\x92\xd2\x11\xfe\x9f\x8b\x9a\x1f L\xd2\x0f\xec\x8a\xc7\xcdwU\x85\xc5\x166\xe7|\xad)N"; + } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_STRUCTC: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\xa3\x16\n\x8f\xc9\x92\xd2\x11\xfe\x9f\x8b\x9a\x1f L\xd2\x0f\xec\x8a\xc7\xcdwU\x85\xc5\x166\xe7|\xad)N", + [], + ); impl soroban_sdk::TryFromVal for StructC { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -4183,18 +5773,19 @@ mod wasm_imported { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0cStructTupleA\0\0\0\x02\0\0\0\0\0\0\0\x010\0\0\0\0\0\0\x07\0\0\0\0\0\0\0\x011\0\0\0\0\0\0\x07" } } - impl soroban_sdk::SpecShakingMarker for StructTupleA { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xcf)\x97]S\xb2\xfd)"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } + impl soroban_sdk::spec_shaking::SpecTypeId for StructTupleA { + const SPEC_TYPE_ID: [u8; 32] = *b"\xcf)\x97]S\xb2\xfd)9\x03!Po\x97\xbb%\x93l\x96\xc9V\xcf\xa97\x9d\r\xf3\x0c\xe5\x1f.["; } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_STRUCTTUPLEA: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\xcf)\x97]S\xb2\xfd)9\x03!Po\x97\xbb%\x93l\x96\xc9V\xcf\xa97\x9d\r\xf3\x0c\xe5\x1f.[", + [], + ); impl soroban_sdk::TryFromVal for StructTupleA { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -4309,18 +5900,19 @@ mod wasm_imported { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0cStructTupleB\0\0\0\x02\0\0\0\0\0\0\0\x010\0\0\0\0\0\0\n\0\0\0\0\0\0\0\x011\0\0\0\0\0\0\n" } } - impl soroban_sdk::SpecShakingMarker for StructTupleB { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1x\xd98\x9c\x1ao\xac\x8c"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } + impl soroban_sdk::spec_shaking::SpecTypeId for StructTupleB { + const SPEC_TYPE_ID: [u8; 32] = *b"x\xd98\x9c\x1ao\xac\x8c\x08v\x8b\xec\xbf\xeb\xbd~\xd0\xb8F\xaa\xbc\x12<\xa0\x89\xe1L&\x9e\x04\xfc\xa0"; } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_STRUCTTUPLEB: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"x\xd98\x9c\x1ao\xac\x8c\x08v\x8b\xec\xbf\xeb\xbd~\xd0\xb8F\xaa\xbc\x12<\xa0\x89\xe1L&\x9e\x04\xfc\xa0", + [], + ); impl soroban_sdk::TryFromVal for StructTupleB { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -4436,18 +6028,19 @@ mod wasm_imported { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0cStructTupleC\0\0\0\x02\0\0\0\0\0\0\0\x010\0\0\0\0\0\0\x13\0\0\0\0\0\0\0\x011\0\0\0\0\0\0\x0b" } } - impl soroban_sdk::SpecShakingMarker for StructTupleC { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xc5=\x81\xc1\"\xafT\xd9"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } + impl soroban_sdk::spec_shaking::SpecTypeId for StructTupleC { + const SPEC_TYPE_ID: [u8; 32] = *b"\xc5=\x81\xc1\"\xafT\xd9\x03\x9b\x9a]\xc4mcc\xa0y|\x12j\xe5\x9e\xb4_A\xfb\x08j#\x99\x9b"; } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_STRUCTTUPLEC: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\xc5=\x81\xc1\"\xafT\xd9\x03\x9b\x9a]\xc4mcc\xa0y|\x12j\xe5\x9e\xb4_A\xfb\x08j#\x99\x9b", + [], + ); impl soroban_sdk::TryFromVal for StructTupleC { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -4567,16 +6160,19 @@ mod wasm_imported { *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x05EnumA\0\0\0\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x02V1\0\0\0\0\0\0\0\0\0\0\0\0\0\x02V2\0\0\0\0\0\0\0\0\0\0\0\0\0\x02V3\0\0" } } - impl soroban_sdk::SpecShakingMarker for EnumA { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xa2=N\xc1p\x95\x90\xb2"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } + impl soroban_sdk::spec_shaking::SpecTypeId for EnumA { + const SPEC_TYPE_ID: [u8; 32] = *b"\xa2=N\xc1p\x95\x90\xb2/\xd4:\xe6\xc6\xae\xa2Z\xdbw\xdf\x9bT\xc6\x1a\xdd\xf1\x7f=u\xbdz\x07\xeb"; } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ENUMA: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\xa2=N\xc1p\x95\x90\xb2/\xd4:\xe6\xc6\xae\xa2Z\xdbw\xdf\x9bT\xc6\x1a\xdd\xf1\x7f=u\xbdz\x07\xeb", + [], + ); impl soroban_sdk::TryFromVal for EnumA { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -4772,17 +6368,18 @@ mod wasm_imported { *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x05EnumB\0\0\0\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x02V1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02V2\0\0\0\0\0\x01\0\0\0\x07\0\0\0\x01\0\0\0\0\0\0\0\x02V3\0\0\0\0\0\x02\0\0\0\x07\0\0\0\x07" } } - impl soroban_sdk::SpecShakingMarker for EnumB { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1'\x1b\0DSH^\xcc"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } + impl soroban_sdk::spec_shaking::SpecTypeId for EnumB { + const SPEC_TYPE_ID: [u8; 32] = + *b"'\x1b\0DSH^\xcc\x19\x8f\x93\xda\x937\xd01\"v\x96k\xce\xf4\xe7\xbact)\xb3KY\t\x89"; } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ENUMB: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"'\x1b\0DSH^\xcc\x19\x8f\x93\xda\x937\xd01\"v\x96k\xce\xf4\xe7\xbact)\xb3KY\t\x89", + [], + ); impl soroban_sdk::TryFromVal for EnumB { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -4980,18 +6577,22 @@ mod wasm_imported { *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x05EnumC\0\0\0\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x02V1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02V2\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x07StructA\0\0\0\0\x01\0\0\0\0\0\0\0\x02V3\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x0cStructTupleA" } } - impl soroban_sdk::SpecShakingMarker for EnumC { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xa0\xdd\x8f\xdc\xc9W\xbe\xc2"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } + impl soroban_sdk::spec_shaking::SpecTypeId for EnumC { + const SPEC_TYPE_ID: [u8; 32] = *b"\xa0\xdd\x8f\xdc\xc9W\xbe\xc2P;\x8c\xbd\xe5\x17V\x11\xf5\xfc_\x82X@\x0e\x8f4\xab|\xdc\xf7\xfd\x96D"; } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ENUMC: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, + >( + 2, + *b"\xa0\xdd\x8f\xdc\xc9W\xbe\xc2P;\x8c\xbd\xe5\x17V\x11\xf5\xfc_\x82X@\x0e\x8f4\xab|\xdc\xf7\xfd\x96D", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); impl soroban_sdk::TryFromVal for EnumC { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -5155,16 +6756,19 @@ mod wasm_imported { *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x08EnumIntA\0\0\0\x03\0\0\0\0\0\0\0\x02V1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02V2\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02V3\0\0\0\0\0\x03" } } - impl soroban_sdk::SpecShakingMarker for EnumIntA { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - { - static MARKER: [u8; 14usize] = *b"SpEcV1V]\x80\\~\x1a\x08/"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } + impl soroban_sdk::spec_shaking::SpecTypeId for EnumIntA { + const SPEC_TYPE_ID: [u8; 32] = *b"V]\x80\\~\x1a\x08/\xa1\x13\xf0r\x98\xa8\xc8\x9c\xdfS\x1b\xbc\x80\x10nP\x81\xfd-\x90\n\xab\x99\t"; } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ENUMINTA: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"V]\x80\\~\x1a\x08/\xa1\x13\xf0r\x98\xa8\xc8\x9c\xdfS\x1b\xbc\x80\x10nP\x81\xfd-\x90\n\xab\x99\t", + [], + ); impl soroban_sdk::TryFromVal for EnumIntA { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -5277,16 +6881,19 @@ mod wasm_imported { *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x08EnumIntB\0\0\0\x03\0\0\0\0\0\0\0\x02V1\0\0\0\0\0\n\0\0\0\0\0\0\0\x02V2\0\0\0\0\0\x14\0\0\0\0\0\0\0\x02V3\0\0\0\0\0\x1e" } } - impl soroban_sdk::SpecShakingMarker for EnumIntB { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - { - static MARKER: [u8; 14usize] = *b"SpEcV1,\x9c\xc0_\xed_)\x85"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } + impl soroban_sdk::spec_shaking::SpecTypeId for EnumIntB { + const SPEC_TYPE_ID: [u8; 32] = *b",\x9c\xc0_\xed_)\x85\x9b\x01\xac\x9d\xf9OMlv*\xfbE\x8f\xab\x8f.\xdaQ\x161\xc1\x07\xbap"; } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ENUMINTB: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b",\x9c\xc0_\xed_)\x85\x9b\x01\xac\x9d\xf9OMlv*\xfbE\x8f\xab\x8f.\xdaQ\x161\xc1\x07\xbap", + [], + ); impl soroban_sdk::TryFromVal for EnumIntB { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -5399,16 +7006,19 @@ mod wasm_imported { *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x08EnumIntC\0\0\0\x03\0\0\0\0\0\0\0\x02V1\0\0\0\0\0d\0\0\0\0\0\0\0\x02V2\0\0\0\0\0\xc8\0\0\0\0\0\0\0\x02V3\0\0\0\0\x01," } } - impl soroban_sdk::SpecShakingMarker for EnumIntC { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - { - static MARKER: [u8; 14usize] = *b"SpEcV1`\xca\xda\x19\xb9c\xf0/"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } + impl soroban_sdk::spec_shaking::SpecTypeId for EnumIntC { + const SPEC_TYPE_ID: [u8; 32] = *b"`\xca\xda\x19\xb9c\xf0/\xb0T\x02-\x98\x95\xbd\xbb\x87\xbf-\x9d\x1bp\xf0=\x96\xf2D\xf6yT\xdc\xd4"; } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ENUMINTC: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"`\xca\xda\x19\xb9c\xf0/\xb0T\x02-\x98\x95\xbd\xbb\x87\xbf-\x9d\x1bp\xf0=\x96\xf2D\xf6yT\xdc\xd4", + [], + ); impl soroban_sdk::TryFromVal for EnumIntC { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -5521,7 +7131,10 @@ mod wasm_imported { *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x06ErrorA\0\0\0\0\0\x03\0\0\0\0\0\0\0\x02E1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02E2\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02E3\0\0\0\0\0\x03" } } - impl soroban_sdk::SpecShakingMarker for ErrorA { + impl soroban_sdk::spec_shaking::SpecTypeId for ErrorA { + const SPEC_TYPE_ID: [u8; 32] = *b"\xe9R\xa7\xe8b\x99\xa2\xc3\x15$]1\x88\xb5~p\x1c\xe0\xc5.\xac\x12\xb8\xbd\xd5t\xfd[\x98B\xb7d"; + } + impl soroban_sdk::spec_shaking::SpecShakingMarker for ErrorA { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() { @@ -5531,6 +7144,16 @@ mod wasm_imported { } } } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ERRORA: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\xe9R\xa7\xe8b\x99\xa2\xc3\x15$]1\x88\xb5~p\x1c\xe0\xc5.\xac\x12\xb8\xbd\xd5t\xfd[\x98B\xb7d", + [], + ); impl TryFrom for ErrorA { type Error = soroban_sdk::Error; #[inline(always)] @@ -5713,7 +7336,10 @@ mod wasm_imported { *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x06ErrorB\0\0\0\0\0\x03\0\0\0\0\0\0\0\x02E1\0\0\0\0\0\n\0\0\0\0\0\0\0\x02E2\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02E3\0\0\0\0\0\x0c" } } - impl soroban_sdk::SpecShakingMarker for ErrorB { + impl soroban_sdk::spec_shaking::SpecTypeId for ErrorB { + const SPEC_TYPE_ID: [u8; 32] = *b"\x1d1\xd6\xfb\x88\xd2=\xe3}\xcd\xe8\xd8\xc1 \xd0\x9c\xfe\xab|\xdd\xaf!>\xa6=\xbf8`\xcd\x82CR"; + } + impl soroban_sdk::spec_shaking::SpecShakingMarker for ErrorB { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() { @@ -5723,6 +7349,16 @@ mod wasm_imported { } } } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ERRORB: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\x1d1\xd6\xfb\x88\xd2=\xe3}\xcd\xe8\xd8\xc1 \xd0\x9c\xfe\xab|\xdd\xaf!>\xa6=\xbf8`\xcd\x82CR", + [], + ); impl TryFrom for ErrorB { type Error = soroban_sdk::Error; #[inline(always)] @@ -5905,7 +7541,10 @@ mod wasm_imported { *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x06ErrorC\0\0\0\0\0\x03\0\0\0\0\0\0\0\x02E1\0\0\0\0\0d\0\0\0\0\0\0\0\x02E2\0\0\0\0\0e\0\0\0\0\0\0\0\x02E3\0\0\0\0\0f" } } - impl soroban_sdk::SpecShakingMarker for ErrorC { + impl soroban_sdk::spec_shaking::SpecTypeId for ErrorC { + const SPEC_TYPE_ID: [u8; 32] = *b"\xb9\x01\xafj\xe0c\xa3\rk\x83\xec\x83DA\xd9\\q\xfbtE\xc0\xf8\x83\xdd\x84\xc9\xb0\x95\x18\x98pd"; + } + impl soroban_sdk::spec_shaking::SpecShakingMarker for ErrorC { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() { @@ -5915,6 +7554,16 @@ mod wasm_imported { } } } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_ERRORC: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\xb9\x01\xafj\xe0c\xa3\rk\x83\xec\x83DA\xd9\\q\xfbtE\xc0\xf8\x83\xdd\x84\xc9\xb0\x95\x18\x98pd", + [], + ); impl TryFrom for ErrorC { type Error = soroban_sdk::Error; #[inline(always)] @@ -6097,18 +7746,14 @@ mod wasm_imported { *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x06EventA\0\0\0\0\0\x01\0\0\0\x07event_a\0\0\0\0\x02\0\0\0\0\0\0\0\x02f1\0\0\0\0\0\x13\0\0\0\x01\0\0\0\0\0\0\0\x02f2\0\0\0\0\0\x10\0\0\0\0\0\0\0\x02" } } - impl soroban_sdk::SpecShakingMarker for EventA { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1K\xe6\x8ej\x19\x9en\xbd"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } - } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_EVENT_EVENTA: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 1, + *b"K\xe6\x8ej\x19\x9en\xbd\xccv\xd2:}`\x07\xddn\xe9\x904>\x9b^h\xa7\x04%Be#r\x9b", + [], + ); impl soroban_sdk::Event for EventA { fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { use soroban_sdk::IntoVal; @@ -6136,7 +7781,10 @@ mod wasm_imported { } impl EventA { pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); + { + static MARKER: [u8; 14usize] = *b"SpEcV1K\xe6\x8ej\x19\x9en\xbd"; + let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; + } <_ as soroban_sdk::Event>::publish(self, env); } } @@ -6222,19 +7870,16 @@ mod wasm_imported { *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x06EventB\0\0\0\0\0\x01\0\0\0\x07event_b\0\0\0\0\x03\0\0\0\0\0\0\0\x02f1\0\0\0\0\0\x13\0\0\0\x01\0\0\0\0\0\0\0\x02f2\0\0\0\0\0\x13\0\0\0\x01\0\0\0\0\0\0\0\x02f3\0\0\0\0\0\x0b\0\0\0\0\0\0\0\x02" } } - impl soroban_sdk::SpecShakingMarker for EventB { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xe6\xaa\xefz\x17i$\x15"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } - } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_EVENT_EVENTB: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 1, + *b"\xe6\xaa\xefz\x17i$\x15\x95\x112\x06\xef\xd7R\xa8\xc9\x83\xf2\xc8\x87i\xadz\x1e\xdc\x8e\x90\x1c-\x80`", + [], + ); impl soroban_sdk::Event for EventB { fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { use soroban_sdk::IntoVal; @@ -6266,7 +7911,10 @@ mod wasm_imported { } impl EventB { pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); + { + static MARKER: [u8; 14usize] = *b"SpEcV1\xe6\xaa\xefz\x17i$\x15"; + let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; + } <_ as soroban_sdk::Event>::publish(self, env); } } @@ -6351,19 +7999,16 @@ mod wasm_imported { *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x06EventC\0\0\0\0\0\x01\0\0\0\x07event_c\0\0\0\0\x03\0\0\0\0\0\0\0\x02f1\0\0\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x02f2\0\0\0\0\0\x07\0\0\0\0\0\0\0\0\0\0\0\x02f3\0\0\0\0\0\x07\0\0\0\0\0\0\0\x02" } } - impl soroban_sdk::SpecShakingMarker for EventC { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\x16\xd6\xdf\xe7\xdb\xb4W@"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } - } + #[link_section = "contractspecv0.rssdk.graphv0"] + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_EVENT_EVENTC: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 1, + *b"\x16\xd6\xdf\xe7\xdb\xb4W@\x9b\x92\x97\xb9\x1a\x14\xeeK\xbf6\xfe\x92\xab`\xa1\xe3\xc8r\\\"T0\xb8!", + [], + ); impl soroban_sdk::Event for EventC { fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { use soroban_sdk::IntoVal; @@ -6391,7 +8036,10 @@ mod wasm_imported { } impl EventC { pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); + { + static MARKER: [u8; 14usize] = *b"SpEcV1\x16\xd6\xdf\xe7\xdb\xb4W@"; + let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; + } <_ as soroban_sdk::Event>::publish(self, env); } } @@ -6440,17 +8088,19 @@ impl UnusedStruct { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0cUnusedStruct\0\0\0\x01\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UnusedStruct { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1|\x9c\t\x1e\xf5\xa8\x19\xa0"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UnusedStruct { + const SPEC_TYPE_ID: [u8; 32] = *b"|\x9c\t\x1e\xf5\xa8\x19\xa0\t\xdb\x92\xcaaA\xc9\x1e\xee\xf2\xf0\xd1\x95L\xc7\xec\xc0\x08U\x9a\xe6\x8f\xcb\x1c"; } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UNUSEDSTRUCT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"|\x9c\t\x1e\xf5\xa8\x19\xa0\t\xdb\x92\xcaaA\xc9\x1e\xee\xf2\xf0\xd1\x95L\xc7\xec\xc0\x08U\x9a\xe6\x8f\xcb\x1c", + [], +); impl soroban_sdk::TryFromVal for UnusedStruct { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -6552,17 +8202,19 @@ impl UnusedEnum { *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\nUnusedEnum\0\0\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x01A\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01B\0\0\0\0\0\0\x01\0\0\0\x07" } } -impl soroban_sdk::SpecShakingMarker for UnusedEnum { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1/\x82\x9a0\xbe@\x0eZ"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UnusedEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"/\x82\x9a0\xbe@\x0eZ\xe3\x8c\xaf\xe8\x9f\xcb\x96\x9d\x06S\xe9,\x94\x9b\x83U-|16\x1d\xa3\xdb\xb1"; } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UNUSEDENUM: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"/\x82\x9a0\xbe@\x0eZ\xe3\x8c\xaf\xe8\x9f\xcb\x96\x9d\x06S\xe9,\x94\x9b\x83U-|16\x1d\xa3\xdb\xb1", + [], +); impl soroban_sdk::TryFromVal for UnusedEnum { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -6688,16 +8340,19 @@ impl UnusedIntEnum { *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\rUnusedIntEnum\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02U1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02U2\0\0\0\0\0\x02" } } -impl soroban_sdk::SpecShakingMarker for UnusedIntEnum { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - { - static MARKER: [u8; 14usize] = *b"SpEcV1\x0c\xdd\xee~,\x83\xe4\x9c"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UnusedIntEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"\x0c\xdd\xee~,\x83\xe4\x9c\xf6\x82\x80\xd5\xc3\xe4\xce\x0c\xe1\xf7\xff\xe0\xcf\x8f\x0e\xc7Cue;\xd2;\x90\xf5"; } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UNUSEDINTENUM: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\x0c\xdd\xee~,\x83\xe4\x9c\xf6\x82\x80\xd5\xc3\xe4\xce\x0c\xe1\xf7\xff\xe0\xcf\x8f\x0e\xc7Cue;\xd2;\x90\xf5", + [], +); impl soroban_sdk::TryFromVal for UnusedIntEnum { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -6791,18 +8446,16 @@ impl UnusedEvent { *b"\0\0\0\x05\0\0\0\0\0\0\0\0\0\0\0\x0bUnusedEvent\0\0\0\0\x01\0\0\0\x0cunused_event\0\0\0\x02\0\0\0\0\0\0\0\x04kind\0\0\0\x11\0\0\0\x01\0\0\0\0\0\0\0\x04data\0\0\0\x04\0\0\0\0\0\0\0\x02" } } -impl soroban_sdk::SpecShakingMarker for UnusedEvent { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\x10\xe8\xf6\xcc\xea\xc3Sb"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } -} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_EVENT_UNUSEDEVENT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 1, + *b"\x10\xe8\xf6\xcc\xea\xc3Sb\x01\xb0_\x05\xcb\xf1It\xa2\xca\xdc\xd7\xa9\xc2~\xbd_\x08\x98@y\xc2\xf1\xbf", + [], +); impl soroban_sdk::Event for UnusedEvent { fn topics(&self, env: &soroban_sdk::Env) -> soroban_sdk::Vec { use soroban_sdk::IntoVal; @@ -6823,7 +8476,10 @@ impl soroban_sdk::Event for UnusedEvent { } impl UnusedEvent { pub fn publish(&self, env: &soroban_sdk::Env) { - ::spec_shaking_marker(); + { + static MARKER: [u8; 14usize] = *b"SpEcV1\x10\xe8\xf6\xcc\xea\xc3Sb"; + let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; + } <_ as soroban_sdk::Event>::publish(self, env); } } @@ -6869,7 +8525,11 @@ impl UnusedPubError { *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x0eUnusedPubError\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04Nope\0\0\0\x01" } } -impl soroban_sdk::SpecShakingMarker for UnusedPubError { +impl soroban_sdk::spec_shaking::SpecTypeId for UnusedPubError { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xe7\xf0{7\xdd\x90z=3\xe0\xb9\\\xdfc\x03\xe6lF_A\x90L( + 2, + *b"\xe7\xf0{7\xdd\x90z=3\xe0\xb9\\\xdfc\x03\xe6lF_A\x90L for UnusedPubError { type Error = soroban_sdk::Error; #[inline(always)] @@ -7032,17 +8700,19 @@ impl UnusedNonContractFnParam { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x18UnusedNonContractFnParam\0\0\0\x01\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UnusedNonContractFnParam { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\x81\xbc\xdb\xb4\xc1\xcb\xbd\xc5"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UnusedNonContractFnParam { + const SPEC_TYPE_ID: [u8; 32] = *b"\x81\xbc\xdb\xb4\xc1\xcb\xbd\xc5\x8a\x8d\xbc\xf2\x19kdi@]\xbe\xc3\xbf\x97lX\x84d=\x90\x1b\xc8\xc5\x86"; } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UNUSEDNONCONTRACTFNPARAM: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\x81\xbc\xdb\xb4\xc1\xcb\xbd\xc5\x8a\x8d\xbc\xf2\x19kdi@]\xbe\xc3\xbf\x97lX\x84d=\x90\x1b\xc8\xc5\x86", + [], +); impl soroban_sdk::TryFromVal for UnusedNonContractFnParam { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -7139,17 +8809,19 @@ impl UnusedNonContractFnReturn { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x19UnusedNonContractFnReturn\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UnusedNonContractFnReturn { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\x7fe\x1c\n\x87g\x1d\xc0"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UnusedNonContractFnReturn { + const SPEC_TYPE_ID: [u8; 32] = *b"\x7fe\x1c\n\x87g\x1d\xc0\x06x\xb0\xae8\x04\x1eO(Q\xf0\xe5\xb2\xef.\xd8\x95\xe1;*\xa4\x96\xf49"; } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UNUSEDNONCONTRACTFNRETURN: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\x7fe\x1c\n\x87g\x1d\xc0\x06x\xb0\xae8\x04\x1eO(Q\xf0\xe5\xb2\xef.\xd8\x95\xe1;*\xa4\x96\xf49", + [], +); impl soroban_sdk::TryFromVal for UnusedNonContractFnReturn { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -7240,17 +8912,18 @@ impl UnusedNonPubStruct { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x12UnusedNonPubStruct\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01x\0\0\0\0\0\0\x04" } } -impl soroban_sdk::SpecShakingMarker for UnusedNonPubStruct { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xa8;,%}]PA"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UnusedNonPubStruct { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xa8;,%}]PA\xe4\xae\xa7|l\"\xef\xeb\xc8\xe6\x08\n\xea\xf8x\xaa\x95\xb2\xa4\xaat\xdfB6"; } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UNUSEDNONPUBSTRUCT: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 2, + *b"\xa8;,%}]PA\xe4\xae\xa7|l\"\xef\xeb\xc8\xe6\x08\n\xea\xf8x\xaa\x95\xb2\xa4\xaat\xdfB6", + [], + ); impl soroban_sdk::TryFromVal for UnusedNonPubStruct { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -7339,7 +9012,10 @@ impl UnusedNonPubError { *b"\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x11UnusedNonPubError\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03Bad\0\0\0\0\x01" } } -impl soroban_sdk::SpecShakingMarker for UnusedNonPubError { +impl soroban_sdk::spec_shaking::SpecTypeId for UnusedNonPubError { + const SPEC_TYPE_ID: [u8; 32] = *b"\xd9_\x99\"=\xc6FM\xa7U\x9d\xc5\x8b\x9b\xee\x99!\x86}\x99|P\x15\x8e\x16\x0e&\xe5p\xa3]\xe4"; +} +impl soroban_sdk::spec_shaking::SpecShakingMarker for UnusedNonPubError { #[doc(hidden)] #[inline(always)] fn spec_shaking_marker() { @@ -7349,6 +9025,16 @@ impl soroban_sdk::SpecShakingMarker for UnusedNonPubError { } } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UNUSEDNONPUBERROR: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\xd9_\x99\"=\xc6FM\xa7U\x9d\xc5\x8b\x9b\xee\x99!\x86}\x99|P\x15\x8e\x16\x0e&\xe5p\xa3]\xe4", + [], +); impl TryFrom for UnusedNonPubError { type Error = soroban_sdk::Error; #[inline(always)] @@ -7454,7 +9140,9 @@ impl soroban_sdk::TryFromVal for soroban_s } #[allow(private_interfaces)] impl Contract { + pub fn __constructor(_env: Env, _meta: UsedConstructorMeta) {} pub fn with_param(_env: Env, _s: UsedParamStruct, _ie: UsedParamIntEnum) {} + pub fn with_context(_env: Env, _context: Context) {} pub fn with_return(_env: Env) -> UsedReturnEnum { UsedReturnEnum::A(1) } @@ -7468,6 +9156,13 @@ impl Contract { }; } } + pub fn with_panic_error_ref(env: Env, fail: bool) { + if fail { + { + (&env).panic_with_error(&UsedPanicErrorEnumRef::Boom); + }; + } + } pub fn with_assert_error(env: Env, ok: bool) { { if !(ok) { @@ -7485,11 +9180,13 @@ impl Contract { } } pub fn with_vec(_env: Env, _v: Vec) {} + pub fn with_vec_nested(_env: Env, _v: Vec) {} pub fn with_map(_env: Env, _m: Map) {} pub fn with_option(_env: Env, _o: Option) {} pub fn with_result(_env: Env) -> Result { Ok(UsedResultOk { data: 1 }) } + pub fn with_recursion(_env: Env, _r: UsedRecursiveRoot) {} pub fn publish_simple(env: Env) { UsedEventSimple { kind: Symbol::new(&env, "transfer"), @@ -7553,6 +9250,32 @@ impl Contract { } #[doc(hidden)] #[allow(non_snake_case)] +pub mod __Contract____constructor__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_FN___CONSTRUCTOR: [u8; 76usize] = + super::Contract::spec_xdr___constructor(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr___constructor() -> [u8; 76usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\r__constructor\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04meta\0\0\x07\xd0\0\0\0\x13UsedConstructorMeta\0\0\0\0\0" + } +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT___CONSTRUCTOR: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"\xc2\x7f\t\x92\x8d\xa6\xe9Pv\xc6\xab\xcf\x07Q\x98\x10\xd5\xd8|\x85\xe7\x12\xf6\x8aR\xa0]\xff\x1e~\xccV", + [::SPEC_TYPE_ID], +); +#[doc(hidden)] +#[allow(non_snake_case)] pub mod __Contract__with_param__spec { #[doc(hidden)] #[allow(non_snake_case)] @@ -7566,6 +9289,44 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\nwith_param\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01s\0\0\0\0\0\x07\xd0\0\0\0\x0fUsedParamStruct\0\0\0\0\0\0\0\0\x02ie\0\0\0\0\x07\xd0\0\0\0\x10UsedParamIntEnum\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_PARAM: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"9AZ\x8d\xc6\x89R\xa2A\xb7\xff\xf2d\xef\xb2b\xd6\x93\x96\x8a\xf6\xf3\xf3\xe2\x8f\xcc\x88T\x13\x10a\xdb", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__with_context__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_FN_WITH_CONTEXT: [u8; 64usize] = super::Contract::spec_xdr_with_context(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_context() -> [u8; 64usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0cwith_context\0\0\0\x01\0\0\0\0\0\0\0\x07context\0\0\0\x07\xd0\0\0\0\x07Context\0\0\0\0\0" + } +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_CONTEXT: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"b\xc2\xbdU\xd1\x05\x81o\xa4\x12\xb3\"\xe5\xb0H\x19\x8a\x02M\xe6\xe2\xb4\xc6\x9e\x98\xb7{\xcd\x1f\\\xb0\x15", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_return__spec { @@ -7581,6 +9342,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0bwith_return\0\0\0\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x0eUsedReturnEnum\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_RETURN: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"K\xaa\xb0_Y\\]\xc1\x06\xa8\xd9\xbf\x0f%\xfd\xa2\x13\xee\x84\xe4\xff<6\xf4\x03\"2\x9d\xfb\xb9\xfe\xf2", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_error__spec { @@ -7596,6 +9367,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\nwith_error\0\0\0\0\0\0\0\0\0\x01\0\0\x03\xe9\0\0\0\x04\0\0\x07\xd0\0\0\0\rUsedErrorEnum\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_ERROR: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b",\xccnmf\x98\xf0\x1f\xb7\x1e\xc6\x9b\xb8\x1d`\xdeVb\xcc\xd9\xd5;\xc9\x17E:\x18\x96i?\xees", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_panic_error__spec { @@ -7612,6 +9393,42 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x10with_panic_error\0\0\0\x01\0\0\0\0\0\0\0\x04fail\0\0\0\x01\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_PANIC_ERROR: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xc6\xf0\xfd2g\x89\x8d\x16\x10\xe1P\x83<\xf6(\x19\xc4\x81\x8120\xe7\x14\xa6\xa7\x90\xd9\xe4\xd3\x9d\xaa\x0e", + [], +); +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__with_panic_error_ref__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_FN_WITH_PANIC_ERROR_REF: [u8; 56usize] = + super::Contract::spec_xdr_with_panic_error_ref(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_panic_error_ref() -> [u8; 56usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x14with_panic_error_ref\0\0\0\x01\0\0\0\0\0\0\0\x04fail\0\0\0\x01\0\0\0\0" + } +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_PANIC_ERROR_REF: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xcdB\x02\xf7\xfd\x86\xae<*\x7fR\xee9\x815\"K\xa8\x1c\x18<\x812\xfc\xf0s\xd3U\xd9\xbdD\x16", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_assert_error__spec { @@ -7628,6 +9445,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x11with_assert_error\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x02ok\0\0\0\0\0\x01\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_ASSERT_ERROR: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xee\xec\xcb\x84V\xda\x92P\"t'\xe64\xde\x853\xcb\xd44Z\x04\x1c\x13\xca\xcd\xf9\xb3\xab^\xdb\x91\xb4", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_panic_raw_error__spec { @@ -7644,6 +9471,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x14with_panic_raw_error\0\0\0\x01\0\0\0\0\0\0\0\x04fail\0\0\0\x01\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_PANIC_RAW_ERROR: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xa8\x16\x96\x10I\xdc\x18\xfb-\xcc.P\xe4\x8a\x8f\x88\x04&\x8a\xc61@\x9af,\xb9c5R\0,\"", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_vec__spec { @@ -7659,6 +9494,42 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08with_vec\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x0eUsedVecElement\0\0\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_VEC: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"\xac\xab\xce\x9a\xb4\x11\xfd\xff\x88\xc6x\xbf\x90\xbc\x9c\xf4.Fy::SPEC_TYPE_ID], +); +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__with_vec_nested__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_FN_WITH_VEC_NESTED: [u8; 80usize] = + super::Contract::spec_xdr_with_vec_nested(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_vec_nested() -> [u8; 80usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0fwith_vec_nested\0\0\0\0\x01\0\0\0\0\0\0\0\x01v\0\0\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x14UsedVecElementNested\0\0\0\0" + } +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_VEC_NESTED: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"=\xc9^7\x8a\xd6\xc3\x91\x81\xea\x1aw\xf0&\x84\xc5=w\xbe\xce\xa3Q\xaa)\xa3\xe1z\x05\xc3\x90\xe9\xfe", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_map__spec { @@ -7674,6 +9545,19 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x08with_map\0\0\0\x01\0\0\0\0\0\0\0\x01m\0\0\0\0\0\x03\xec\0\0\x07\xd0\0\0\0\nUsedMapKey\0\0\0\0\x07\xd0\0\0\0\nUsedMapVal\0\0\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_MAP: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"\x1c:c\xadb\x1c6\x05Z<\x1c\x1e~,\xa4?\xd5\xce:\x1d4g\xc1\x1e\xdc\x1f\xf3\x87\xa5\xe2\x97\xa1", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_option__spec { @@ -7689,6 +9573,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0bwith_option\0\0\0\0\x01\0\0\0\0\0\0\0\x01o\0\0\0\0\0\x03\xe8\0\0\x07\xd0\0\0\0\x11UsedOptionElement\0\0\0\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_OPTION: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"\x98;\xeb\x9f\x1c\xdf\xf3\xd2\x90E\x08\xce)e\x16\xdazb\xaeB}\xa9\x8d\xdd6P\xa9g\xc5\xea\xb7m", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_result__spec { @@ -7704,6 +9598,43 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0bwith_result\0\0\0\0\0\0\0\0\x01\0\0\x03\xe9\0\0\x07\xd0\0\0\0\x0cUsedResultOk\0\0\x07\xd0\0\0\0\rUsedErrorEnum\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_RESULT: [u8; 106usize] = + soroban_sdk::spec_shaking::encode_graph_record::<106usize, 2usize>( + 0, + *b"6::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__with_recursion__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_FN_WITH_RECURSION: [u8; 76usize] = + super::Contract::spec_xdr_with_recursion(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_with_recursion() -> [u8; 76usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0ewith_recursion\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01r\0\0\0\0\0\x07\xd0\0\0\0\x11UsedRecursiveRoot\0\0\0\0\0\0\0" + } +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_RECURSION: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"\x95\x02\"L\x8a\x81*\x08\x17c\xae#g\t\xb6\x02\rt\x03\x9e\xe5D\xf2\xfd\xd5\x94\x04\xa4\x0cG\x88\xbd", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__publish_simple__spec { @@ -7720,6 +9651,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0epublish_simple\0\0\0\0\0\0\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_PUBLISH_SIMPLE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"U\x86\x1b\x93v\xa5\x8c\x81\x9c\xf5\xb4\xf4\xd7\xd5\x8c?\xe4\xb4?;{\x9a\xe957p\xfd-\x8e\x91\xfb\xb9", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__publish_topic_type__spec { @@ -7736,6 +9677,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x12publish_topic_type\0\0\0\0\0\0\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_PUBLISH_TOPIC_TYPE: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xee\x97\xa6+\xa5\xb6\xc5 b\xed\x18RU\x89z',\x9ffq\xc0c\xbfZ\xcar\x14^oz\xf6_", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__publish_data_type__spec { @@ -7752,6 +9701,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x11publish_data_type\0\0\0\0\0\0\0\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_PUBLISH_DATA_TYPE: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\xb5z-\x08C&*\xbe\x83:\x87\"\xe9$|\xd8\xfa\xfeB\xea\xf0.\xb6W\xf0\x86][o\xcb\x8c\xe5", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__publish_nested_topic__spec { @@ -7768,6 +9725,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x14publish_nested_topic\0\0\0\0\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_PUBLISH_NESTED_TOPIC: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xa3\x15\xec\xffg\x02E\xabPG\xb9\x01Q\xf0\0\xe0 \xebF\xa3\xce\xe4\x9a\xda\xbfC\xbe[\x16|\x0cy", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__publish_nested_data__spec { @@ -7784,6 +9751,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x13publish_nested_data\0\0\0\0\0\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_PUBLISH_NESTED_DATA: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\x85\x91`+\xaez\xee\x08\x9a\\\x18\xab1\xab\x13\xf6\xc6%\xfbj\xf2\xff/\x98E\xe6\xc9\xa7L\x83\x86\xbb", + [], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_lib_struct__spec { @@ -7800,6 +9777,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0fwith_lib_struct\0\0\0\0\x01\0\0\0\0\0\0\0\x01s\0\0\0\0\0\x07\xd0\0\0\0\x07StructC\0\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_LIB_STRUCT: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"?\xbe1a\xd0/\xc8\xee\xc8\xfc\xf1\xfe\x0e\xb6\x81`\x91\xeao\x10\xc5\xc4\xa0L^\xdd\xf4j\x01F,Z", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_wasm_imported__spec { @@ -7816,6 +9803,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x12with_wasm_imported\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01s\0\0\0\0\0\x07\xd0\0\0\0\x07StructA\0\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_WASM_IMPORTED: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"\xa3\x98\xd5x\xf0O\"\x89\xdc>\xfe\xc4\xd4\xdf\xc1\x8aN\x19v\xed\xaa\t\x85p\xc5\xa5[\xef\xb0\xd6>\xae", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_non_pub__spec { @@ -7831,6 +9828,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x0cwith_non_pub\0\0\0\x01\0\0\0\0\0\0\0\x01s\0\0\0\0\0\x07\xd0\0\0\0\x10UsedNonPubStruct\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_NON_PUB: [u8; 74usize] = + soroban_sdk::spec_shaking::encode_graph_record::<74usize, 1usize>( + 0, + *b"\x13\xb2]FU\xec\xf3\xbb%\x0c6Veq\xda\x82q\x96\xd1F\x96\xaday`\xfe\xef\\3\x1aB\n", + [::SPEC_TYPE_ID], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_non_pub_error__spec { @@ -7847,6 +9852,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x12with_non_pub_error\0\0\0\0\0\0\0\0\0\x01\0\0\x03\xe9\0\0\0\x04\0\0\x07\xd0\0\0\0\x0fUsedNonPubError\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_NON_PUB_ERROR: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"D\xbeG?\x1c\x8c\xb2\x96\xbcS\xed\xb1`\xb3\x1a\xb6>\xe397\xc1\x9e\x19\x18#\x81\xd1\xcb\x85O\xb6\xea", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_tuple__spec { @@ -7862,6 +9877,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\nwith_tuple\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01t\0\0\0\0\0\x03\xed\0\0\0\x02\0\0\x07\xd0\0\0\0\x10UsedTupleElement\0\0\0\x04\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_TUPLE: [u8; 74usize] = + soroban_sdk::spec_shaking::encode_graph_record::<74usize, 1usize>( + 0, + *b"\x921\x17mb\xdb@#\x02]\xc0o\x95\xa30x\x9e\x8e\x0e5\r\xc0\xc2\xe7-G\x90\x19\x1cf\xc8=", + [::SPEC_TYPE_ID], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__with_tuple_return__spec { @@ -7878,6 +9901,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x11with_tuple_return\0\0\0\0\0\0\0\0\0\0\x01\0\0\x03\xed\0\0\0\x02\0\0\x07\xd0\0\0\0\x16UsedTupleReturnElement\0\0\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_WITH_TUPLE_RETURN: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"\xe3\x01\xf3\xbf\xd9\x995\x9a\xba\x90\rF\xc6\xb3^\x86\x12L\xffR\xf0\xbd\x0b\xc0N\xc0\xe1f\x13\x88w\x84", + [::SPEC_TYPE_ID], +); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__publish_ref_event__spec { @@ -7894,6 +9927,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x11publish_ref_event\0\0\0\0\0\0\0\0\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_PUBLISH_REF_EVENT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xb6\x92\x87\x14\xa1\xab\x9b\xe8\x85\xa5\x8c\xe6\xf5\x150\x82\x81\x1c\x9d\x9a\xef\x16C\x04{=\x7f<\xfd\r\xf1a", + [], +); impl<'a> ContractClient<'a> { pub fn with_param(&self, _s: &UsedParamStruct, _ie: &UsedParamIntEnum) -> () { use core::ops::Not; @@ -7910,8 +9953,36 @@ impl<'a> ContractClient<'a> { } pub fn try_with_param( &self, - _s: &UsedParamStruct, - _ie: &UsedParamIntEnum, + _s: &UsedParamStruct, + _ie: &UsedParamIntEnum, + ) -> Result< + Result<(), <() as soroban_sdk::TryFromVal>::Error>, + Result, + > { + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_param") }, + ::soroban_sdk::Vec::from_array( + &self.env, + [_s.into_val(&self.env), _ie.into_val(&self.env)], + ), + ); + res + } + pub fn with_context(&self, _context: &Context) -> () { + use core::ops::Not; + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_context") }, + ::soroban_sdk::Vec::from_array(&self.env, [_context.into_val(&self.env)]), + ); + res + } + pub fn try_with_context( + &self, + _context: &Context, ) -> Result< Result<(), <() as soroban_sdk::TryFromVal>::Error>, Result, @@ -7919,11 +9990,8 @@ impl<'a> ContractClient<'a> { use soroban_sdk::{FromVal, IntoVal}; let res = self.env.try_invoke_contract( &self.address, - &{ soroban_sdk::Symbol::new(&self.env, "with_param") }, - ::soroban_sdk::Vec::from_array( - &self.env, - [_s.into_val(&self.env), _ie.into_val(&self.env)], - ), + &{ soroban_sdk::Symbol::new(&self.env, "with_context") }, + ::soroban_sdk::Vec::from_array(&self.env, [_context.into_val(&self.env)]), ); res } @@ -8003,6 +10071,31 @@ impl<'a> ContractClient<'a> { ); res } + pub fn with_panic_error_ref(&self, fail: &bool) -> () { + use core::ops::Not; + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_panic_error_ref") }, + ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), + ); + res + } + pub fn try_with_panic_error_ref( + &self, + fail: &bool, + ) -> Result< + Result<(), <() as soroban_sdk::TryFromVal>::Error>, + Result, + > { + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_panic_error_ref") }, + ::soroban_sdk::Vec::from_array(&self.env, [fail.into_val(&self.env)]), + ); + res + } pub fn with_assert_error(&self, ok: &bool) -> () { use core::ops::Not; use soroban_sdk::{FromVal, IntoVal}; @@ -8086,6 +10179,31 @@ impl<'a> ContractClient<'a> { ); res } + pub fn with_vec_nested(&self, _v: &Vec) -> () { + use core::ops::Not; + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_vec_nested") }, + ::soroban_sdk::Vec::from_array(&self.env, [_v.into_val(&self.env)]), + ); + res + } + pub fn try_with_vec_nested( + &self, + _v: &Vec, + ) -> Result< + Result<(), <() as soroban_sdk::TryFromVal>::Error>, + Result, + > { + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_vec_nested") }, + ::soroban_sdk::Vec::from_array(&self.env, [_v.into_val(&self.env)]), + ); + res + } pub fn with_map(&self, _m: &Map) -> () { use core::ops::Not; use soroban_sdk::{FromVal, IntoVal}; @@ -8171,6 +10289,31 @@ impl<'a> ContractClient<'a> { ); res } + pub fn with_recursion(&self, _r: &UsedRecursiveRoot) -> () { + use core::ops::Not; + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_recursion") }, + ::soroban_sdk::Vec::from_array(&self.env, [_r.into_val(&self.env)]), + ); + res + } + pub fn try_with_recursion( + &self, + _r: &UsedRecursiveRoot, + ) -> Result< + Result<(), <() as soroban_sdk::TryFromVal>::Error>, + Result, + > { + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "with_recursion") }, + ::soroban_sdk::Vec::from_array(&self.env, [_r.into_val(&self.env)]), + ); + res + } pub fn publish_simple(&self) -> () { use core::ops::Not; use soroban_sdk::{FromVal, IntoVal}; @@ -8471,6 +10614,11 @@ impl<'a> ContractClient<'a> { } } impl ContractArgs { + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn __constructor<'i>(_meta: &'i UsedConstructorMeta) -> (&'i UsedConstructorMeta,) { + (_meta,) + } #[inline(always)] #[allow(clippy::unused_unit)] pub fn with_param<'i>( @@ -8481,6 +10629,11 @@ impl ContractArgs { } #[inline(always)] #[allow(clippy::unused_unit)] + pub fn with_context<'i>(_context: &'i Context) -> (&'i Context,) { + (_context,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] pub fn with_return<'i>() -> () { () } @@ -8496,6 +10649,11 @@ impl ContractArgs { } #[inline(always)] #[allow(clippy::unused_unit)] + pub fn with_panic_error_ref<'i>(fail: &'i bool) -> (&'i bool,) { + (fail,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] pub fn with_assert_error<'i>(ok: &'i bool) -> (&'i bool,) { (ok,) } @@ -8511,6 +10669,13 @@ impl ContractArgs { } #[inline(always)] #[allow(clippy::unused_unit)] + pub fn with_vec_nested<'i>( + _v: &'i Vec, + ) -> (&'i Vec,) { + (_v,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] pub fn with_map<'i>(_m: &'i Map) -> (&'i Map,) { (_m,) } @@ -8526,6 +10691,11 @@ impl ContractArgs { } #[inline(always)] #[allow(clippy::unused_unit)] + pub fn with_recursion<'i>(_r: &'i UsedRecursiveRoot) -> (&'i UsedRecursiveRoot,) { + (_r,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] pub fn publish_simple<'i>() -> () { () } @@ -8587,6 +10757,37 @@ impl ContractArgs { } #[doc(hidden)] #[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__constructor` instead")] +#[allow(deprecated)] +pub fn __Contract____constructor__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::__constructor( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__constructor` instead")] +#[export_name = "__constructor"] +pub extern "C" fn __Contract____constructor__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract____constructor__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] #[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_param` instead")] #[allow(deprecated)] pub fn __Contract__with_param__invoke_raw( @@ -8626,6 +10827,37 @@ pub extern "C" fn __Contract__with_param__invoke_raw_extern( } #[doc(hidden)] #[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_context` instead")] +#[allow(deprecated)] +pub fn __Contract__with_context__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::with_context( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_context` instead")] +#[export_name = "with_context"] +pub extern "C" fn __Contract__with_context__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__with_context__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] #[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_return` instead")] #[allow(deprecated)] pub fn __Contract__with_return__invoke_raw(env: soroban_sdk::Env) -> soroban_sdk::Val { @@ -8693,6 +10925,37 @@ pub extern "C" fn __Contract__with_panic_error__invoke_raw_extern( } #[doc(hidden)] #[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_panic_error_ref` instead")] +#[allow(deprecated)] +pub fn __Contract__with_panic_error_ref__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::with_panic_error_ref( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_panic_error_ref` instead")] +#[export_name = "with_panic_error_ref"] +pub extern "C" fn __Contract__with_panic_error_ref__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__with_panic_error_ref__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] #[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_assert_error` instead")] #[allow(deprecated)] pub fn __Contract__with_assert_error__invoke_raw( @@ -8786,6 +11049,37 @@ pub extern "C" fn __Contract__with_vec__invoke_raw_extern( } #[doc(hidden)] #[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_vec_nested` instead")] +#[allow(deprecated)] +pub fn __Contract__with_vec_nested__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::with_vec_nested( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_vec_nested` instead")] +#[export_name = "with_vec_nested"] +pub extern "C" fn __Contract__with_vec_nested__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__with_vec_nested__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] #[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_map` instead")] #[allow(deprecated)] pub fn __Contract__with_map__invoke_raw( @@ -8866,6 +11160,37 @@ pub extern "C" fn __Contract__with_result__invoke_raw_extern() -> soroban_sdk::V } #[doc(hidden)] #[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_recursion` instead")] +#[allow(deprecated)] +pub fn __Contract__with_recursion__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::with_recursion( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).with_recursion` instead")] +#[export_name = "with_recursion"] +pub extern "C" fn __Contract__with_recursion__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__with_recursion__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] #[deprecated(note = "use `ContractClient::new(&env, &contract_id).publish_simple` instead")] #[allow(deprecated)] pub fn __Contract__publish_simple__invoke_raw(env: soroban_sdk::Env) -> soroban_sdk::Val { @@ -9132,6 +11457,109 @@ pub extern "C" fn __Contract__publish_ref_event__invoke_raw_extern() -> soroban_ #[allow(deprecated)] __Contract__publish_ref_event__invoke_raw(soroban_sdk::Env::default()) } +impl CustomAccountInterface for Contract { + type Error = UsedAuthErrorEnum; + type Signature = CustomSignature; + fn __check_auth( + _env: Env, + _signature_payload: Hash<32>, + _signatures: Self::Signature, + _auth_contexts: Vec, + ) -> Result<(), UsedAuthErrorEnum> { + Ok(()) + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract____check_auth__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_FN___CHECK_AUTH: [u8; 192usize] = + super::Contract::spec_xdr___check_auth(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr___check_auth() -> [u8; 192usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0c__check_auth\0\0\0\x03\0\0\0\0\0\0\0\x11signature_payload\0\0\0\0\0\x03\xee\0\0\0 \0\0\0\0\0\0\0\nsignatures\0\0\0\0\x07\xd0\0\0\0\x0fCustomSignature\0\0\0\0\0\0\0\0\rauth_contexts\0\0\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x07Context\0\0\0\0\x01\0\0\x03\xe9\0\0\0\x02\0\0\x07\xd0\0\0\0\x11UsedAuthErrorEnum\0\0\0" + } +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT___CHECK_AUTH: [u8; 138usize] = + soroban_sdk::spec_shaking::encode_graph_record::<138usize, 3usize>( + 0, + *b"d0\x1d$\nPH\x95\xf0\xbc\xe3\xae\xb2\xd6QK\xe9\x92\xc4\xf3$S\xb9\xff\xd9\xafR4JZ\x9c\x83", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); +impl<'a> ContractClient<'a> {} +impl ContractArgs { + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn __check_auth<'i>( + _signature_payload: &'i Hash<32>, + _signatures: &'i CustomSignature, + _auth_contexts: &'i Vec, + ) -> ( + &'i Hash<32>, + &'i CustomSignature, + &'i Vec, + ) { + (_signature_payload, _signatures, _auth_contexts) + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__check_auth` instead")] +#[allow(deprecated)] +pub fn __Contract____check_auth__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, + arg_2: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::__check_auth( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_1), + ), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_2), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).__check_auth` instead")] +#[export_name = "__check_auth"] +pub extern "C" fn __Contract____check_auth__invoke_raw_extern( + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, + arg_2: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract____check_auth__invoke_raw(soroban_sdk::Env::default(), arg_0, arg_1, arg_2) +} #[allow(dead_code)] fn non_contract_fn(_s: UnusedNonContractFnParam) -> UnusedNonContractFnReturn { UnusedNonContractFnReturn { x: 1 } diff --git a/tests-expanded/test_tuples_tests.rs b/tests-expanded/test_tuples_tests.rs index 2e77ef036..b169c46a3 100644 --- a/tests-expanded/test_tuples_tests.rs +++ b/tests-expanded/test_tuples_tests.rs @@ -159,6 +159,13 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x07void_fn\0\0\0\0\x01\0\0\0\0\0\0\0\x08void_arg\0\0\0\x02\0\0\0\x01\0\0\0\x02" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_VOID_FN: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\x94\x83*7S\xb5C\x1dJ\xfdD\x96\xff>j.#\x8b\xe3\xd8\xd8@\x07V\xf5\x931\xc6\xe7\xa1\xdcC", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__tuple1__spec { @@ -173,6 +180,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06tuple1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03arg\0\0\0\x03\xed\0\0\0\x01\0\0\0\x04\0\0\0\x01\0\0\x03\xed\0\0\0\x01\0\0\0\x04" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TUPLE1: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xb0\xef( + 0, + *b"w\x9e\xa1:\xedN\x8a)\xca\x95\xd4e\x99\xfd\x95\x94Ff0w+N\xef\x85\x87k\xe58Se\xa3l", + [], + ); impl<'a> ContractClient<'a> { pub fn void_fn(&self, _void_arg: &()) -> () { use core::ops::Not; @@ -640,7 +663,7 @@ mod test { use crate::{Contract, ContractClient}; use soroban_sdk::Env; mod wasm { - pub const WASM: &[u8] = b"\x00asm\x01\x00\x00\x00\x01\x1f\x05`\x01~\x01~`\x02~~\x01~`\x03~~~\x01~`\x03~\x7f\x7f\x00`\x02\x7f\x7f\x01~\x02\x19\x04\x01i\x012\x00\x00\x01i\x011\x00\x00\x01v\x01g\x00\x01\x01v\x01h\x00\x02\x03\x06\x05\x00\x03\x04\x00\x00\x05\x03\x01\x00\x10\x06!\x04\x7f\x01A\x80\x80\xc0\x00\x0b\x7f\x00A\x80\x80\xc0\x00\x0b\x7f\x00A\x80\x80\xc0\x00\x0b\x7f\x00A\x80\x80\xc0\x00\x0b\x07E\x07\x06memory\x02\x00\x06tuple1\x00\x04\x06tuple2\x00\x07\x07void_fn\x00\x08\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n\xc8\x03\x05x\x01\x01\x7f#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00\x02@\x02@ \x00B\xff\x01\x83B\xcb\x00R\r\x00 \x01B\x027\x03\x08 \x00 \x01A\x08jA\x01\x10\x85\x80\x80\x80\x00 \x01)\x03\x08\"\x00B\xff\x01\x83B\x04Q\r\x01\x0b\x00\x0b \x01 \x00B\x84\x80\x80\x80p\x837\x03\x08 \x01A\x08jA\x01\x10\x86\x80\x80\x80\x00!\x00 \x01A\x10j$\x80\x80\x80\x80\x00 \x00\x0b\x1d\x00 \x00 \x01\xadB \x86B\x04\x84 \x02\xadB \x86B\x04\x84\x10\x83\x80\x80\x80\x00\x1a\x0b\x1a\x00 \x00\xadB \x86B\x04\x84 \x01\xadB \x86B\x04\x84\x10\x82\x80\x80\x80\x00\x0b\xff\x01\x02\x02\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00\x02@\x02@\x02@ \x00B\xff\x01\x83B\xcb\x00R\r\x00A\x00!\x02\x02@\x03@ \x02A\x10F\r\x01 \x01 \x02jB\x027\x03\x00 \x02A\x08j!\x02\x0c\x00\x0b\x0b \x00 \x01A\x02\x10\x85\x80\x80\x80\x00 \x01)\x03\x00\"\x03B\xff\x01\x83B\x04R\r\x00 \x01)\x03\x08\"\x00\xa7A\xff\x01q\"\x02A\xc1\x00F\r\x01 \x02A\x07G\r\x00 \x00B\x08\x87!\x00\x0c\x02\x0b\x00\x0b \x00\x10\x80\x80\x80\x80\x00!\x00\x0b\x02@\x02@ \x00B\x80\x80\x80\x80\x80\x80\x80\xc0\x00|B\xff\xff\xff\xff\xff\xff\xff\xff\x00V\r\x00 \x00B\x08\x86B\x07\x84!\x00\x0c\x01\x0b \x00\x10\x81\x80\x80\x80\x00!\x00\x0b \x01 \x007\x03\x08 \x01 \x03B\x84\x80\x80\x80p\x837\x03\x00 \x01A\x02\x10\x86\x80\x80\x80\x00!\x00 \x01A\x10j$\x80\x80\x80\x80\x00 \x00\x0b\x13\x00\x02@ \x00B\xff\x01\x83B\x02Q\r\x00\x00\x0bB\x02\x0b\x0b\t\x01\x00A\x80\x80\xc0\x00\x0b\x00\x00\xcb\x01\x0econtractspecv0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06tuple1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03arg\x00\x00\x00\x03\xed\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x03\xed\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06tuple2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03arg\x00\x00\x00\x03\xed\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x03\xed\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07void_fn\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x08void_arg\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\x00\x1e\x11contractenvmetav0\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x00\x00O\x0econtractmetav0\x00\x00\x00\x00\x00\x00\x00\x05rsver\x00\x00\x00\x00\x00\x00\x061.91.0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12rssdk_spec_shaking\x00\x00\x00\x00\x00\x012\x00\x00\x00"; + pub const WASM: &[u8] = b"\x00asm\x01\x00\x00\x00\x01\x1f\x05`\x01~\x01~`\x02~~\x01~`\x03~~~\x01~`\x03~\x7f\x7f\x00`\x02\x7f\x7f\x01~\x02\x19\x04\x01i\x012\x00\x00\x01i\x011\x00\x00\x01v\x01g\x00\x01\x01v\x01h\x00\x02\x03\x06\x05\x00\x03\x04\x00\x00\x05\x03\x01\x00\x10\x06!\x04\x7f\x01A\x80\x80\xc0\x00\x0b\x7f\x00A\x80\x80\xc0\x00\x0b\x7f\x00A\x80\x80\xc0\x00\x0b\x7f\x00A\x80\x80\xc0\x00\x0b\x07E\x07\x06memory\x02\x00\x06tuple1\x00\x04\x06tuple2\x00\x07\x07void_fn\x00\x08\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n\xc8\x03\x05x\x01\x01\x7f#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00\x02@\x02@ \x00B\xff\x01\x83B\xcb\x00R\r\x00 \x01B\x027\x03\x08 \x00 \x01A\x08jA\x01\x10\x85\x80\x80\x80\x00 \x01)\x03\x08\"\x00B\xff\x01\x83B\x04Q\r\x01\x0b\x00\x0b \x01 \x00B\x84\x80\x80\x80p\x837\x03\x08 \x01A\x08jA\x01\x10\x86\x80\x80\x80\x00!\x00 \x01A\x10j$\x80\x80\x80\x80\x00 \x00\x0b\x1d\x00 \x00 \x01\xadB \x86B\x04\x84 \x02\xadB \x86B\x04\x84\x10\x83\x80\x80\x80\x00\x1a\x0b\x1a\x00 \x00\xadB \x86B\x04\x84 \x01\xadB \x86B\x04\x84\x10\x82\x80\x80\x80\x00\x0b\xff\x01\x02\x02\x7f\x01~#\x80\x80\x80\x80\x00A\x10k\"\x01$\x80\x80\x80\x80\x00\x02@\x02@\x02@ \x00B\xff\x01\x83B\xcb\x00R\r\x00A\x00!\x02\x02@\x03@ \x02A\x10F\r\x01 \x01 \x02jB\x027\x03\x00 \x02A\x08j!\x02\x0c\x00\x0b\x0b \x00 \x01A\x02\x10\x85\x80\x80\x80\x00 \x01)\x03\x00\"\x03B\xff\x01\x83B\x04R\r\x00 \x01)\x03\x08\"\x00\xa7A\xff\x01q\"\x02A\xc1\x00F\r\x01 \x02A\x07G\r\x00 \x00B\x08\x87!\x00\x0c\x02\x0b\x00\x0b \x00\x10\x80\x80\x80\x80\x00!\x00\x0b\x02@\x02@ \x00B\x80\x80\x80\x80\x80\x80\x80\xc0\x00|B\xff\xff\xff\xff\xff\xff\xff\xff\x00V\r\x00 \x00B\x08\x86B\x07\x84!\x00\x0c\x01\x0b \x00\x10\x81\x80\x80\x80\x00!\x00\x0b \x01 \x007\x03\x08 \x01 \x03B\x84\x80\x80\x80p\x837\x03\x00 \x01A\x02\x10\x86\x80\x80\x80\x00!\x00 \x01A\x10j$\x80\x80\x80\x80\x00 \x00\x0b\x13\x00\x02@ \x00B\xff\x01\x83B\x02Q\r\x00\x00\x0bB\x02\x0b\x0b\t\x01\x00A\x80\x80\xc0\x00\x0b\x00\x00\xdf\x16\x0econtractspecv0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06tuple1\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03arg\x00\x00\x00\x03\xed\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x03\xed\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06tuple2\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03arg\x00\x00\x00\x03\xed\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x03\xed\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07void_fn\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x08void_arg\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\xe3Context of a single authorized call performed by an address.\n\nCustom account contracts that implement `__check_auth` special function\nreceive a list of `Context` values corresponding to all the calls that\nneed to be authorized.\x00\x00\x00\x00\x00\x00\x00\x00\x07Context\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x14Contract invocation.\x00\x00\x00\x08Contract\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0fContractContext\x00\x00\x00\x00\x01\x00\x00\x00=Contract that has a constructor with no arguments is created.\x00\x00\x00\x00\x00\x00\x14CreateContractHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x1bCreateContractHostFnContext\x00\x00\x00\x00\x01\x00\x00\x00DContract that has a constructor with 1 or more arguments is created.\x00\x00\x00\x1cCreateContractWithCtorHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00*CreateContractWithConstructorHostFnContext\x00\x00\x00\x00\x00\x01\x00\x00\x00\xbdAuthorization context of a single contract call.\n\nThis struct corresponds to a `require_auth_for_args` call for an address\nfrom `contract` function with `fn_name` name and `args` arguments.\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fContractContext\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x04args\x00\x00\x03\xea\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08contract\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x07fn_name\x00\x00\x00\x00\x11\x00\x00\x00\x02\x00\x00\x00_Contract executable used for creating a new contract and used in\n`CreateContractHostFnContext`.\x00\x00\x00\x00\x00\x00\x00\x00\x12ContractExecutable\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Wasm\x00\x00\x00\x01\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x01\x00\x00\x008Value of contract node in InvokerContractAuthEntry tree.\x00\x00\x00\x00\x00\x00\x00\x15SubContractInvocation\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x07context\x00\x00\x00\x07\xd0\x00\x00\x00\x0fContractContext\x00\x00\x00\x00\x00\x00\x00\x00\x0fsub_invocations\x00\x00\x00\x03\xea\x00\x00\x07\xd0\x00\x00\x00\x18InvokerContractAuthEntry\x00\x00\x00\x02\x00\x00\x01/A node in the tree of authorizations performed on behalf of the current\ncontract as invoker of the contracts deeper in the call stack.\n\nThis is used as an argument of `authorize_as_current_contract` host function.\n\nThis tree corresponds `require_auth[_for_args]` calls on behalf of the\ncurrent contract.\x00\x00\x00\x00\x00\x00\x00\x00\x18InvokerContractAuthEntry\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x12Invoke a contract.\x00\x00\x00\x00\x00\x08Contract\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x15SubContractInvocation\x00\x00\x00\x00\x00\x00\x01\x00\x00\x005Create a contract passing 0 arguments to constructor.\x00\x00\x00\x00\x00\x00\x14CreateContractHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x1bCreateContractHostFnContext\x00\x00\x00\x00\x01\x00\x00\x00=Create a contract passing 0 or more arguments to constructor.\x00\x00\x00\x00\x00\x00\x1cCreateContractWithCtorHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00*CreateContractWithConstructorHostFnContext\x00\x00\x00\x00\x00\x01\x00\x00\x00vAuthorization context for `create_contract` host function that creates a\nnew contract on behalf of authorizer address.\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1bCreateContractHostFnContext\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\nexecutable\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12ContractExecutable\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04salt\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x01\x00\x00\x00\xd6Authorization context for `create_contract` host function that creates a\nnew contract on behalf of authorizer address.\nThis is the same as `CreateContractHostFnContext`, but also has\ncontract constructor arguments.\x00\x00\x00\x00\x00\x00\x00\x00\x00*CreateContractWithConstructorHostFnContext\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x10constructor_args\x00\x00\x03\xea\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nexecutable\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12ContractExecutable\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04salt\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nExecutable\x00\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Wasm\x00\x00\x00\x01\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStellarAsset\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07Account\x00\x00\xab\x06\x1ccontractspecv0.rssdk.graphv0SpGrV\x01\x00\x00\xb0\xefj.#\x8b\xe3\xd8\xd8@\x07V\xf5\x931\xc6\xe7\xa1\xdcC\x00\x00SpGrV\x01\x00\x02\xa3J\xcf\xf7D\x93\x0bB]\x95\xeb\xfe\x03y\x83e5\\\x16\xeb\x94Ne\xe6Xw\x1f&\xf7\xc0pT\x00\x03\xf1\xf9\x90\x07E*e\xfd\x08\x8c\xc2\xb1\x10\xfd\xca\xae6T\x9e)[\xdb\xee_\xfa\xed\xcaE\x9bv\x98\xec\x15\xe5\x1a,\xc0\xc7\xef\xd4\xe0\xda\x0e\x16\x87\x1a\xae\xe73X\x1d2\x8a\x8aP\xab\x81\xef\x18\x8e:\xa2\xa9ns\x94\x0c\x1926\x1d\x90\x19\xc8\x8b=\xbe\xaf\xd7n\xcd=z\t\xb27\xa5.\xde:>\x03\xcd7\x12\xafSpGrV\x01\x00\x02\xf1\xf9\x90\x07E*e\xfd\x08\x8c\xc2\xb1\x10\xfd\xca\xae6T\x9e)[\xdb\xee_\xfa\xed\xcaE\x9bv\x98\xec\x00\x00SpGrV\x01\x00\x02\xb6\xb1Hy\xda\xca\xaf\xcc\x1f\x01\x07y\x9a#g}2\x1c.Q0Vf\xc7ze\xacm\x01\xf5Y\xcc\x00\x00SpGrV\x01\x00\x02\x9e)H\x8e\xf0\x01{{\xce\x9fdO\x0eD\xc0,\x0f\xe8\xee\'\x845r\x9f\xeb`\xd0\x12H\x17\x96g\x00\x02\xf1\xf9\x90\x07E*e\xfd\x08\x8c\xc2\xb1\x10\xfd\xca\xae6T\x9e)[\xdb\xee_\xfa\xed\xcaE\x9bv\x98\xecULqD\xd3\xfa:\x1f\x0c\xa5\xb7\x04\xe5H\x8b\x91J\x9e\x0fe\x7f\x9f[\xdbG#\xc7o\xb0\xf4\xcf\xe6SpGrV\x01\x00\x02ULqD\xd3\xfa:\x1f\x0c\xa5\xb7\x04\xe5H\x8b\x91J\x9e\x0fe\x7f\x9f[\xdbG#\xc7o\xb0\xf4\xcf\xe6\x00\x03\x9e)H\x8e\xf0\x01{{\xce\x9fdO\x0eD\xc0,\x0f\xe8\xee\'\x845r\x9f\xeb`\xd0\x12H\x17\x96g\x15\xe5\x1a,\xc0\xc7\xef\xd4\xe0\xda\x0e\x16\x87\x1a\xae\xe73X\x1d2\x8a\x8aP\xab\x81\xef\x18\x8e:\xa2\xa9ns\x94\x0c\x1926\x1d\x90\x19\xc8\x8b=\xbe\xaf\xd7n\xcd=z\t\xb27\xa5.\xde:>\x03\xcd7\x12\xafSpGrV\x01\x00\x02\x15\xe5\x1a,\xc0\xc7\xef\xd4\xe0\xda\x0e\x16\x87\x1a\xae\xe73X\x1d2\x8a\x8aP\xab\x81\xef\x18\x8e:\xa2\xa9n\x00\x01\xb6\xb1Hy\xda\xca\xaf\xcc\x1f\x01\x07y\x9a#g}2\x1c.Q0Vf\xc7ze\xacm\x01\xf5Y\xccSpGrV\x01\x00\x02s\x94\x0c\x1926\x1d\x90\x19\xc8\x8b=\xbe\xaf\xd7n\xcd=z\t\xb27\xa5.\xde:>\x03\xcd7\x12\xaf\x00\x01\xb6\xb1Hy\xda\xca\xaf\xcc\x1f\x01\x07y\x9a#g}2\x1c.Q0Vf\xc7ze\xacm\x01\xf5Y\xccSpGrV\x01\x00\x02L|{\r\xf4\xf2\x1a\xa8\xf6\x981\xe2K\xcb\x824N\xe6\x97\xed\xdf\xc2\x1cck\xd6\xceW\x9cx\x10\x1e\x00\x00\x00\x1e\x11contractenvmetav0\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x00\x00O\x0econtractmetav0\x00\x00\x00\x00\x00\x00\x00\x05rsver\x00\x00\x00\x00\x00\x00\x061.91.0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12rssdk_spec_shaking\x00\x00\x00\x00\x00\x012\x00\x00\x00"; pub trait Contract { fn tuple1(env: soroban_sdk::Env, arg: (u32,)) -> (u32,); fn tuple2(env: soroban_sdk::Env, arg: (u32, i64)) -> (u32, i64); @@ -1021,6 +1044,4731 @@ mod test { (void_arg,) } } + pub struct ContractContext { + pub args: soroban_sdk::Vec, + pub contract: soroban_sdk::Address, + pub fn_name: soroban_sdk::Symbol, + } + #[automatically_derived] + impl ::core::fmt::Debug for ContractContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "ContractContext", + "args", + &self.args, + "contract", + &self.contract, + "fn_name", + &&self.fn_name, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ContractContext { + #[inline] + fn clone(&self) -> ContractContext { + ContractContext { + args: ::core::clone::Clone::clone(&self.args), + contract: ::core::clone::Clone::clone(&self.contract), + fn_name: ::core::clone::Clone::clone(&self.fn_name), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ContractContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ContractContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ContractContext { + #[inline] + fn eq(&self, other: &ContractContext) -> bool { + self.args == other.args + && self.contract == other.contract + && self.fn_name == other.fn_name + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ContractContext { + #[inline] + fn cmp(&self, other: &ContractContext) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.args, &other.args) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.contract, &other.contract) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.fn_name, &other.fn_name) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ContractContext { + #[inline] + fn partial_cmp( + &self, + other: &ContractContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.args, &other.args) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp(&self.contract, &other.contract) + { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.fn_name, &other.fn_name) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_CONTRACTCONTEXT: [u8; 96usize] = ContractContext::spec_xdr(); + impl ContractContext { + pub const fn spec_xdr() -> [u8; 96usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fContractContext\0\0\0\0\x03\0\0\0\0\0\0\0\x04args\0\0\x03\xea\0\0\0\0\0\0\0\0\0\0\0\x08contract\0\0\0\x13\0\0\0\0\0\0\0\x07fn_name\0\0\0\0\x11" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for ContractContext { + const SPEC_TYPE_ID: [u8; 32] = *b"\x03\x04uN\xea\xd7[\x13V\x9f\xd4\xbd\xc1\x8a\xd6\x7f\xd8iD\xa5B\x89qT\x0b'\xad(\xb8\x9f\x8f\x19"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CONTRACTCONTEXT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\x03\x04uN\xea\xd7[\x13V\x9f\xd4\xbd\xc1\x8a\xd6\x7f\xd8iD\xa5B\x89qT\x0b'\xad(\xb8\x9f\x8f\x19", + [], + ); + impl soroban_sdk::TryFromVal for ContractContext { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["args", "contract", "fn_name"]; + let mut vals: [Val; 3usize] = [Val::VOID.to_val(); 3usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + args: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + contract: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + fn_name: vals[2] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &ContractContext, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["args", "contract", "fn_name"]; + let vals: [Val; 3usize] = [ + (&val.args).try_into_val(env).map_err(|_| ConversionError)?, + (&val.contract) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.fn_name) + .try_into_val(env) + .map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&ContractContext, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + impl soroban_sdk::TryFromVal for ContractContext { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 3usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + args: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "args" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + contract: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "contract" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + fn_name: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "fn_name" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal for ContractContext { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&ContractContext> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &ContractContext) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "args" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.args) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "contract" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.contract) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "fn_name" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.fn_name) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } + } + impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: ContractContext) -> Result { + (&val).try_into() + } + } + impl TryFrom<&ContractContext> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &ContractContext) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: ContractContext) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryContractContext { + args: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + contract: ::Prototype, + fn_name: ::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryContractContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "ArbitraryContractContext", + "args", + &self.args, + "contract", + &self.contract, + "fn_name", + &&self.fn_name, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryContractContext { + #[inline] + fn clone(&self) -> ArbitraryContractContext { + ArbitraryContractContext { + args: ::core::clone::Clone::clone(&self.args), + contract: ::core::clone::Clone::clone(&self.contract), + fn_name: ::core::clone::Clone::clone(&self.fn_name), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryContractContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryContractContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryContractContext { + #[inline] + fn eq(&self, other: &ArbitraryContractContext) -> bool { + self.args == other.args + && self.contract == other.contract + && self.fn_name == other.fn_name + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryContractContext { + #[inline] + fn cmp(&self, other: &ArbitraryContractContext) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.args, &other.args) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.contract, &other.contract) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.fn_name, &other.fn_name) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryContractContext { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryContractContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.args, &other.args) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp( + &self.contract, + &other.contract, + ) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp( + &self.fn_name, + &other.fn_name, + ) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryContractContext: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryContractContext { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryContractContext { + args: arbitrary::Arbitrary::arbitrary(u)?, + contract: arbitrary::Arbitrary::arbitrary(u)?, + fn_name: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryContractContext { + args: arbitrary::Arbitrary::arbitrary(&mut u)?, + contract: arbitrary::Arbitrary::arbitrary(&mut u)?, + fn_name: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for ContractContext { + type Prototype = ArbitraryContractContext; + } + impl soroban_sdk::TryFromVal for ContractContext { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryContractContext, + ) -> std::result::Result { + Ok(ContractContext { + args: soroban_sdk::IntoVal::into_val(&v.args, env), + contract: soroban_sdk::IntoVal::into_val(&v.contract, env), + fn_name: soroban_sdk::IntoVal::into_val(&v.fn_name, env), + }) + } + } + }; + pub struct SubContractInvocation { + pub context: ContractContext, + pub sub_invocations: soroban_sdk::Vec, + } + #[automatically_derived] + impl ::core::fmt::Debug for SubContractInvocation { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "SubContractInvocation", + "context", + &self.context, + "sub_invocations", + &&self.sub_invocations, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for SubContractInvocation { + #[inline] + fn clone(&self) -> SubContractInvocation { + SubContractInvocation { + context: ::core::clone::Clone::clone(&self.context), + sub_invocations: ::core::clone::Clone::clone(&self.sub_invocations), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for SubContractInvocation { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for SubContractInvocation {} + #[automatically_derived] + impl ::core::cmp::PartialEq for SubContractInvocation { + #[inline] + fn eq(&self, other: &SubContractInvocation) -> bool { + self.context == other.context && self.sub_invocations == other.sub_invocations + } + } + #[automatically_derived] + impl ::core::cmp::Ord for SubContractInvocation { + #[inline] + fn cmp(&self, other: &SubContractInvocation) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.context, &other.context) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.sub_invocations, &other.sub_invocations) + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for SubContractInvocation { + #[inline] + fn partial_cmp( + &self, + other: &SubContractInvocation, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.context, &other.context) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp( + &self.sub_invocations, + &other.sub_invocations, + ) + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_SUBCONTRACTINVOCATION: [u8; 144usize] = + SubContractInvocation::spec_xdr(); + impl SubContractInvocation { + pub const fn spec_xdr() -> [u8; 144usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x15SubContractInvocation\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x07context\0\0\0\x07\xd0\0\0\0\x0fContractContext\0\0\0\0\0\0\0\0\x0fsub_invocations\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x18InvokerContractAuthEntry" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for SubContractInvocation { + const SPEC_TYPE_ID: [u8; 32] = *b" \x9d\xc5_\xba\x8fv\x18\x95\x02\xbdJ}\x97\x01KN\xd6\0\xf8\xb6\xefq\xa8j\x11\\\xc7\xd7\xd4\xcf\xf0"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_SUBCONTRACTINVOCATION: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, + >( + 2, + *b" \x9d\xc5_\xba\x8fv\x18\x95\x02\xbdJ}\x97\x01KN\xd6\0\xf8\xb6\xefq\xa8j\x11\\\xc7\xd7\xd4\xcf\xf0", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); + impl soroban_sdk::TryFromVal for SubContractInvocation { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["context", "sub_invocations"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + context: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + sub_invocations: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &SubContractInvocation, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["context", "sub_invocations"]; + let vals: [Val; 2usize] = [ + (&val.context) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.sub_invocations) + .try_into_val(env) + .map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&SubContractInvocation, + ) -> Result { + <_ as soroban_sdk::TryFromVal< + soroban_sdk::Env, + SubContractInvocation, + >>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal for SubContractInvocation { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 2usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + context: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "context" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + sub_invocations: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "sub_invocations" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal for SubContractInvocation { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&SubContractInvocation> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &SubContractInvocation) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "context" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.context) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "sub_invocations" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.sub_invocations) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } + } + impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: SubContractInvocation) -> Result { + (&val).try_into() + } + } + impl TryFrom<&SubContractInvocation> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &SubContractInvocation) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: SubContractInvocation) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitrarySubContractInvocation { + context: ::Prototype, + sub_invocations: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitrarySubContractInvocation { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "ArbitrarySubContractInvocation", + "context", + &self.context, + "sub_invocations", + &&self.sub_invocations, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitrarySubContractInvocation { + #[inline] + fn clone(&self) -> ArbitrarySubContractInvocation { + ArbitrarySubContractInvocation { + context: ::core::clone::Clone::clone(&self.context), + sub_invocations: ::core::clone::Clone::clone(&self.sub_invocations), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitrarySubContractInvocation { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitrarySubContractInvocation {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitrarySubContractInvocation { + #[inline] + fn eq(&self, other: &ArbitrarySubContractInvocation) -> bool { + self.context == other.context && self.sub_invocations == other.sub_invocations + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitrarySubContractInvocation { + #[inline] + fn cmp(&self, other: &ArbitrarySubContractInvocation) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.context, &other.context) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.sub_invocations, &other.sub_invocations) + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitrarySubContractInvocation { + #[inline] + fn partial_cmp( + &self, + other: &ArbitrarySubContractInvocation, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.context, &other.context) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp( + &self.sub_invocations, + &other.sub_invocations, + ) + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitrarySubContractInvocation: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitrarySubContractInvocation { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitrarySubContractInvocation.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitrarySubContractInvocation { + context: arbitrary::Arbitrary::arbitrary(u)?, + sub_invocations: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitrarySubContractInvocation.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitrarySubContractInvocation.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitrarySubContractInvocation { + context: arbitrary::Arbitrary::arbitrary(&mut u)?, + sub_invocations: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitrarySubContractInvocation.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for SubContractInvocation { + type Prototype = ArbitrarySubContractInvocation; + } + impl soroban_sdk::TryFromVal + for SubContractInvocation + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitrarySubContractInvocation, + ) -> std::result::Result { + Ok(SubContractInvocation { + context: soroban_sdk::IntoVal::into_val(&v.context, env), + sub_invocations: soroban_sdk::IntoVal::into_val(&v.sub_invocations, env), + }) + } + } + }; + pub struct CreateContractHostFnContext { + pub executable: ContractExecutable, + pub salt: soroban_sdk::BytesN<32>, + } + #[automatically_derived] + impl ::core::fmt::Debug for CreateContractHostFnContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "CreateContractHostFnContext", + "executable", + &self.executable, + "salt", + &&self.salt, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for CreateContractHostFnContext { + #[inline] + fn clone(&self) -> CreateContractHostFnContext { + CreateContractHostFnContext { + executable: ::core::clone::Clone::clone(&self.executable), + salt: ::core::clone::Clone::clone(&self.salt), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for CreateContractHostFnContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for CreateContractHostFnContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for CreateContractHostFnContext { + #[inline] + fn eq(&self, other: &CreateContractHostFnContext) -> bool { + self.executable == other.executable && self.salt == other.salt + } + } + #[automatically_derived] + impl ::core::cmp::Ord for CreateContractHostFnContext { + #[inline] + fn cmp(&self, other: &CreateContractHostFnContext) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.executable, &other.executable) { + ::core::cmp::Ordering::Equal => ::core::cmp::Ord::cmp(&self.salt, &other.salt), + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for CreateContractHostFnContext { + #[inline] + fn partial_cmp( + &self, + other: &CreateContractHostFnContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.executable, &other.executable) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_CREATECONTRACTHOSTFNCONTEXT: [u8; 116usize] = + CreateContractHostFnContext::spec_xdr(); + impl CreateContractHostFnContext { + pub const fn spec_xdr() -> [u8; 116usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x1bCreateContractHostFnContext\0\0\0\0\x02\0\0\0\0\0\0\0\nexecutable\0\0\0\0\x07\xd0\0\0\0\x12ContractExecutable\0\0\0\0\0\0\0\0\0\x04salt\0\0\x03\xee\0\0\0 " + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for CreateContractHostFnContext { + const SPEC_TYPE_ID: [u8; 32] = *b"\xe1\"T\xf0&\x19?P\xad\xa3\xa0\xd2\xf1\xea\xf8~\xde\xe7\x12\xe5_&\xb62Cl\xc8x\xcc.\xd4\xcd"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CREATECONTRACTHOSTFNCONTEXT: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, + >( + 2, + *b"\xe1\"T\xf0&\x19?P\xad\xa3\xa0\xd2\xf1\xea\xf8~\xde\xe7\x12\xe5_&\xb62Cl\xc8x\xcc.\xd4\xcd", + [::SPEC_TYPE_ID], + ); + impl soroban_sdk::TryFromVal for CreateContractHostFnContext { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["executable", "salt"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + executable: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + salt: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &CreateContractHostFnContext, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["executable", "salt"]; + let vals: [Val; 2usize] = [ + (&val.executable) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.salt).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&CreateContractHostFnContext, + ) -> Result { + <_ as soroban_sdk::TryFromVal< + soroban_sdk::Env, + CreateContractHostFnContext, + >>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal + for CreateContractHostFnContext + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 2usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + executable: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "executable" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + salt: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "salt" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal + for CreateContractHostFnContext + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&CreateContractHostFnContext> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: &CreateContractHostFnContext, + ) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "executable" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.executable) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "salt" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.salt) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } + } + impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: CreateContractHostFnContext) -> Result { + (&val).try_into() + } + } + impl TryFrom<&CreateContractHostFnContext> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: &CreateContractHostFnContext, + ) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: CreateContractHostFnContext) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryCreateContractHostFnContext { + executable: ::Prototype, + salt: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryCreateContractHostFnContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "ArbitraryCreateContractHostFnContext", + "executable", + &self.executable, + "salt", + &&self.salt, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryCreateContractHostFnContext { + #[inline] + fn clone(&self) -> ArbitraryCreateContractHostFnContext { + ArbitraryCreateContractHostFnContext { + executable: ::core::clone::Clone::clone(&self.executable), + salt: ::core::clone::Clone::clone(&self.salt), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryCreateContractHostFnContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryCreateContractHostFnContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryCreateContractHostFnContext { + #[inline] + fn eq(&self, other: &ArbitraryCreateContractHostFnContext) -> bool { + self.executable == other.executable && self.salt == other.salt + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryCreateContractHostFnContext { + #[inline] + fn cmp( + &self, + other: &ArbitraryCreateContractHostFnContext, + ) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.executable, &other.executable) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryCreateContractHostFnContext { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryCreateContractHostFnContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.executable, &other.executable) + { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext: + ::std::thread::LocalKey> = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryCreateContractHostFnContext { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryCreateContractHostFnContext { + executable: arbitrary::Arbitrary::arbitrary(u)?, + salt: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryCreateContractHostFnContext { + executable: arbitrary::Arbitrary::arbitrary(&mut u)?, + salt: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for CreateContractHostFnContext { + type Prototype = ArbitraryCreateContractHostFnContext; + } + impl soroban_sdk::TryFromVal + for CreateContractHostFnContext + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryCreateContractHostFnContext, + ) -> std::result::Result { + Ok(CreateContractHostFnContext { + executable: soroban_sdk::IntoVal::into_val(&v.executable, env), + salt: soroban_sdk::IntoVal::into_val(&v.salt, env), + }) + } + } + }; + pub struct CreateContractWithConstructorHostFnContext { + pub constructor_args: soroban_sdk::Vec, + pub executable: ContractExecutable, + pub salt: soroban_sdk::BytesN<32>, + } + #[automatically_derived] + impl ::core::fmt::Debug for CreateContractWithConstructorHostFnContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "CreateContractWithConstructorHostFnContext", + "constructor_args", + &self.constructor_args, + "executable", + &self.executable, + "salt", + &&self.salt, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for CreateContractWithConstructorHostFnContext { + #[inline] + fn clone(&self) -> CreateContractWithConstructorHostFnContext { + CreateContractWithConstructorHostFnContext { + constructor_args: ::core::clone::Clone::clone(&self.constructor_args), + executable: ::core::clone::Clone::clone(&self.executable), + salt: ::core::clone::Clone::clone(&self.salt), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for CreateContractWithConstructorHostFnContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for CreateContractWithConstructorHostFnContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for CreateContractWithConstructorHostFnContext { + #[inline] + fn eq(&self, other: &CreateContractWithConstructorHostFnContext) -> bool { + self.constructor_args == other.constructor_args + && self.executable == other.executable + && self.salt == other.salt + } + } + #[automatically_derived] + impl ::core::cmp::Ord for CreateContractWithConstructorHostFnContext { + #[inline] + fn cmp( + &self, + other: &CreateContractWithConstructorHostFnContext, + ) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.constructor_args, &other.constructor_args) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.executable, &other.executable) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for CreateContractWithConstructorHostFnContext { + #[inline] + fn partial_cmp( + &self, + other: &CreateContractWithConstructorHostFnContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp( + &self.constructor_args, + &other.constructor_args, + ) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp( + &self.executable, + &other.executable, + ) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_CREATECONTRACTWITHCONSTRUCTORHOSTFNCONTEXT: [u8; 164usize] = + CreateContractWithConstructorHostFnContext::spec_xdr(); + impl CreateContractWithConstructorHostFnContext { + pub const fn spec_xdr() -> [u8; 164usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0*CreateContractWithConstructorHostFnContext\0\0\0\0\0\x03\0\0\0\0\0\0\0\x10constructor_args\0\0\x03\xea\0\0\0\0\0\0\0\0\0\0\0\nexecutable\0\0\0\0\x07\xd0\0\0\0\x12ContractExecutable\0\0\0\0\0\0\0\0\0\x04salt\0\0\x03\xee\0\0\0 " + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for CreateContractWithConstructorHostFnContext { + const SPEC_TYPE_ID: [u8; 32] = *b"\xd2;\xff\xe6\x97\xda;\x83c$F\x15Z\xf1r\xf4\xc18\xfda!\x0b\r\x87\x88\xa0\x9a\x08Yu\xccS"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CREATECONTRACTWITHCONSTRUCTORHOSTFNCONTEXT: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, + >( + 2, + *b"\xd2;\xff\xe6\x97\xda;\x83c$F\x15Z\xf1r\xf4\xc18\xfda!\x0b\r\x87\x88\xa0\x9a\x08Yu\xccS", + [::SPEC_TYPE_ID], + ); + impl soroban_sdk::TryFromVal + for CreateContractWithConstructorHostFnContext + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["constructor_args", "executable", "salt"]; + let mut vals: [Val; 3usize] = [Val::VOID.to_val(); 3usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + constructor_args: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + executable: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + salt: vals[2] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal + for soroban_sdk::Val + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &CreateContractWithConstructorHostFnContext, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["constructor_args", "executable", "salt"]; + let vals: [Val; 3usize] = [ + (&val.constructor_args) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.executable) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.salt).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal + for soroban_sdk::Val + { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&CreateContractWithConstructorHostFnContext, + ) -> Result { + <_ as soroban_sdk::TryFromVal< + soroban_sdk::Env, + CreateContractWithConstructorHostFnContext, + >>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal + for CreateContractWithConstructorHostFnContext + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 3usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + constructor_args: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "constructor_args" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + executable: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "executable" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + salt: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "salt" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal + for CreateContractWithConstructorHostFnContext + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&CreateContractWithConstructorHostFnContext> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: &CreateContractWithConstructorHostFnContext, + ) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "constructor_args" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.constructor_args) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "executable" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.executable) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "salt" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.salt) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } + } + impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: CreateContractWithConstructorHostFnContext, + ) -> Result { + (&val).try_into() + } + } + impl TryFrom<&CreateContractWithConstructorHostFnContext> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: &CreateContractWithConstructorHostFnContext, + ) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: CreateContractWithConstructorHostFnContext, + ) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryCreateContractWithConstructorHostFnContext { + constructor_args: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + executable: ::Prototype, + salt: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "ArbitraryCreateContractWithConstructorHostFnContext", + "constructor_args", + &self.constructor_args, + "executable", + &self.executable, + "salt", + &&self.salt, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn clone(&self) -> ArbitraryCreateContractWithConstructorHostFnContext { + ArbitraryCreateContractWithConstructorHostFnContext { + constructor_args: ::core::clone::Clone::clone(&self.constructor_args), + executable: ::core::clone::Clone::clone(&self.executable), + salt: ::core::clone::Clone::clone(&self.salt), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryCreateContractWithConstructorHostFnContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn eq(&self, other: &ArbitraryCreateContractWithConstructorHostFnContext) -> bool { + self.constructor_args == other.constructor_args + && self.executable == other.executable + && self.salt == other.salt + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn cmp( + &self, + other: &ArbitraryCreateContractWithConstructorHostFnContext, + ) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.constructor_args, &other.constructor_args) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.executable, &other.executable) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryCreateContractWithConstructorHostFnContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp( + &self.constructor_args, + &other.constructor_args, + ) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp( + &self.executable, + &other.executable, + ) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext: + ::std::thread::LocalKey> = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> + for ArbitraryCreateContractWithConstructorHostFnContext + { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext + .with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryCreateContractWithConstructorHostFnContext { + constructor_args: arbitrary::Arbitrary::arbitrary(u)?, + executable: arbitrary::Arbitrary::arbitrary(u)?, + salt: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext + .with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext + .with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryCreateContractWithConstructorHostFnContext { + constructor_args: arbitrary::Arbitrary::arbitrary(&mut u)?, + executable: arbitrary::Arbitrary::arbitrary(&mut u)?, + salt: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext + .with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary + for CreateContractWithConstructorHostFnContext + { + type Prototype = ArbitraryCreateContractWithConstructorHostFnContext; + } + impl + soroban_sdk::TryFromVal< + soroban_sdk::Env, + ArbitraryCreateContractWithConstructorHostFnContext, + > for CreateContractWithConstructorHostFnContext + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryCreateContractWithConstructorHostFnContext, + ) -> std::result::Result { + Ok(CreateContractWithConstructorHostFnContext { + constructor_args: soroban_sdk::IntoVal::into_val(&v.constructor_args, env), + executable: soroban_sdk::IntoVal::into_val(&v.executable, env), + salt: soroban_sdk::IntoVal::into_val(&v.salt, env), + }) + } + } + }; + pub enum Context { + Contract(ContractContext), + CreateContractHostFn(CreateContractHostFnContext), + CreateContractWithCtorHostFn(CreateContractWithConstructorHostFnContext), + } + #[automatically_derived] + impl ::core::fmt::Debug for Context { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + Context::Contract(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Contract", &__self_0) + } + Context::CreateContractHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractHostFn", + &__self_0, + ) + } + Context::CreateContractWithCtorHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractWithCtorHostFn", + &__self_0, + ) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for Context { + #[inline] + fn clone(&self) -> Context { + match self { + Context::Contract(__self_0) => { + Context::Contract(::core::clone::Clone::clone(__self_0)) + } + Context::CreateContractHostFn(__self_0) => { + Context::CreateContractHostFn(::core::clone::Clone::clone(__self_0)) + } + Context::CreateContractWithCtorHostFn(__self_0) => { + Context::CreateContractWithCtorHostFn(::core::clone::Clone::clone(__self_0)) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for Context { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for Context {} + #[automatically_derived] + impl ::core::cmp::PartialEq for Context { + #[inline] + fn eq(&self, other: &Context) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + (Context::Contract(__self_0), Context::Contract(__arg1_0)) => { + __self_0 == __arg1_0 + } + ( + Context::CreateContractHostFn(__self_0), + Context::CreateContractHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + ( + Context::CreateContractWithCtorHostFn(__self_0), + Context::CreateContractWithCtorHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for Context { + #[inline] + fn cmp(&self, other: &Context) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + (Context::Contract(__self_0), Context::Contract(__arg1_0)) => { + ::core::cmp::Ord::cmp(__self_0, __arg1_0) + } + ( + Context::CreateContractHostFn(__self_0), + Context::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + Context::CreateContractWithCtorHostFn(__self_0), + Context::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for Context { + #[inline] + fn partial_cmp( + &self, + other: &Context, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + (Context::Contract(__self_0), Context::Contract(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + ( + Context::CreateContractHostFn(__self_0), + Context::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + Context::CreateContractWithCtorHostFn(__self_0), + Context::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + pub static __SPEC_XDR_TYPE_CONTEXT: [u8; 244usize] = Context::spec_xdr(); + impl Context { + pub const fn spec_xdr() -> [u8; 244usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x07Context\0\0\0\0\x03\0\0\0\x01\0\0\0\0\0\0\0\x08Contract\0\0\0\x01\0\0\x07\xd0\0\0\0\x0fContractContext\0\0\0\0\x01\0\0\0\0\0\0\0\x14CreateContractHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0\x1bCreateContractHostFnContext\0\0\0\0\x01\0\0\0\0\0\0\0\x1cCreateContractWithCtorHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0*CreateContractWithConstructorHostFnContext\0\0" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for Context { + const SPEC_TYPE_ID: [u8; 32] = *b"\r\xb6\x0b\xec\x8f\xd04l1\xb3-\xa0{\x90\xa3\xc2\xab\x93\xd4\x82x\xe1_\x8a\xa8N?.\xcd\xc1\xfc\x08"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CONTEXT: [u8; 138usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 138usize, + 3usize, + >( + 2, + *b"\r\xb6\x0b\xec\x8f\xd04l1\xb3-\xa0{\x90\xa3\xc2\xab\x93\xd4\x82x\xe1_\x8a\xa8N?.\xcd\xc1\xfc\x08", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); + impl soroban_sdk::TryFromVal for Context { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &[ + "Contract", + "CreateContractHostFn", + "CreateContractWithCtorHostFn", + ]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Contract( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 2 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractWithCtorHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &Context, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + Context::Contract(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Contract")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + Context::CreateContractHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"CreateContractHostFn")? + .to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + Context::CreateContractWithCtorHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val( + env, + &"CreateContractWithCtorHostFn", + )? + .to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&Context, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal for Context { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "Contract" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::Contract( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "CreateContractHostFn" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::CreateContractHostFn( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "CreateContractWithCtorHostFn" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::CreateContractWithCtorHostFn( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl soroban_sdk::TryFromVal for Context { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&Context> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &Context) -> Result { + extern crate alloc; + Ok(match val { + Context::Contract(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Contract" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + Context::CreateContractHostFn(value0) => ( + soroban_sdk::xdr::ScSymbol( + "CreateContractHostFn" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + Context::CreateContractWithCtorHostFn(value0) => ( + soroban_sdk::xdr::ScSymbol( + "CreateContractWithCtorHostFn" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Context) -> Result { + (&val).try_into() + } + } + impl TryFrom<&Context> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &Context) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Context) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryContext { + Contract( + ::Prototype, + ), + CreateContractHostFn( + ::Prototype, + ), + CreateContractWithCtorHostFn( + ::Prototype, + ), + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryContext::Contract(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, "Contract", &__self_0, + ) + } + ArbitraryContext::CreateContractHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractHostFn", + &__self_0, + ) + } + ArbitraryContext::CreateContractWithCtorHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractWithCtorHostFn", + &__self_0, + ) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryContext { + #[inline] + fn clone(&self) -> ArbitraryContext { + match self { + ArbitraryContext::Contract(__self_0) => { + ArbitraryContext::Contract(::core::clone::Clone::clone(__self_0)) + } + ArbitraryContext::CreateContractHostFn(__self_0) => { + ArbitraryContext::CreateContractHostFn(::core::clone::Clone::clone( + __self_0, + )) + } + ArbitraryContext::CreateContractWithCtorHostFn(__self_0) => { + ArbitraryContext::CreateContractWithCtorHostFn( + ::core::clone::Clone::clone(__self_0), + ) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryContext { + #[inline] + fn eq(&self, other: &ArbitraryContext) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + ArbitraryContext::Contract(__self_0), + ArbitraryContext::Contract(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryContext::CreateContractHostFn(__self_0), + ArbitraryContext::CreateContractHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryContext::CreateContractWithCtorHostFn(__self_0), + ArbitraryContext::CreateContractWithCtorHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryContext { + #[inline] + fn cmp(&self, other: &ArbitraryContext) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + ArbitraryContext::Contract(__self_0), + ArbitraryContext::Contract(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryContext::CreateContractHostFn(__self_0), + ArbitraryContext::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryContext::CreateContractWithCtorHostFn(__self_0), + ArbitraryContext::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryContext { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + ArbitraryContext::Contract(__self_0), + ArbitraryContext::Contract(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + ArbitraryContext::CreateContractHostFn(__self_0), + ArbitraryContext::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + ArbitraryContext::CreateContractWithCtorHostFn(__self_0), + ArbitraryContext::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryContext: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryContext { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) + * 3u64) + >> 32 + { + 0u64 => ArbitraryContext::Contract( + arbitrary::Arbitrary::arbitrary(u)?, + ), + 1u64 => ArbitraryContext::CreateContractHostFn( + arbitrary::Arbitrary::arbitrary(u)?, + ), + 2u64 => ArbitraryContext::CreateContractWithCtorHostFn( + arbitrary::Arbitrary::arbitrary(u)?, + ), + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) + * 3u64) + >> 32 + { + 0u64 => ArbitraryContext::Contract( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 1u64 => ArbitraryContext::CreateContractHostFn( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 2u64 => ArbitraryContext::CreateContractWithCtorHostFn( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for Context { + type Prototype = ArbitraryContext; + } + impl soroban_sdk::TryFromVal for Context { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryContext, + ) -> std::result::Result { + Ok(match v { + ArbitraryContext::Contract(field_0) => { + Context::Contract(soroban_sdk::IntoVal::into_val(field_0, env)) + } + ArbitraryContext::CreateContractHostFn(field_0) => { + Context::CreateContractHostFn(soroban_sdk::IntoVal::into_val( + field_0, env, + )) + } + ArbitraryContext::CreateContractWithCtorHostFn(field_0) => { + Context::CreateContractWithCtorHostFn(soroban_sdk::IntoVal::into_val( + field_0, env, + )) + } + }) + } + } + }; + pub enum ContractExecutable { + Wasm(soroban_sdk::BytesN<32>), + } + #[automatically_derived] + impl ::core::fmt::Debug for ContractExecutable { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ContractExecutable::Wasm(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm", &__self_0) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ContractExecutable { + #[inline] + fn clone(&self) -> ContractExecutable { + match self { + ContractExecutable::Wasm(__self_0) => { + ContractExecutable::Wasm(::core::clone::Clone::clone(__self_0)) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ContractExecutable { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ContractExecutable {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ContractExecutable { + #[inline] + fn eq(&self, other: &ContractExecutable) -> bool { + match (self, other) { + (ContractExecutable::Wasm(__self_0), ContractExecutable::Wasm(__arg1_0)) => { + __self_0 == __arg1_0 + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ContractExecutable { + #[inline] + fn cmp(&self, other: &ContractExecutable) -> ::core::cmp::Ordering { + match (self, other) { + (ContractExecutable::Wasm(__self_0), ContractExecutable::Wasm(__arg1_0)) => { + ::core::cmp::Ord::cmp(__self_0, __arg1_0) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ContractExecutable { + #[inline] + fn partial_cmp( + &self, + other: &ContractExecutable, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match (self, other) { + (ContractExecutable::Wasm(__self_0), ContractExecutable::Wasm(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + } + } + } + pub static __SPEC_XDR_TYPE_CONTRACTEXECUTABLE: [u8; 68usize] = + ContractExecutable::spec_xdr(); + impl ContractExecutable { + pub const fn spec_xdr() -> [u8; 68usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x12ContractExecutable\0\0\0\0\0\x01\0\0\0\x01\0\0\0\0\0\0\0\x04Wasm\0\0\0\x01\0\0\x03\xee\0\0\0 " + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for ContractExecutable { + const SPEC_TYPE_ID: [u8; 32] = *b"^\xbe34\xd8\x99\x84\x91\x81\x9fu\x9fu\x05\xb8\xb4\x14\x95\xb7\x9d|\x06$\x04y\xe9\"\xb9\x14\xfc\xf9\x85"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CONTRACTEXECUTABLE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"^\xbe34\xd8\x99\x84\x91\x81\x9fu\x9fu\x05\xb8\xb4\x14\x95\xb7\x9d|\x06$\x04y\xe9\"\xb9\x14\xfc\xf9\x85", + [], + ); + impl soroban_sdk::TryFromVal for ContractExecutable { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["Wasm"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Wasm( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &ContractExecutable, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + ContractExecutable::Wasm(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Wasm")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&ContractExecutable, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + impl soroban_sdk::TryFromVal for ContractExecutable { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "Wasm" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::Wasm( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl soroban_sdk::TryFromVal for ContractExecutable { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&ContractExecutable> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &ContractExecutable) -> Result { + extern crate alloc; + Ok(match val { + ContractExecutable::Wasm(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Wasm" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: ContractExecutable) -> Result { + (&val).try_into() + } + } + impl TryFrom<&ContractExecutable> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &ContractExecutable) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: ContractExecutable) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryContractExecutable { + Wasm( + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + ), + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryContractExecutable { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryContractExecutable::Wasm(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm", &__self_0) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryContractExecutable { + #[inline] + fn clone(&self) -> ArbitraryContractExecutable { + match self { + ArbitraryContractExecutable::Wasm(__self_0) => { + ArbitraryContractExecutable::Wasm(::core::clone::Clone::clone(__self_0)) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryContractExecutable { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryContractExecutable {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryContractExecutable { + #[inline] + fn eq(&self, other: &ArbitraryContractExecutable) -> bool { + match (self, other) { + ( + ArbitraryContractExecutable::Wasm(__self_0), + ArbitraryContractExecutable::Wasm(__arg1_0), + ) => __self_0 == __arg1_0, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryContractExecutable { + #[inline] + fn cmp(&self, other: &ArbitraryContractExecutable) -> ::core::cmp::Ordering { + match (self, other) { + ( + ArbitraryContractExecutable::Wasm(__self_0), + ArbitraryContractExecutable::Wasm(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryContractExecutable { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryContractExecutable, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match (self, other) { + ( + ArbitraryContractExecutable::Wasm(__self_0), + ArbitraryContractExecutable::Wasm(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryContractExecutable: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryContractExecutable { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractExecutable.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) + * 1u64) + >> 32 + { + 0u64 => ArbitraryContractExecutable::Wasm( + arbitrary::Arbitrary::arbitrary(u)?, + ), + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractExecutable.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractExecutable.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) + * 1u64) + >> 32 + { + 0u64 => ArbitraryContractExecutable::Wasm( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractExecutable.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for ContractExecutable { + type Prototype = ArbitraryContractExecutable; + } + impl soroban_sdk::TryFromVal for ContractExecutable { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryContractExecutable, + ) -> std::result::Result { + Ok(match v { + ArbitraryContractExecutable::Wasm(field_0) => { + ContractExecutable::Wasm(soroban_sdk::IntoVal::into_val(field_0, env)) + } + }) + } + } + }; + pub enum InvokerContractAuthEntry { + Contract(SubContractInvocation), + CreateContractHostFn(CreateContractHostFnContext), + CreateContractWithCtorHostFn(CreateContractWithConstructorHostFnContext), + } + #[automatically_derived] + impl ::core::fmt::Debug for InvokerContractAuthEntry { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + InvokerContractAuthEntry::Contract(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Contract", &__self_0) + } + InvokerContractAuthEntry::CreateContractHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractHostFn", + &__self_0, + ) + } + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractWithCtorHostFn", + &__self_0, + ) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for InvokerContractAuthEntry { + #[inline] + fn clone(&self) -> InvokerContractAuthEntry { + match self { + InvokerContractAuthEntry::Contract(__self_0) => { + InvokerContractAuthEntry::Contract(::core::clone::Clone::clone(__self_0)) + } + InvokerContractAuthEntry::CreateContractHostFn(__self_0) => { + InvokerContractAuthEntry::CreateContractHostFn(::core::clone::Clone::clone( + __self_0, + )) + } + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0) => { + InvokerContractAuthEntry::CreateContractWithCtorHostFn( + ::core::clone::Clone::clone(__self_0), + ) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for InvokerContractAuthEntry { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for InvokerContractAuthEntry {} + #[automatically_derived] + impl ::core::cmp::PartialEq for InvokerContractAuthEntry { + #[inline] + fn eq(&self, other: &InvokerContractAuthEntry) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + InvokerContractAuthEntry::Contract(__self_0), + InvokerContractAuthEntry::Contract(__arg1_0), + ) => __self_0 == __arg1_0, + ( + InvokerContractAuthEntry::CreateContractHostFn(__self_0), + InvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + ( + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0), + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for InvokerContractAuthEntry { + #[inline] + fn cmp(&self, other: &InvokerContractAuthEntry) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + InvokerContractAuthEntry::Contract(__self_0), + InvokerContractAuthEntry::Contract(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractHostFn(__self_0), + InvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0), + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for InvokerContractAuthEntry { + #[inline] + fn partial_cmp( + &self, + other: &InvokerContractAuthEntry, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + InvokerContractAuthEntry::Contract(__self_0), + InvokerContractAuthEntry::Contract(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractHostFn(__self_0), + InvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0), + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + pub static __SPEC_XDR_TYPE_INVOKERCONTRACTAUTHENTRY: [u8; 268usize] = + InvokerContractAuthEntry::spec_xdr(); + impl InvokerContractAuthEntry { + pub const fn spec_xdr() -> [u8; 268usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x18InvokerContractAuthEntry\0\0\0\x03\0\0\0\x01\0\0\0\0\0\0\0\x08Contract\0\0\0\x01\0\0\x07\xd0\0\0\0\x15SubContractInvocation\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x14CreateContractHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0\x1bCreateContractHostFnContext\0\0\0\0\x01\0\0\0\0\0\0\0\x1cCreateContractWithCtorHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0*CreateContractWithConstructorHostFnContext\0\0" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for InvokerContractAuthEntry { + const SPEC_TYPE_ID: [u8; 32] = *b"\xf0{\xa6\xe9r\xf3\x10\xf6\x0b)\xdb\x8e\r\xea\xe0\xa0\x89\xca\x1a\x1c\x12\xf8\x8f'K\xda\x9b\x87\xab\xaa\xf8="; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_INVOKERCONTRACTAUTHENTRY: [u8; 138usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 138usize, + 3usize, + >( + 2, + *b"\xf0{\xa6\xe9r\xf3\x10\xf6\x0b)\xdb\x8e\r\xea\xe0\xa0\x89\xca\x1a\x1c\x12\xf8\x8f'K\xda\x9b\x87\xab\xaa\xf8=", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); + impl soroban_sdk::TryFromVal for InvokerContractAuthEntry { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &[ + "Contract", + "CreateContractHostFn", + "CreateContractWithCtorHostFn", + ]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Contract( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 2 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractWithCtorHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &InvokerContractAuthEntry, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + InvokerContractAuthEntry::Contract(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Contract")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + InvokerContractAuthEntry::CreateContractHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"CreateContractHostFn")? + .to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + InvokerContractAuthEntry::CreateContractWithCtorHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val( + env, + &"CreateContractWithCtorHostFn", + )? + .to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&InvokerContractAuthEntry, + ) -> Result { + <_ as soroban_sdk::TryFromVal< + soroban_sdk::Env, + InvokerContractAuthEntry, + >>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal + for InvokerContractAuthEntry + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "Contract" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::Contract( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "CreateContractHostFn" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::CreateContractHostFn( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "CreateContractWithCtorHostFn" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::CreateContractWithCtorHostFn( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl soroban_sdk::TryFromVal + for InvokerContractAuthEntry + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&InvokerContractAuthEntry> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &InvokerContractAuthEntry) -> Result { + extern crate alloc; + Ok(match val { + InvokerContractAuthEntry::Contract(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Contract" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + InvokerContractAuthEntry::CreateContractHostFn(value0) => ( + soroban_sdk::xdr::ScSymbol( + "CreateContractHostFn" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + InvokerContractAuthEntry::CreateContractWithCtorHostFn(value0) => ( + soroban_sdk::xdr::ScSymbol( + "CreateContractWithCtorHostFn" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: InvokerContractAuthEntry) -> Result { + (&val).try_into() + } + } + impl TryFrom<&InvokerContractAuthEntry> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &InvokerContractAuthEntry) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: InvokerContractAuthEntry) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryInvokerContractAuthEntry { + Contract( + ::Prototype, + ), + CreateContractHostFn( + ::Prototype, + ), + CreateContractWithCtorHostFn( + ::Prototype, + ), + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryInvokerContractAuthEntry { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryInvokerContractAuthEntry::Contract(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, "Contract", &__self_0, + ) + } + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractHostFn", + &__self_0, + ) + } + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __self_0, + ) => ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractWithCtorHostFn", + &__self_0, + ), + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryInvokerContractAuthEntry { + #[inline] + fn clone(&self) -> ArbitraryInvokerContractAuthEntry { + match self { + ArbitraryInvokerContractAuthEntry::Contract(__self_0) => { + ArbitraryInvokerContractAuthEntry::Contract( + ::core::clone::Clone::clone(__self_0), + ) + } + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0) => { + ArbitraryInvokerContractAuthEntry::CreateContractHostFn( + ::core::clone::Clone::clone(__self_0), + ) + } + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __self_0, + ) => ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + ::core::clone::Clone::clone(__self_0), + ), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryInvokerContractAuthEntry { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryInvokerContractAuthEntry {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryInvokerContractAuthEntry { + #[inline] + fn eq(&self, other: &ArbitraryInvokerContractAuthEntry) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + ArbitraryInvokerContractAuthEntry::Contract(__self_0), + ArbitraryInvokerContractAuthEntry::Contract(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0), + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __self_0, + ), + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __arg1_0, + ), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryInvokerContractAuthEntry { + #[inline] + fn cmp(&self, other: &ArbitraryInvokerContractAuthEntry) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + ArbitraryInvokerContractAuthEntry::Contract(__self_0), + ArbitraryInvokerContractAuthEntry::Contract(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0), + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __self_0, + ), + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __arg1_0, + ), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryInvokerContractAuthEntry { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryInvokerContractAuthEntry, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + ArbitraryInvokerContractAuthEntry::Contract(__self_0), + ArbitraryInvokerContractAuthEntry::Contract(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0), + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __self_0, + ), + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __arg1_0, + ), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryInvokerContractAuthEntry { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from( + ::arbitrary(u)?, + ) * 3u64) >> 32 + { + 0u64 => { + ArbitraryInvokerContractAuthEntry::Contract( + arbitrary::Arbitrary::arbitrary(u)?, + ) + } + 1u64 => { + ArbitraryInvokerContractAuthEntry::CreateContractHostFn( + arbitrary::Arbitrary::arbitrary(u)?, + ) + } + 2u64 => { + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + arbitrary::Arbitrary::arbitrary(u)?, + ) + } + _ => { + ::core::panicking::panic( + "internal error: entered unreachable code", + ) + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from( + ::arbitrary(&mut u)?, + ) * 3u64) >> 32 + { + 0u64 => { + ArbitraryInvokerContractAuthEntry::Contract( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ) + } + 1u64 => { + ArbitraryInvokerContractAuthEntry::CreateContractHostFn( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ) + } + 2u64 => { + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ) + } + _ => { + ::core::panicking::panic( + "internal error: entered unreachable code", + ) + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for InvokerContractAuthEntry { + type Prototype = ArbitraryInvokerContractAuthEntry; + } + impl soroban_sdk::TryFromVal + for InvokerContractAuthEntry + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryInvokerContractAuthEntry, + ) -> std::result::Result { + Ok(match v { + ArbitraryInvokerContractAuthEntry::Contract(field_0) => { + InvokerContractAuthEntry::Contract(soroban_sdk::IntoVal::into_val( + field_0, env, + )) + } + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(field_0) => { + InvokerContractAuthEntry::CreateContractHostFn( + soroban_sdk::IntoVal::into_val(field_0, env), + ) + } + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + field_0, + ) => InvokerContractAuthEntry::CreateContractWithCtorHostFn( + soroban_sdk::IntoVal::into_val(field_0, env), + ), + }) + } + } + }; + pub enum Executable { + Wasm(soroban_sdk::BytesN<32>), + StellarAsset, + Account, + } + #[automatically_derived] + impl ::core::fmt::Debug for Executable { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + Executable::Wasm(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm", &__self_0) + } + Executable::StellarAsset => { + ::core::fmt::Formatter::write_str(f, "StellarAsset") + } + Executable::Account => ::core::fmt::Formatter::write_str(f, "Account"), + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for Executable { + #[inline] + fn clone(&self) -> Executable { + match self { + Executable::Wasm(__self_0) => { + Executable::Wasm(::core::clone::Clone::clone(__self_0)) + } + Executable::StellarAsset => Executable::StellarAsset, + Executable::Account => Executable::Account, + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for Executable { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for Executable {} + #[automatically_derived] + impl ::core::cmp::PartialEq for Executable { + #[inline] + fn eq(&self, other: &Executable) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + (Executable::Wasm(__self_0), Executable::Wasm(__arg1_0)) => { + __self_0 == __arg1_0 + } + _ => true, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for Executable { + #[inline] + fn cmp(&self, other: &Executable) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + (Executable::Wasm(__self_0), Executable::Wasm(__arg1_0)) => { + ::core::cmp::Ord::cmp(__self_0, __arg1_0) + } + _ => ::core::cmp::Ordering::Equal, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for Executable { + #[inline] + fn partial_cmp( + &self, + other: &Executable, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + (Executable::Wasm(__self_0), Executable::Wasm(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + pub static __SPEC_XDR_TYPE_EXECUTABLE: [u8; 104usize] = Executable::spec_xdr(); + impl Executable { + pub const fn spec_xdr() -> [u8; 104usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\nExecutable\0\0\0\0\0\x03\0\0\0\x01\0\0\0\0\0\0\0\x04Wasm\0\0\0\x01\0\0\x03\xee\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\x0cStellarAsset\0\0\0\0\0\0\0\0\0\0\0\x07Account\0" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for Executable { + const SPEC_TYPE_ID: [u8; 32] = *b"L|{\r\xf4\xf2\x1a\xa8\xf6\x981\xe2K\xcb\x824N\xe6\x97\xed\xdf\xc2\x1cck\xd6\xceW\x9cx\x10\x1e"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_EXECUTABLE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"L|{\r\xf4\xf2\x1a\xa8\xf6\x981\xe2K\xcb\x824N\xe6\x97\xed\xdf\xc2\x1cck\xd6\xceW\x9cx\x10\x1e", + [], + ); + impl soroban_sdk::TryFromVal for Executable { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["Wasm", "StellarAsset", "Account"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Wasm( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 0 { + return Err(soroban_sdk::ConversionError); + } + Self::StellarAsset + } + 2 => { + if iter.len() > 0 { + return Err(soroban_sdk::ConversionError); + } + Self::Account + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &Executable, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + Executable::Wasm(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Wasm")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + Executable::StellarAsset => { + let tup: (soroban_sdk::Val,) = + (soroban_sdk::Symbol::try_from_val(env, &"StellarAsset")?.to_val(),); + tup.try_into_val(env).map_err(Into::into) + } + Executable::Account => { + let tup: (soroban_sdk::Val,) = + (soroban_sdk::Symbol::try_from_val(env, &"Account")?.to_val(),); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&Executable, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + impl soroban_sdk::TryFromVal for Executable { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "Wasm" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::Wasm( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "StellarAsset" => { + if iter.len() > 0 { + return Err(soroban_sdk::xdr::Error::Invalid); + } + Self::StellarAsset + } + "Account" => { + if iter.len() > 0 { + return Err(soroban_sdk::xdr::Error::Invalid); + } + Self::Account + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl soroban_sdk::TryFromVal for Executable { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&Executable> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &Executable) -> Result { + extern crate alloc; + Ok(match val { + Executable::Wasm(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Wasm" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + Executable::StellarAsset => { + let symbol = soroban_sdk::xdr::ScSymbol( + "StellarAsset" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ); + let val = soroban_sdk::xdr::ScVal::Symbol(symbol); + (val,) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + } + Executable::Account => { + let symbol = soroban_sdk::xdr::ScSymbol( + "Account" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ); + let val = soroban_sdk::xdr::ScVal::Symbol(symbol); + (val,) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + } + }) + } + } + impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Executable) -> Result { + (&val).try_into() + } + } + impl TryFrom<&Executable> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &Executable) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Executable) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryExecutable { + Wasm( + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + ), + StellarAsset, + Account, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryExecutable { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryExecutable::Wasm(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm", &__self_0) + } + ArbitraryExecutable::StellarAsset => { + ::core::fmt::Formatter::write_str(f, "StellarAsset") + } + ArbitraryExecutable::Account => { + ::core::fmt::Formatter::write_str(f, "Account") + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryExecutable { + #[inline] + fn clone(&self) -> ArbitraryExecutable { + match self { + ArbitraryExecutable::Wasm(__self_0) => { + ArbitraryExecutable::Wasm(::core::clone::Clone::clone(__self_0)) + } + ArbitraryExecutable::StellarAsset => ArbitraryExecutable::StellarAsset, + ArbitraryExecutable::Account => ArbitraryExecutable::Account, + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryExecutable { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryExecutable {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryExecutable { + #[inline] + fn eq(&self, other: &ArbitraryExecutable) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + ArbitraryExecutable::Wasm(__self_0), + ArbitraryExecutable::Wasm(__arg1_0), + ) => __self_0 == __arg1_0, + _ => true, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryExecutable { + #[inline] + fn cmp(&self, other: &ArbitraryExecutable) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + ArbitraryExecutable::Wasm(__self_0), + ArbitraryExecutable::Wasm(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => ::core::cmp::Ordering::Equal, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryExecutable { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryExecutable, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + ArbitraryExecutable::Wasm(__self_0), + ArbitraryExecutable::Wasm(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryExecutable: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryExecutable { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryExecutable.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) + * 3u64) + >> 32 + { + 0u64 => ArbitraryExecutable::Wasm( + arbitrary::Arbitrary::arbitrary(u)?, + ), + 1u64 => ArbitraryExecutable::StellarAsset, + 2u64 => ArbitraryExecutable::Account, + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryExecutable.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryExecutable.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) + * 3u64) + >> 32 + { + 0u64 => ArbitraryExecutable::Wasm( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 1u64 => ArbitraryExecutable::StellarAsset, + 2u64 => ArbitraryExecutable::Account, + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryExecutable.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all(&[]), + arbitrary::size_hint::and_all(&[]), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for Executable { + type Prototype = ArbitraryExecutable; + } + impl soroban_sdk::TryFromVal for Executable { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryExecutable, + ) -> std::result::Result { + Ok(match v { + ArbitraryExecutable::Wasm(field_0) => { + Executable::Wasm(soroban_sdk::IntoVal::into_val(field_0, env)) + } + ArbitraryExecutable::StellarAsset => Executable::StellarAsset, + ArbitraryExecutable::Account => Executable::Account, + }) + } + } + }; } extern crate test; #[rustc_test_marker = "test::test_native_void"] diff --git a/tests-expanded/test_tuples_wasm32v1-none.rs b/tests-expanded/test_tuples_wasm32v1-none.rs index 2b9bf3c77..ab042b2f5 100644 --- a/tests-expanded/test_tuples_wasm32v1-none.rs +++ b/tests-expanded/test_tuples_wasm32v1-none.rs @@ -48,6 +48,14 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x07void_fn\0\0\0\0\x01\0\0\0\0\0\0\0\x08void_arg\0\0\0\x02\0\0\0\x01\0\0\0\x02" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_VOID_FN: [u8; 42usize] = + soroban_sdk::spec_shaking::encode_graph_record::<42usize, 0usize>( + 0, + *b"\x94\x83*7S\xb5C\x1dJ\xfdD\x96\xff>j.#\x8b\xe3\xd8\xd8@\x07V\xf5\x931\xc6\xe7\xa1\xdcC", + [], + ); #[doc(hidden)] #[allow(non_snake_case)] pub mod __Contract__tuple1__spec { @@ -63,6 +71,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x06tuple1\0\0\0\0\0\x01\0\0\0\0\0\0\0\x03arg\0\0\0\x03\xed\0\0\0\x01\0\0\0\x04\0\0\0\x01\0\0\x03\xed\0\0\0\x01\0\0\0\x04" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_TUPLE1: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 0, + *b"\xb0\xef( + 0, + *b"w\x9e\xa1:\xedN\x8a)\xca\x95\xd4e\x99\xfd\x95\x94Ff0w+N\xef\x85\x87k\xe58Se\xa3l", + [], + ); impl<'a> ContractClient<'a> { pub fn void_fn(&self, _void_arg: &()) -> () { use core::ops::Not; diff --git a/tests-expanded/test_udt_tests.rs b/tests-expanded/test_udt_tests.rs index 0209acf69..3bb8dfadd 100644 --- a/tests-expanded/test_udt_tests.rs +++ b/tests-expanded/test_udt_tests.rs @@ -4,7 +4,7 @@ extern crate core; #[prelude_import] use core::prelude::rust_2021::*; -use soroban_sdk::{contract, contractimpl, contracttype, Vec}; +use soroban_sdk::{contract, contractimpl, contracttype, Error, Map, Symbol, Vec}; pub enum UdtEnum2 { A = 10, B = 15, @@ -55,11 +55,18 @@ impl UdtEnum2 { *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x08UdtEnum2\0\0\0\x02\0\0\0\0\0\0\0\x01A\0\0\0\0\0\0\n\0\0\0\0\0\0\0\x01B\0\0\0\0\0\0\x0f" } } -impl soroban_sdk::SpecShakingMarker for UdtEnum2 { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() {} +impl soroban_sdk::spec_shaking::SpecTypeId for UdtEnum2 { + const SPEC_TYPE_ID: [u8; 32] = *b"\xaf\xf7\x93\xba\x9eM\xde\x9a?'\xa8\xb9\xcb\x94\x9f\x88\xf6L\xc0\xb9\x18\xd1\xc9\x1a5\xf8\x99\xa59\xc2\xcf\x9e"; } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UDTENUM2: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\xaf\xf7\x93\xba\x9eM\xde\x9a?'\xa8\xb9\xcb\x94\x9f\x88\xf6L\xc0\xb9\x18\xd1\xc9\x1a5\xf8\x99\xa59\xc2\xcf\x9e", + [], +); impl soroban_sdk::TryFromVal for UdtEnum2 { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -404,15 +411,22 @@ impl UdtEnum { *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x07UdtEnum\0\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x04UdtA\0\0\0\x01\0\0\0\0\0\0\0\x04UdtB\0\0\0\x01\0\0\x07\xd0\0\0\0\tUdtStruct\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04UdtC\0\0\0\x01\0\0\x07\xd0\0\0\0\x08UdtEnum2\0\0\0\x01\0\0\0\0\0\0\0\x04UdtD\0\0\0\x01\0\0\x07\xd0\0\0\0\x08UdtTuple" } } -impl soroban_sdk::SpecShakingMarker for UdtEnum { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UdtEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"\xf3\xb0\xab@i\rH\xb4\x81\x9c\x94|?A\xef\xcf\xf3%Q\xd5\x8b\x90\xb2B\x18\xfb\x8c>\xaa\x8c^2"; } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UDTENUM: [u8; 138usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 138usize, + 3usize, +>( + 2, + *b"\xf3\xb0\xab@i\rH\xb4\x81\x9c\x94|?A\xef\xcf\xf3%Q\xd5\x8b\x90\xb2B\x18\xfb\x8c>\xaa\x8c^2", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); impl soroban_sdk::TryFromVal for UdtEnum { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -1019,14 +1033,18 @@ impl UdtTuple { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x08UdtTuple\0\0\0\x02\0\0\0\0\0\0\0\x010\0\0\0\0\0\0\x07\0\0\0\0\0\0\0\x011\0\0\0\0\0\x03\xea\0\0\0\x07" } } -impl soroban_sdk::SpecShakingMarker for UdtTuple { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UdtTuple { + const SPEC_TYPE_ID: [u8; 32] = *b"\xeb\x9f\x12&\x9av(*\x7f17.3\x91\xccc\xfc\xec\xee3\x0f\x96\xf2P\x1b9\xe8\xc6\x8f\xf0\xe0\xeb"; } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UDTTUPLE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\xeb\x9f\x12&\x9av(*\x7f17.3\x91\xccc\xfc\xec\xee3\x0f\x96\xf2P\x1b9\xe8\xc6\x8f\xf0\xe0\xeb", + [], +); impl soroban_sdk::TryFromVal for UdtTuple { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -1412,15 +1430,18 @@ impl UdtStruct { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\tUdtStruct\0\0\0\0\0\0\x03\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x07\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x07\0\0\0\0\0\0\0\x01c\0\0\0\0\0\x03\xea\0\0\0\x07" } } -impl soroban_sdk::SpecShakingMarker for UdtStruct { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for UdtStruct { + const SPEC_TYPE_ID: [u8; 32] = *b"\x16'd8\xff\xc9\xb1\xf8\x1cf\xb0\x84\xb1\xb8\xfay\x84`\xe4\xddp;\xc5*\x0e\xbaH:\x94\xbb\xb2\x87"; } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UDTSTRUCT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\x16'd8\xff\xc9\xb1\xf8\x1cf\xb0\x84\xb1\xb8\xfay\x84`\xe4\xddp;\xc5*\x0e\xbaH:\x94\xbb\xb2\x87", + [], +); impl soroban_sdk::TryFromVal for UdtStruct { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -1833,366 +1854,11044 @@ const _: () = { } } }; -pub struct Contract; -///ContractArgs is a type for building arg lists for functions defined in "Contract". -pub struct ContractArgs; -///ContractClient is a client for calling the contract defined in "Contract". -pub struct ContractClient<'a> { - pub env: soroban_sdk::Env, - pub address: soroban_sdk::Address, - #[doc(hidden)] - set_auths: Option<&'a [soroban_sdk::xdr::SorobanAuthorizationEntry]>, - #[doc(hidden)] - mock_auths: Option<&'a [soroban_sdk::testutils::MockAuth<'a>]>, - #[doc(hidden)] - mock_all_auths: bool, - #[doc(hidden)] - allow_non_root_auth: bool, +pub struct UdtRecursive { + pub a: Symbol, + pub b: Vec, } -impl<'a> ContractClient<'a> { - pub fn new(env: &soroban_sdk::Env, address: &soroban_sdk::Address) -> Self { - Self { - env: env.clone(), - address: address.clone(), - set_auths: None, - mock_auths: None, - mock_all_auths: false, - allow_non_root_auth: false, - } - } - /// Set authorizations in the environment which will be consumed by - /// contracts when they invoke `Address::require_auth` or - /// `Address::require_auth_for_args` functions. - /// - /// Requires valid signatures for the authorization to be successful. - /// To mock auth without requiring valid signatures, use `mock_auths`. - /// - /// See `soroban_sdk::Env::set_auths` for more details and examples. - pub fn set_auths(&self, auths: &'a [soroban_sdk::xdr::SorobanAuthorizationEntry]) -> Self { - Self { - env: self.env.clone(), - address: self.address.clone(), - set_auths: Some(auths), - mock_auths: self.mock_auths.clone(), - mock_all_auths: false, - allow_non_root_auth: false, - } - } - /// Mock authorizations in the environment which will cause matching invokes - /// of `Address::require_auth` and `Address::require_auth_for_args` to - /// pass. - /// - /// See `soroban_sdk::Env::set_auths` for more details and examples. - pub fn mock_auths(&self, mock_auths: &'a [soroban_sdk::testutils::MockAuth<'a>]) -> Self { - Self { - env: self.env.clone(), - address: self.address.clone(), - set_auths: self.set_auths.clone(), - mock_auths: Some(mock_auths), - mock_all_auths: false, - allow_non_root_auth: false, - } - } - /// Mock all calls to the `Address::require_auth` and - /// `Address::require_auth_for_args` functions in invoked contracts, - /// having them succeed as if authorization was provided. - /// - /// See `soroban_sdk::Env::mock_all_auths` for more details and - /// examples. - pub fn mock_all_auths(&self) -> Self { - Self { - env: self.env.clone(), - address: self.address.clone(), - set_auths: None, - mock_auths: None, - mock_all_auths: true, - allow_non_root_auth: false, - } - } - /// A version of `mock_all_auths` that allows authorizations that - /// are not present in the root invocation. - /// - /// Refer to `mock_all_auths` documentation for details and - /// prefer using `mock_all_auths` unless non-root authorization is - /// required. - /// - /// See `soroban_sdk::Env::mock_all_auths_allowing_non_root_auth` - /// for more details and examples. - pub fn mock_all_auths_allowing_non_root_auth(&self) -> Self { - Self { - env: self.env.clone(), - address: self.address.clone(), - set_auths: None, - mock_auths: None, - mock_all_auths: true, - allow_non_root_auth: true, +#[automatically_derived] +impl ::core::clone::Clone for UdtRecursive { + #[inline] + fn clone(&self) -> UdtRecursive { + UdtRecursive { + a: ::core::clone::Clone::clone(&self.a), + b: ::core::clone::Clone::clone(&self.b), } } } -mod __contract_fn_set_registry { - use super::*; - extern crate std; - use std::collections::BTreeMap; - use std::sync::Mutex; - pub type F = soroban_sdk::testutils::ContractFunctionF; - static FUNCS: Mutex> = Mutex::new(BTreeMap::new()); - pub fn register(name: &'static str, func: &'static F) { - FUNCS.lock().unwrap().insert(name, func); +#[automatically_derived] +impl ::core::fmt::Debug for UdtRecursive { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UdtRecursive", + "a", + &self.a, + "b", + &&self.b, + ) } - pub fn call( - name: &str, - env: soroban_sdk::Env, - args: &[soroban_sdk::Val], - ) -> Option { - let fopt: Option<&'static F> = FUNCS.lock().unwrap().get(name).map(|f| f.clone()); - fopt.map(|f| f(env, args)) +} +#[automatically_derived] +impl ::core::cmp::Eq for UdtRecursive { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; } } -impl soroban_sdk::testutils::ContractFunctionRegister for Contract { - fn register(name: &'static str, func: &'static __contract_fn_set_registry::F) { - __contract_fn_set_registry::register(name, func); +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UdtRecursive {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UdtRecursive { + #[inline] + fn eq(&self, other: &UdtRecursive) -> bool { + self.a == other.a && self.b == other.b } } -#[doc(hidden)] -impl soroban_sdk::testutils::ContractFunctionSet for Contract { - fn call( - &self, - func: &str, - env: soroban_sdk::Env, - args: &[soroban_sdk::Val], - ) -> Option { - __contract_fn_set_registry::call(func, env, args) +pub static __SPEC_XDR_TYPE_UDTRECURSIVE: [u8; 84usize] = UdtRecursive::spec_xdr(); +impl UdtRecursive { + pub const fn spec_xdr() -> [u8; 84usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0cUdtRecursive\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x11\0\0\0\0\0\0\0\x01b\0\0\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x0cUdtRecursive" } } -impl Contract { - pub fn add(a: UdtEnum, b: UdtEnum) -> i64 { - let a = match a { - UdtEnum::UdtA => 0, - UdtEnum::UdtB(udt) => udt.a + udt.b, - UdtEnum::UdtC(val) => val as i64, - UdtEnum::UdtD(tup) => tup.0 + tup.1.try_iter().fold(0i64, |sum, i| sum + i.unwrap()), - }; - let b = match b { - UdtEnum::UdtA => 0, - UdtEnum::UdtB(udt) => udt.a + udt.b, - UdtEnum::UdtC(val) => val as i64, - UdtEnum::UdtD(tup) => tup.0 + tup.1.try_iter().fold(0i64, |sum, i| sum + i.unwrap()), - }; - a + b +impl soroban_sdk::spec_shaking::SpecTypeId for UdtRecursive { + const SPEC_TYPE_ID: [u8; 32] = *b"\xc8\x12\x91\xfe\xd7\x13\xf5\x9c\xe4\xc7\x03\xdc@#$F\r\x04\xe2j_\xb0\xacC\xfd\x0b\xc0J~<\xfc\x05"; +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UDTRECURSIVE: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 2, + *b"\xc8\x12\x91\xfe\xd7\x13\xf5\x9c\xe4\xc7\x03\xdc@#$F\r\x04\xe2j_\xb0\xacC\xfd\x0b\xc0J~<\xfc\x05", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::TryFromVal for UdtRecursive { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["a", "b"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + a: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + b: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) } } -#[doc(hidden)] -#[allow(non_snake_case)] -pub mod __Contract__add__spec { - #[doc(hidden)] - #[allow(non_snake_case)] - #[allow(non_upper_case_globals)] - pub static __SPEC_XDR_FN_ADD: [u8; 84usize] = super::Contract::spec_xdr_add(); +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UdtRecursive, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["a", "b"]; + let vals: [Val; 2usize] = [ + (&val.a).try_into_val(env).map_err(|_| ConversionError)?, + (&val.b).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } } -impl Contract { - #[allow(non_snake_case)] - pub const fn spec_xdr_add() -> [u8; 84usize] { - *b"\0\0\0\0\0\0\0\0\0\0\0\x03add\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\x07\xd0\0\0\0\x07UdtEnum\0\0\0\0\0\0\0\0\x01b\0\0\0\0\0\x07\xd0\0\0\0\x07UdtEnum\0\0\0\0\x01\0\0\0\x07" +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UdtRecursive, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } -impl<'a> ContractClient<'a> { - pub fn add(&self, a: &UdtEnum, b: &UdtEnum) -> i64 { - use core::ops::Not; - let old_auth_manager = self - .env - .in_contract() - .not() - .then(|| self.env.host().snapshot_auth_manager().unwrap()); - { - if let Some(set_auths) = self.set_auths { - self.env.set_auths(set_auths); - } - if let Some(mock_auths) = self.mock_auths { - self.env.mock_auths(mock_auths); - } - if self.mock_all_auths { - if self.allow_non_root_auth { - self.env.mock_all_auths_allowing_non_root_auth(); - } else { - self.env.mock_all_auths(); - } - } +impl soroban_sdk::TryFromVal for UdtRecursive { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 2usize { + return Err(soroban_sdk::xdr::Error::Invalid); } - use soroban_sdk::{FromVal, IntoVal}; - let res = self.env.invoke_contract( - &self.address, - &{ - #[allow(deprecated)] - const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("add"); - SYMBOL + map.validate()?; + Ok(Self { + a: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "a".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? }, - ::soroban_sdk::Vec::from_array( - &self.env, - [a.into_val(&self.env), b.into_val(&self.env)], - ), - ); - if let Some(old_auth_manager) = old_auth_manager { - self.env.host().set_auth_manager(old_auth_manager).unwrap(); + b: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "b".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } +} +impl soroban_sdk::TryFromVal for UdtRecursive { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) } - res } - pub fn try_add( - &self, - a: &UdtEnum, - b: &UdtEnum, - ) -> Result< - Result>::Error>, - Result, - > { - use core::ops::Not; - let old_auth_manager = self - .env - .in_contract() - .not() - .then(|| self.env.host().snapshot_auth_manager().unwrap()); - { - if let Some(set_auths) = self.set_auths { - self.env.set_auths(set_auths); +} +impl TryFrom<&UdtRecursive> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UdtRecursive) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "a".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.a) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "b".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.b) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } +} +impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UdtRecursive) -> Result { + (&val).try_into() + } +} +impl TryFrom<&UdtRecursive> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UdtRecursive) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UdtRecursive) -> Result { + (&val).try_into() + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryUdtRecursive { + a: ::Prototype, + b: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUdtRecursive { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "ArbitraryUdtRecursive", + "a", + &self.a, + "b", + &&self.b, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUdtRecursive { + #[inline] + fn clone(&self) -> ArbitraryUdtRecursive { + ArbitraryUdtRecursive { + a: ::core::clone::Clone::clone(&self.a), + b: ::core::clone::Clone::clone(&self.b), } - if let Some(mock_auths) = self.mock_auths { - self.env.mock_auths(mock_auths); + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUdtRecursive { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUdtRecursive {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUdtRecursive { + #[inline] + fn eq(&self, other: &ArbitraryUdtRecursive) -> bool { + self.a == other.a && self.b == other.b + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUdtRecursive { + #[inline] + fn cmp(&self, other: &ArbitraryUdtRecursive) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.a, &other.a) { + ::core::cmp::Ordering::Equal => ::core::cmp::Ord::cmp(&self.b, &other.b), + cmp => cmp, } - if self.mock_all_auths { - if self.allow_non_root_auth { - self.env.mock_all_auths_allowing_non_root_auth(); + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUdtRecursive { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUdtRecursive, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.a, &other.a) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.b, &other.b) + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUdtRecursive: ::std::thread::LocalKey> = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUdtRecursive { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtRecursive.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUdtRecursive { + a: arbitrary::Arbitrary::arbitrary(u)?, + b: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtRecursive.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtRecursive.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUdtRecursive { + a: arbitrary::Arbitrary::arbitrary(&mut u)?, + b: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtRecursive.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UdtRecursive { + type Prototype = ArbitraryUdtRecursive; + } + impl soroban_sdk::TryFromVal for UdtRecursive { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUdtRecursive, + ) -> std::result::Result { + Ok(UdtRecursive { + a: soroban_sdk::IntoVal::into_val(&v.a, env), + b: soroban_sdk::IntoVal::into_val(&v.b, env), + }) + } + } +}; +pub struct RecursiveToEnum { + pub a: Symbol, + pub b: Map, +} +#[automatically_derived] +impl ::core::clone::Clone for RecursiveToEnum { + #[inline] + fn clone(&self) -> RecursiveToEnum { + RecursiveToEnum { + a: ::core::clone::Clone::clone(&self.a), + b: ::core::clone::Clone::clone(&self.b), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for RecursiveToEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "RecursiveToEnum", + "a", + &self.a, + "b", + &&self.b, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for RecursiveToEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for RecursiveToEnum {} +#[automatically_derived] +impl ::core::cmp::PartialEq for RecursiveToEnum { + #[inline] + fn eq(&self, other: &RecursiveToEnum) -> bool { + self.a == other.a && self.b == other.b + } +} +pub static __SPEC_XDR_TYPE_RECURSIVETOENUM: [u8; 96usize] = RecursiveToEnum::spec_xdr(); +impl RecursiveToEnum { + pub const fn spec_xdr() -> [u8; 96usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fRecursiveToEnum\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x11\0\0\0\0\0\0\0\x01b\0\0\0\0\0\x03\xec\0\0\0\x04\0\0\x07\xd0\0\0\0\rRecursiveEnum\0\0\0" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for RecursiveToEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"\xe1oU\xdb\xd47\x98\x14z\xb2+\xbb\xdf\xdbn\x14$\x92\xbb\xf1M\xf2\x10&P\x0c\xd1\x13J\x97Ci"; +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_RECURSIVETOENUM: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 2, + *b"\xe1oU\xdb\xd47\x98\x14z\xb2+\xbb\xdf\xdbn\x14$\x92\xbb\xf1M\xf2\x10&P\x0c\xd1\x13J\x97Ci", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::TryFromVal for RecursiveToEnum { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["a", "b"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + a: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + b: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &RecursiveToEnum, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["a", "b"]; + let vals: [Val; 2usize] = [ + (&val.a).try_into_val(env).map_err(|_| ConversionError)?, + (&val.b).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&RecursiveToEnum, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +impl soroban_sdk::TryFromVal for RecursiveToEnum { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 2usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + a: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "a".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + b: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "b".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } +} +impl soroban_sdk::TryFromVal for RecursiveToEnum { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryFrom<&RecursiveToEnum> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &RecursiveToEnum) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "a".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.a) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "b".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.b) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } +} +impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: RecursiveToEnum) -> Result { + (&val).try_into() + } +} +impl TryFrom<&RecursiveToEnum> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &RecursiveToEnum) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: RecursiveToEnum) -> Result { + (&val).try_into() + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryRecursiveToEnum { + a: ::Prototype, + b: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryRecursiveToEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "ArbitraryRecursiveToEnum", + "a", + &self.a, + "b", + &&self.b, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryRecursiveToEnum { + #[inline] + fn clone(&self) -> ArbitraryRecursiveToEnum { + ArbitraryRecursiveToEnum { + a: ::core::clone::Clone::clone(&self.a), + b: ::core::clone::Clone::clone(&self.b), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryRecursiveToEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryRecursiveToEnum {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryRecursiveToEnum { + #[inline] + fn eq(&self, other: &ArbitraryRecursiveToEnum) -> bool { + self.a == other.a && self.b == other.b + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryRecursiveToEnum { + #[inline] + fn cmp(&self, other: &ArbitraryRecursiveToEnum) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.a, &other.a) { + ::core::cmp::Ordering::Equal => ::core::cmp::Ord::cmp(&self.b, &other.b), + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryRecursiveToEnum { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryRecursiveToEnum, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.a, &other.a) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.b, &other.b) + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryRecursiveToEnum: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryRecursiveToEnum { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryRecursiveToEnum.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryRecursiveToEnum { + a: arbitrary::Arbitrary::arbitrary(u)?, + b: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryRecursiveToEnum.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryRecursiveToEnum.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryRecursiveToEnum { + a: arbitrary::Arbitrary::arbitrary(&mut u)?, + b: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryRecursiveToEnum.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for RecursiveToEnum { + type Prototype = ArbitraryRecursiveToEnum; + } + impl soroban_sdk::TryFromVal for RecursiveToEnum { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryRecursiveToEnum, + ) -> std::result::Result { + Ok(RecursiveToEnum { + a: soroban_sdk::IntoVal::into_val(&v.a, env), + b: soroban_sdk::IntoVal::into_val(&v.b, env), + }) + } + } +}; +pub enum RecursiveEnum { + NotRecursive, + Recursive(RecursiveToEnum), +} +#[automatically_derived] +impl ::core::clone::Clone for RecursiveEnum { + #[inline] + fn clone(&self) -> RecursiveEnum { + match self { + RecursiveEnum::NotRecursive => RecursiveEnum::NotRecursive, + RecursiveEnum::Recursive(__self_0) => { + RecursiveEnum::Recursive(::core::clone::Clone::clone(__self_0)) + } + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for RecursiveEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + RecursiveEnum::NotRecursive => ::core::fmt::Formatter::write_str(f, "NotRecursive"), + RecursiveEnum::Recursive(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Recursive", &__self_0) + } + } + } +} +#[automatically_derived] +impl ::core::cmp::Eq for RecursiveEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for RecursiveEnum {} +#[automatically_derived] +impl ::core::cmp::PartialEq for RecursiveEnum { + #[inline] + fn eq(&self, other: &RecursiveEnum) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + (RecursiveEnum::Recursive(__self_0), RecursiveEnum::Recursive(__arg1_0)) => { + __self_0 == __arg1_0 + } + _ => true, + } + } +} +pub static __SPEC_XDR_TYPE_RECURSIVEENUM: [u8; 112usize] = RecursiveEnum::spec_xdr(); +impl RecursiveEnum { + pub const fn spec_xdr() -> [u8; 112usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\rRecursiveEnum\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x0cNotRecursive\0\0\0\x01\0\0\0\0\0\0\0\tRecursive\0\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x0fRecursiveToEnum\0" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for RecursiveEnum { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xff{V \xab\r\xdcd\xe7~\x19\x83<\xc27t\xc6\x9d=\x9f\x8f\x12\x0e\x18>%\x08\x89.&\0M"; +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_RECURSIVEENUM: [u8; 74usize] = + soroban_sdk::spec_shaking::encode_graph_record::<74usize, 1usize>( + 2, + *b"\xff{V \xab\r\xdcd\xe7~\x19\x83<\xc27t\xc6\x9d=\x9f\x8f\x12\x0e\x18>%\x08\x89.&\0M", + [::SPEC_TYPE_ID], + ); +impl soroban_sdk::TryFromVal for RecursiveEnum { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["NotRecursive", "Recursive"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) as usize + { + 0 => { + if iter.len() > 0 { + return Err(soroban_sdk::ConversionError); + } + Self::NotRecursive + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Recursive( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &RecursiveEnum, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + RecursiveEnum::NotRecursive => { + let tup: (soroban_sdk::Val,) = + (soroban_sdk::Symbol::try_from_val(env, &"NotRecursive")?.to_val(),); + tup.try_into_val(env).map_err(Into::into) + } + RecursiveEnum::Recursive(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Recursive")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&RecursiveEnum, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +impl soroban_sdk::TryFromVal for RecursiveEnum { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "NotRecursive" => { + if iter.len() > 0 { + return Err(soroban_sdk::xdr::Error::Invalid); + } + Self::NotRecursive + } + "Recursive" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::Recursive( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } +} +impl soroban_sdk::TryFromVal for RecursiveEnum { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryFrom<&RecursiveEnum> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &RecursiveEnum) -> Result { + extern crate alloc; + Ok(match val { + RecursiveEnum::NotRecursive => { + let symbol = soroban_sdk::xdr::ScSymbol( + "NotRecursive" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ); + let val = soroban_sdk::xdr::ScVal::Symbol(symbol); + (val,) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + } + RecursiveEnum::Recursive(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Recursive" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }) + } +} +impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: RecursiveEnum) -> Result { + (&val).try_into() + } +} +impl TryFrom<&RecursiveEnum> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &RecursiveEnum) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: RecursiveEnum) -> Result { + (&val).try_into() + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryRecursiveEnum { + NotRecursive, + Recursive( + ::Prototype, + ), + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryRecursiveEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryRecursiveEnum::NotRecursive => { + ::core::fmt::Formatter::write_str(f, "NotRecursive") + } + ArbitraryRecursiveEnum::Recursive(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Recursive", &__self_0) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryRecursiveEnum { + #[inline] + fn clone(&self) -> ArbitraryRecursiveEnum { + match self { + ArbitraryRecursiveEnum::NotRecursive => ArbitraryRecursiveEnum::NotRecursive, + ArbitraryRecursiveEnum::Recursive(__self_0) => { + ArbitraryRecursiveEnum::Recursive(::core::clone::Clone::clone(__self_0)) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryRecursiveEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryRecursiveEnum {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryRecursiveEnum { + #[inline] + fn eq(&self, other: &ArbitraryRecursiveEnum) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + ArbitraryRecursiveEnum::Recursive(__self_0), + ArbitraryRecursiveEnum::Recursive(__arg1_0), + ) => __self_0 == __arg1_0, + _ => true, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryRecursiveEnum { + #[inline] + fn cmp(&self, other: &ArbitraryRecursiveEnum) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + ArbitraryRecursiveEnum::Recursive(__self_0), + ArbitraryRecursiveEnum::Recursive(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => ::core::cmp::Ordering::Equal, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryRecursiveEnum { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryRecursiveEnum, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + ArbitraryRecursiveEnum::Recursive(__self_0), + ArbitraryRecursiveEnum::Recursive(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryRecursiveEnum: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryRecursiveEnum { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryRecursiveEnum.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) * 2u64) >> 32 + { + 0u64 => ArbitraryRecursiveEnum::NotRecursive, + 1u64 => ArbitraryRecursiveEnum::Recursive( + arbitrary::Arbitrary::arbitrary(u)?, + ), + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryRecursiveEnum.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryRecursiveEnum.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) * 2u64) + >> 32 + { + 0u64 => ArbitraryRecursiveEnum::NotRecursive, + 1u64 => ArbitraryRecursiveEnum::Recursive( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + _ => { + ::core::panicking::panic("internal error: entered unreachable code") + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryRecursiveEnum.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all(&[]), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for RecursiveEnum { + type Prototype = ArbitraryRecursiveEnum; + } + impl soroban_sdk::TryFromVal for RecursiveEnum { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryRecursiveEnum, + ) -> std::result::Result { + Ok(match v { + ArbitraryRecursiveEnum::NotRecursive => RecursiveEnum::NotRecursive, + ArbitraryRecursiveEnum::Recursive(field_0) => { + RecursiveEnum::Recursive(soroban_sdk::IntoVal::into_val(field_0, env)) + } + }) + } + } +}; +pub struct Contract; +///ContractArgs is a type for building arg lists for functions defined in "Contract". +pub struct ContractArgs; +///ContractClient is a client for calling the contract defined in "Contract". +pub struct ContractClient<'a> { + pub env: soroban_sdk::Env, + pub address: soroban_sdk::Address, + #[doc(hidden)] + set_auths: Option<&'a [soroban_sdk::xdr::SorobanAuthorizationEntry]>, + #[doc(hidden)] + mock_auths: Option<&'a [soroban_sdk::testutils::MockAuth<'a>]>, + #[doc(hidden)] + mock_all_auths: bool, + #[doc(hidden)] + allow_non_root_auth: bool, +} +impl<'a> ContractClient<'a> { + pub fn new(env: &soroban_sdk::Env, address: &soroban_sdk::Address) -> Self { + Self { + env: env.clone(), + address: address.clone(), + set_auths: None, + mock_auths: None, + mock_all_auths: false, + allow_non_root_auth: false, + } + } + /// Set authorizations in the environment which will be consumed by + /// contracts when they invoke `Address::require_auth` or + /// `Address::require_auth_for_args` functions. + /// + /// Requires valid signatures for the authorization to be successful. + /// To mock auth without requiring valid signatures, use `mock_auths`. + /// + /// See `soroban_sdk::Env::set_auths` for more details and examples. + pub fn set_auths(&self, auths: &'a [soroban_sdk::xdr::SorobanAuthorizationEntry]) -> Self { + Self { + env: self.env.clone(), + address: self.address.clone(), + set_auths: Some(auths), + mock_auths: self.mock_auths.clone(), + mock_all_auths: false, + allow_non_root_auth: false, + } + } + /// Mock authorizations in the environment which will cause matching invokes + /// of `Address::require_auth` and `Address::require_auth_for_args` to + /// pass. + /// + /// See `soroban_sdk::Env::set_auths` for more details and examples. + pub fn mock_auths(&self, mock_auths: &'a [soroban_sdk::testutils::MockAuth<'a>]) -> Self { + Self { + env: self.env.clone(), + address: self.address.clone(), + set_auths: self.set_auths.clone(), + mock_auths: Some(mock_auths), + mock_all_auths: false, + allow_non_root_auth: false, + } + } + /// Mock all calls to the `Address::require_auth` and + /// `Address::require_auth_for_args` functions in invoked contracts, + /// having them succeed as if authorization was provided. + /// + /// See `soroban_sdk::Env::mock_all_auths` for more details and + /// examples. + pub fn mock_all_auths(&self) -> Self { + Self { + env: self.env.clone(), + address: self.address.clone(), + set_auths: None, + mock_auths: None, + mock_all_auths: true, + allow_non_root_auth: false, + } + } + /// A version of `mock_all_auths` that allows authorizations that + /// are not present in the root invocation. + /// + /// Refer to `mock_all_auths` documentation for details and + /// prefer using `mock_all_auths` unless non-root authorization is + /// required. + /// + /// See `soroban_sdk::Env::mock_all_auths_allowing_non_root_auth` + /// for more details and examples. + pub fn mock_all_auths_allowing_non_root_auth(&self) -> Self { + Self { + env: self.env.clone(), + address: self.address.clone(), + set_auths: None, + mock_auths: None, + mock_all_auths: true, + allow_non_root_auth: true, + } + } +} +mod __contract_fn_set_registry { + use super::*; + extern crate std; + use std::collections::BTreeMap; + use std::sync::Mutex; + pub type F = soroban_sdk::testutils::ContractFunctionF; + static FUNCS: Mutex> = Mutex::new(BTreeMap::new()); + pub fn register(name: &'static str, func: &'static F) { + FUNCS.lock().unwrap().insert(name, func); + } + pub fn call( + name: &str, + env: soroban_sdk::Env, + args: &[soroban_sdk::Val], + ) -> Option { + let fopt: Option<&'static F> = FUNCS.lock().unwrap().get(name).map(|f| f.clone()); + fopt.map(|f| f(env, args)) + } +} +impl soroban_sdk::testutils::ContractFunctionRegister for Contract { + fn register(name: &'static str, func: &'static __contract_fn_set_registry::F) { + __contract_fn_set_registry::register(name, func); + } +} +#[doc(hidden)] +impl soroban_sdk::testutils::ContractFunctionSet for Contract { + fn call( + &self, + func: &str, + env: soroban_sdk::Env, + args: &[soroban_sdk::Val], + ) -> Option { + __contract_fn_set_registry::call(func, env, args) + } +} +impl Contract { + pub fn add(a: UdtEnum, b: UdtEnum) -> i64 { + let a = match a { + UdtEnum::UdtA => 0, + UdtEnum::UdtB(udt) => udt.a + udt.b, + UdtEnum::UdtC(val) => val as i64, + UdtEnum::UdtD(tup) => tup.0 + tup.1.try_iter().fold(0i64, |sum, i| sum + i.unwrap()), + }; + let b = match b { + UdtEnum::UdtA => 0, + UdtEnum::UdtB(udt) => udt.a + udt.b, + UdtEnum::UdtC(val) => val as i64, + UdtEnum::UdtD(tup) => tup.0 + tup.1.try_iter().fold(0i64, |sum, i| sum + i.unwrap()), + }; + a + b + } + pub fn recursive(a: UdtRecursive) -> Option { + if a.b.is_empty() { + None + } else { + Some(a.b.first_unchecked()) + } + } + pub fn recursive_enum(a: RecursiveEnum, key: u32) -> Result, Error> { + match a { + RecursiveEnum::NotRecursive => Ok(None), + RecursiveEnum::Recursive(router) => Ok(router.b.get(key)), + } + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__add__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN_ADD: [u8; 84usize] = super::Contract::spec_xdr_add(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_add() -> [u8; 84usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x03add\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\x07\xd0\0\0\0\x07UdtEnum\0\0\0\0\0\0\0\0\x01b\0\0\0\0\0\x07\xd0\0\0\0\x07UdtEnum\0\0\0\0\x01\0\0\0\x07" + } +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_ADD: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"\xeb\xb9m\xe34\x1d[[\xe4K\xe7\xe3\xf4.\x99\x9b\xf2\x1a\xe15\xa1D+\xa8\x1b\x1cV\n\xed\xc1\xa4\x89", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__recursive__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN_RECURSIVE: [u8; 88usize] = super::Contract::spec_xdr_recursive(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_recursive() -> [u8; 88usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\trecursive\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01a\0\0\0\0\0\x07\xd0\0\0\0\x0cUdtRecursive\0\0\0\x01\0\0\x03\xe8\0\0\x07\xd0\0\0\0\x0cUdtRecursive" + } +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_RECURSIVE: [u8; 106usize] = + soroban_sdk::spec_shaking::encode_graph_record::<106usize, 2usize>( + 0, + *b"(`\x83Z;\x970\xd8\xdaZp\xcf\x9e\xbf\x82\x86|0\xb6\x90\x10Mf\x13\xcf\xd76\x0cDn\xdb\xb2", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__recursive_enum__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN_RECURSIVE_ENUM: [u8; 124usize] = + super::Contract::spec_xdr_recursive_enum(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_recursive_enum() -> [u8; 124usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0erecursive_enum\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\x07\xd0\0\0\0\rRecursiveEnum\0\0\0\0\0\0\0\0\0\0\x03key\0\0\0\0\x04\0\0\0\x01\0\0\x03\xe9\0\0\x03\xe8\0\0\x07\xd0\0\0\0\rRecursiveEnum\0\0\0\0\0\0\x03" + } +} +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_RECURSIVE_ENUM: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"\x84H!\x0e\xfc\xdbM6\x02\xaaN\xe4\xee\x99J\x08\x94\x08\xa9\xc0D\x88Ci\xc9\x07~\xb9\xa6\xc5\xec\xaa", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); +impl<'a> ContractClient<'a> { + pub fn add(&self, a: &UdtEnum, b: &UdtEnum) -> i64 { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("add"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array( + &self.env, + [a.into_val(&self.env), b.into_val(&self.env)], + ), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn try_add( + &self, + a: &UdtEnum, + b: &UdtEnum, + ) -> Result< + Result>::Error>, + Result, + > { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("add"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array( + &self.env, + [a.into_val(&self.env), b.into_val(&self.env)], + ), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn recursive(&self, a: &UdtRecursive) -> Option { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("recursive"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array(&self.env, [a.into_val(&self.env)]), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn try_recursive( + &self, + a: &UdtRecursive, + ) -> Result< + Result< + Option, + as soroban_sdk::TryFromVal>::Error, + >, + Result, + >{ + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("recursive"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array(&self.env, [a.into_val(&self.env)]), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn recursive_enum(&self, a: &RecursiveEnum, key: &u32) -> Option { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "recursive_enum") }, + ::soroban_sdk::Vec::from_array( + &self.env, + [a.into_val(&self.env), key.into_val(&self.env)], + ), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn try_recursive_enum( + &self, + a: &RecursiveEnum, + key: &u32, + ) -> Result< + Result< + Option, + as soroban_sdk::TryFromVal< + soroban_sdk::Env, + soroban_sdk::Val, + >>::Error, + >, + Result, + > { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "recursive_enum") }, + ::soroban_sdk::Vec::from_array( + &self.env, + [a.into_val(&self.env), key.into_val(&self.env)], + ), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } +} +impl ContractArgs { + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn add<'i>(a: &'i UdtEnum, b: &'i UdtEnum) -> (&'i UdtEnum, &'i UdtEnum) { + (a, b) + } + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn recursive<'i>(a: &'i UdtRecursive) -> (&'i UdtRecursive,) { + (a,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn recursive_enum<'i>(a: &'i RecursiveEnum, key: &'i u32) -> (&'i RecursiveEnum, &'i u32) { + (a, key) + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).add` instead")] +#[allow(deprecated)] +pub fn __Contract__add__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::add( + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_1), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).add` instead")] +pub fn __Contract__add__invoke_raw_slice( + env: soroban_sdk::Env, + args: &[soroban_sdk::Val], +) -> soroban_sdk::Val { + if args.len() != 2usize { + { + ::core::panicking::panic_fmt(format_args!( + "invalid number of input arguments: {0} expected, got {1}", + 2usize, + args.len(), + )); + }; + } + #[allow(deprecated)] + __Contract__add__invoke_raw(env, args[0usize], args[1usize]) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).add` instead")] +pub extern "C" fn __Contract__add__invoke_raw_extern( + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__add__invoke_raw(soroban_sdk::Env::default(), arg_0, arg_1) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).recursive` instead")] +#[allow(deprecated)] +pub fn __Contract__recursive__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::recursive( + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).recursive` instead")] +pub fn __Contract__recursive__invoke_raw_slice( + env: soroban_sdk::Env, + args: &[soroban_sdk::Val], +) -> soroban_sdk::Val { + if args.len() != 1usize { + { + ::core::panicking::panic_fmt(format_args!( + "invalid number of input arguments: {0} expected, got {1}", + 1usize, + args.len(), + )); + }; + } + #[allow(deprecated)] + __Contract__recursive__invoke_raw(env, args[0usize]) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).recursive` instead")] +pub extern "C" fn __Contract__recursive__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__recursive__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).recursive_enum` instead")] +#[allow(deprecated)] +pub fn __Contract__recursive_enum__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::recursive_enum( + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_1), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).recursive_enum` instead")] +pub fn __Contract__recursive_enum__invoke_raw_slice( + env: soroban_sdk::Env, + args: &[soroban_sdk::Val], +) -> soroban_sdk::Val { + if args.len() != 2usize { + { + ::core::panicking::panic_fmt(format_args!( + "invalid number of input arguments: {0} expected, got {1}", + 2usize, + args.len(), + )); + }; + } + #[allow(deprecated)] + __Contract__recursive_enum__invoke_raw(env, args[0usize], args[1usize]) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).recursive_enum` instead")] +pub extern "C" fn __Contract__recursive_enum__invoke_raw_extern( + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__recursive_enum__invoke_raw(soroban_sdk::Env::default(), arg_0, arg_1) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[allow(unused)] +fn __Contract____ca538446cb58e8272191ab7091913766c05361045f91847da7c92c7de8846af4_ctor() { + #[allow(unsafe_code)] + { + #[link_section = ".init_array"] + #[used] + #[allow(non_upper_case_globals, non_snake_case)] + #[doc(hidden)] + static f: extern "C" fn() -> ::ctor::__support::CtorRetType = { + #[link_section = ".text.startup"] + #[allow(non_snake_case)] + extern "C" fn f() -> ::ctor::__support::CtorRetType { + unsafe { + __Contract____ca538446cb58e8272191ab7091913766c05361045f91847da7c92c7de8846af4_ctor(); + }; + core::default::Default::default() + } + f + }; + } + { + ::register( + "add", + #[allow(deprecated)] + &__Contract__add__invoke_raw_slice, + ); + ::register( + "recursive", + #[allow(deprecated)] + &__Contract__recursive__invoke_raw_slice, + ); + ::register( + "recursive_enum", + #[allow(deprecated)] + &__Contract__recursive_enum__invoke_raw_slice, + ); + } +} +mod test { + use super::*; + use soroban_sdk::{symbol_short, vec, xdr::ScVal, Bytes, Env, TryFromVal}; + extern crate test; + #[rustc_test_marker = "test::test_serializing"] + #[doc(hidden)] + pub const test_serializing: test::TestDescAndFn = test::TestDescAndFn { + desc: test::TestDesc { + name: test::StaticTestName("test::test_serializing"), + ignore: false, + ignore_message: ::core::option::Option::None, + source_file: "tests/udt/src/lib.rs", + start_line: 96usize, + start_col: 8usize, + end_line: 96usize, + end_col: 24usize, + compile_fail: false, + no_run: false, + should_panic: test::ShouldPanic::No, + test_type: test::TestType::UnitTest, + }, + testfn: test::StaticTestFn( + #[coverage(off)] + || test::assert_test_result(test_serializing()), + ), + }; + fn test_serializing() { + use soroban_sdk::xdr::ToXdr; + let e = Env::default(); + let udt = UdtStruct { + a: 10, + b: 12, + c: ::soroban_sdk::Vec::from_array(&e, [1]), + }; + let bin = udt.to_xdr(&e); + let expected_bytes = [ + 0u8, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 15, 0, 0, 0, 1, 97, 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 15, 0, 0, 0, 1, 98, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 12, 0, 0, 0, 15, 0, 0, 0, 1, 99, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 1, 0, 0, 0, + 1, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 1, + ]; + let expected_bytes = Bytes::from_array(&e, &expected_bytes); + match (&bin, &expected_bytes) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::None, + ); + } + } + }; + } + extern crate test; + #[rustc_test_marker = "test::test_add"] + #[doc(hidden)] + pub const test_add: test::TestDescAndFn = test::TestDescAndFn { + desc: test::TestDesc { + name: test::StaticTestName("test::test_add"), + ignore: false, + ignore_message: ::core::option::Option::None, + source_file: "tests/udt/src/lib.rs", + start_line: 116usize, + start_col: 8usize, + end_line: 116usize, + end_col: 16usize, + compile_fail: false, + no_run: false, + should_panic: test::ShouldPanic::No, + test_type: test::TestType::UnitTest, + }, + testfn: test::StaticTestFn( + #[coverage(off)] + || test::assert_test_result(test_add()), + ), + }; + fn test_add() { + let e = Env::default(); + let contract_id = e.register(Contract, ()); + let client = ContractClient::new(&e, &contract_id); + let udt = UdtStruct { + a: 10, + b: 12, + c: ::soroban_sdk::Vec::from_array(&e, [1]), + }; + let z = client.add(&UdtEnum::UdtA, &UdtEnum::UdtB(udt)); + match (&z, &22) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::None, + ); + } + } + }; + let udt1 = UdtEnum2::A; + let udt2 = UdtTuple(1, ::soroban_sdk::Vec::from_array(&e, [2, 3])); + let z = client.add(&UdtEnum::UdtC(udt1), &UdtEnum::UdtD(udt2)); + match (&z, &16) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::None, + ); + } + } + }; + } + extern crate test; + #[rustc_test_marker = "test::test_scval_accessibility_from_udt_types"] + #[doc(hidden)] + pub const test_scval_accessibility_from_udt_types: test::TestDescAndFn = test::TestDescAndFn { + desc: test::TestDesc { + name: test::StaticTestName("test::test_scval_accessibility_from_udt_types"), + ignore: false, + ignore_message: ::core::option::Option::None, + source_file: "tests/udt/src/lib.rs", + start_line: 136usize, + start_col: 8usize, + end_line: 136usize, + end_col: 47usize, + compile_fail: false, + no_run: false, + should_panic: test::ShouldPanic::No, + test_type: test::TestType::UnitTest, + }, + testfn: test::StaticTestFn( + #[coverage(off)] + || test::assert_test_result(test_scval_accessibility_from_udt_types()), + ), + }; + fn test_scval_accessibility_from_udt_types() { + let e = Env::default(); + let udt = UdtStruct { + a: 10, + b: 12, + c: ::soroban_sdk::Vec::from_array(&e, [1]), + }; + let val: ScVal = udt.clone().try_into().unwrap(); + let roundtrip = UdtStruct::try_from_val(&e, &val).unwrap(); + match (&udt, &roundtrip) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::None, + ); + } + } + }; + } + extern crate test; + #[rustc_test_marker = "test::test_recursive"] + #[doc(hidden)] + pub const test_recursive: test::TestDescAndFn = test::TestDescAndFn { + desc: test::TestDesc { + name: test::StaticTestName("test::test_recursive"), + ignore: false, + ignore_message: ::core::option::Option::None, + source_file: "tests/udt/src/lib.rs", + start_line: 149usize, + start_col: 8usize, + end_line: 149usize, + end_col: 22usize, + compile_fail: false, + no_run: false, + should_panic: test::ShouldPanic::No, + test_type: test::TestType::UnitTest, + }, + testfn: test::StaticTestFn( + #[coverage(off)] + || test::assert_test_result(test_recursive()), + ), + }; + fn test_recursive() { + let e = Env::default(); + let contract_id = e.register(Contract, ()); + let client = ContractClient::new(&e, &contract_id); + let recursive_udt_0 = UdtRecursive { + a: { + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("0"); + SYMBOL + }, + b: ::soroban_sdk::Vec::new(&e), + }; + let recursive_udt_1 = UdtRecursive { + a: { + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("1"); + SYMBOL + }, + b: ::soroban_sdk::Vec::from_array(&e, [recursive_udt_0.clone()]), + }; + let recursive_udt_2 = UdtRecursive { + a: { + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("2"); + SYMBOL + }, + b: ::soroban_sdk::Vec::from_array(&e, [recursive_udt_1.clone()]), + }; + let result_0 = client.recursive(&recursive_udt_2); + match (&result_0, &Some(recursive_udt_1)) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::None, + ); + } + } + }; + let result_1 = client.recursive(&result_0.unwrap()); + match (&result_1, &Some(recursive_udt_0)) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::None, + ); + } + } + }; + let result_2 = client.recursive(&result_1.unwrap()); + match (&result_2, &None) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::None, + ); + } + } + }; + } + extern crate test; + #[rustc_test_marker = "test::test_recursive_enum"] + #[doc(hidden)] + pub const test_recursive_enum: test::TestDescAndFn = test::TestDescAndFn { + desc: test::TestDesc { + name: test::StaticTestName("test::test_recursive_enum"), + ignore: false, + ignore_message: ::core::option::Option::None, + source_file: "tests/udt/src/lib.rs", + start_line: 178usize, + start_col: 8usize, + end_line: 178usize, + end_col: 27usize, + compile_fail: false, + no_run: false, + should_panic: test::ShouldPanic::No, + test_type: test::TestType::UnitTest, + }, + testfn: test::StaticTestFn( + #[coverage(off)] + || test::assert_test_result(test_recursive_enum()), + ), + }; + fn test_recursive_enum() { + let e = Env::default(); + let contract_id = e.register(Contract, ()); + let client = ContractClient::new(&e, &contract_id); + let entry = RecursiveEnum::Recursive(RecursiveToEnum { + a: { + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("test"); + SYMBOL + }, + b: Map::from_array(&e, [(42u32, RecursiveEnum::NotRecursive)]), + }); + let result = client.recursive_enum(&entry, &42); + match (&result, &Some(RecursiveEnum::NotRecursive)) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::None, + ); + } + } + }; + let none_result = client.recursive_enum(&entry, &43); + match (&none_result, &None) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::None, + ); + } + } + }; + } +} +mod test_with_wasm { + use soroban_sdk::{symbol_short, vec, Env, Map}; + mod contract { + pub const WASM: &[u8] = b"\x00asm\x01\x00\x00\x00\x01N\r`\x01~\x01~`\x03~~~\x01~`\x02~~\x01~`\x04~~~~\x01~`\x02\x7f~\x00`\x02\x7f\x7f\x00`\x03~\x7f\x7f\x01~`\x02\x7f\x7f\x01\x7f`\x05~\x7f\x7f\x7f\x7f\x00`\x00\x00`\x01\x7f\x01~`\x03\x7f\x7f\x7f\x00`\x02\x7f\x7f\x01~\x02O\r\x01v\x013\x00\x00\x01v\x01h\x00\x01\x01i\x012\x00\x00\x01v\x011\x00\x02\x01i\x011\x00\x00\x01v\x018\x00\x00\x01m\x014\x00\x02\x01m\x011\x00\x02\x01v\x01g\x00\x02\x01b\x01j\x00\x02\x01m\x019\x00\x01\x01m\x01a\x00\x03\x01b\x01m\x00\x01\x03\x12\x11\x04\x05\x06\x07\x08\x04\x04\x04\x05\x02\t\x00\n\x02\x0b\x0c\t\x05\x03\x01\x00\x11\x06!\x04\x7f\x01A\x80\x80\xc0\x00\x0b\x7f\x00A\x84\x81\xc0\x00\x0b\x7f\x00A\x84\x81\xc0\x00\x0b\x7f\x00A\x90\x81\xc0\x00\x0b\x07L\x07\x06memory\x02\x00\x03add\x00\x16\trecursive\x00\x18\x0erecursive_enum\x00\x1a\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n\xaa\x1a\x11\xb6\x06\x04\x01\x7f\x01~\x02\x7f\x01~#\x80\x80\x80\x80\x00A\xc0\x00k\"\x02$\x80\x80\x80\x80\x00\x02@\x02@ \x01B\xff\x01\x83B\xcb\x00Q\r\x00 \x00A\x04:\x00\x00\x0c\x01\x0b \x01\x10\x80\x80\x80\x80\x00!\x03 \x02A\x006\x02\x10 \x02 \x017\x03\x08 \x02 \x03B \x88>\x02\x14 \x02A\x18j \x02A\x08j\x10\x8e\x80\x80\x80\x00\x02@\x02@\x02@\x02@ \x02)\x03\x18\"\x01B\x02Q\r\x00 \x01\xa7A\x01q\r\x00\x02@ \x02)\x03 \"\x01\xa7A\xff\x01q\"\x04A\xca\x00F\r\x00 \x04A\x0eG\r\x01\x0b\x02@\x02@\x02@\x02@ \x01A\x90\x80\xc0\x80\x00A\x04\x10\x8f\x80\x80\x80\x00B \x88\xa7\x0e\x04\x00\x01\x02\x03\x05\x0b \x02(\x02\x10 \x02(\x02\x14\x10\x90\x80\x80\x80\x00\r\x04A\x00!\x05\x0c\x05\x0b \x02(\x02\x10 \x02(\x02\x14\x10\x90\x80\x80\x80\x00A\x01K\r\x03 \x02A\x18j \x02A\x08j\x10\x8e\x80\x80\x80\x00 \x02)\x03\x18\"\x01B\x02Q\r\x03 \x01\xa7A\x01q\r\x03 \x02)\x03 !\x01A\x00!\x04\x02@\x03@ \x04A\x18F\r\x01 \x02A\x18j \x04jB\x027\x03\x00 \x04A\x08j!\x04\x0c\x00\x0b\x0b \x01B\xff\x01\x83B\xcc\x00R\r\x03 \x01A\xb4\x80\xc0\x80\x00A\x03 \x02A\x18jA\x03\x10\x91\x80\x80\x80\x00 \x02A0j \x02)\x03\x18\x10\x92\x80\x80\x80\x00 \x02(\x020\r\x03 \x02)\x038!\x03 \x02A0j \x02)\x03 \x10\x92\x80\x80\x80\x00 \x02(\x020\r\x03 \x02)\x03(\"\x06B\xff\x01\x83B\xcb\x00R\r\x03 \x02)\x038!\x01A\x01!\x05\x0c\x04\x0b \x02(\x02\x10 \x02(\x02\x14\x10\x90\x80\x80\x80\x00A\x01K\r\x02 \x02A\x18j \x02A\x08j\x10\x8e\x80\x80\x80\x00 \x02)\x03\x18\"\x01B\x02Q\r\x02 \x01\xa7A\x01q\r\x02 \x02)\x03 \"\x01B\xff\x01\x83B\x04R\r\x02A\nA\x0fA\t \x01B \x88\xa7\"\x04A\x0fF\x1b \x04A\nF\x1b\"\x04A\tF\r\x02A\x02!\x05\x0c\x04\x0b \x02(\x02\x10 \x02(\x02\x14\x10\x90\x80\x80\x80\x00A\x01K\r\x01 \x02A\x18j \x02A\x08j\x10\x8e\x80\x80\x80\x00 \x02)\x03\x18\"\x01B\x02Q\r\x01 \x01\xa7A\x01q\r\x01 \x02)\x03 \"\x01B\xff\x01\x83B\xcb\x00R\r\x01A\x00!\x04\x02@\x03@ \x04A\x10F\r\x01 \x02A0j \x04jB\x027\x03\x00 \x04A\x08j!\x04\x0c\x00\x0b\x0b \x01 \x02A0j\xadB \x86B\x04\x84B\x84\x80\x80\x80 \x10\x81\x80\x80\x80\x00\x1a \x02A\x18j \x02)\x030\x10\x92\x80\x80\x80\x00 \x02(\x02\x18A\x01F\r\x01 \x02)\x038\"\x01B\xff\x01\x83B\xcb\x00R\r\x01 \x02)\x03 !\x03A\x03!\x05\x0c\x02\x0b \x00A\x04:\x00\x00\x0c\x03\x0b \x00A\x04:\x00\x00\x0c\x02\x0b\x0b \x00 \x067\x03\x18 \x00 \x017\x03\x10 \x00 \x037\x03\x08 \x00 \x04:\x00\x01 \x00 \x05:\x00\x00\x0b \x02A\xc0\x00j$\x80\x80\x80\x80\x00\x0bJ\x02\x01~\x01\x7fB\x02!\x02\x02@ \x01(\x02\x08\"\x03 \x01(\x02\x0cO\r\x00 \x00 \x01)\x03\x00 \x03\xadB \x86B\x04\x84\x10\x83\x80\x80\x80\x007\x03\x08 \x01 \x03A\x01j6\x02\x08B\x00!\x02\x0b \x00 \x027\x03\x00\x0b\x1c\x00 \x00 \x01\xadB \x86B\x04\x84 \x02\xadB \x86B\x04\x84\x10\x8c\x80\x80\x80\x00\x0b\x19\x00\x02@ \x01 \x00I\r\x00 \x01 \x00k\x0f\x0b\x10\x97\x80\x80\x80\x00\x00\x0b1\x00\x02@ \x02 \x04F\r\x00\x00\x0b \x00 \x01\xadB \x86B\x04\x84 \x03\xadB \x86B\x04\x84 \x02\xadB \x86B\x04\x84\x10\x8b\x80\x80\x80\x00\x1a\x0b]\x02\x01\x7f\x01~\x02@\x02@ \x01\xa7A\xff\x01q\"\x02A\xc1\x00F\r\x00\x02@ \x02A\x07F\r\x00B\x01!\x03B\x83\x90\x80\x80\x80\x01!\x01\x0c\x02\x0b \x01B\x08\x87!\x01B\x00!\x03\x0c\x01\x0bB\x00!\x03 \x01\x10\x82\x80\x80\x80\x00!\x01\x0b \x00 \x037\x03\x00 \x00 \x017\x03\x08\x0b\xb5\x01\x02\x02\x7f\x02~#\x80\x80\x80\x80\x00A\x10k\"\x02$\x80\x80\x80\x80\x00A\x00!\x03\x02@\x03@ \x03A\x10F\r\x01 \x02 \x03jB\x027\x03\x00 \x03A\x08j!\x03\x0c\x00\x0b\x0bB\x01!\x04\x02@ \x01B\xff\x01\x83B\xcc\x00R\r\x00 \x01A\xcc\x80\xc0\x80\x00A\x02 \x02A\x02\x10\x91\x80\x80\x80\x00\x02@ \x02)\x03\x00\"\x01\xa7A\xff\x01q\"\x03A\xca\x00F\r\x00 \x03A\x0eG\r\x01\x0b \x02)\x03\x08\"\x05B\xff\x01\x83B\xcb\x00R\r\x00 \x00 \x057\x03\x10 \x00 \x017\x03\x08B\x00!\x04\x0b \x00 \x047\x03\x00 \x02A\x10j$\x80\x80\x80\x80\x00\x0b\xb5\x01\x02\x02\x7f\x02~#\x80\x80\x80\x80\x00A\x10k\"\x02$\x80\x80\x80\x80\x00A\x00!\x03\x02@\x03@ \x03A\x10F\r\x01 \x02 \x03jB\x027\x03\x00 \x03A\x08j!\x03\x0c\x00\x0b\x0bB\x01!\x04\x02@ \x01B\xff\x01\x83B\xcc\x00R\r\x00 \x01A\xcc\x80\xc0\x80\x00A\x02 \x02A\x02\x10\x91\x80\x80\x80\x00\x02@ \x02)\x03\x00\"\x01\xa7A\xff\x01q\"\x03A\xca\x00F\r\x00 \x03A\x0eG\r\x01\x0b \x02)\x03\x08\"\x05B\xff\x01\x83B\xcc\x00R\r\x00 \x00 \x057\x03\x10 \x00 \x017\x03\x08B\x00!\x04\x0b \x00 \x047\x03\x00 \x02A\x10j$\x80\x80\x80\x80\x00\x0bx\x03\x01\x7f\x01~\x01\x7f#\x80\x80\x80\x80\x00A\x10k\"\x02$\x80\x80\x80\x80\x00B\x02!\x03\x02@ \x01(\x02\x08\"\x04 \x01(\x02\x0cO\r\x00 \x02 \x01)\x03\x00 \x04\xadB \x86B\x04\x84\x10\x83\x80\x80\x80\x00\x10\x92\x80\x80\x80\x00 \x02)\x03\x00!\x03 \x00 \x02)\x03\x087\x03\x08 \x01 \x04A\x01j6\x02\x08\x0b \x00 \x037\x03\x00 \x02A\x10j$\x80\x80\x80\x80\x00\x0b\xb7\x04\x04\x02\x7f\x02~\x01\x7f\x05~#\x80\x80\x80\x80\x00A0k\"\x02$\x80\x80\x80\x80\x00 \x02 \x00\x10\x8d\x80\x80\x80\x00\x02@\x02@\x02@ \x02-\x00\x00\"\x03A\x04F\r\x00 \x02)\x03\x10!\x00 \x02)\x03\x08!\x04 \x021\x00\x01!\x05 \x02 \x01\x10\x8d\x80\x80\x80\x00 \x02-\x00\x00\"\x06A\x04F\r\x00 \x02)\x03\x10!\x07 \x02)\x03\x08!\x08 \x021\x00\x01!\tB\x00!\nB\x00!\x0b\x02@\x02@\x02@\x02@ \x03\x0e\x04\x05\x02\x01\x00\x05\x0b \x00\x10\x80\x80\x80\x80\x00!\x01 \x02A\x006\x02( \x02 \x007\x03 \x02 \x01B \x88>\x02,B\x00!\x00\x03@ \x02 \x02A j\x10\x95\x80\x80\x80\x00 \x02)\x03\x00\"\x01B\x02Q\r\x03 \x01\xa7A\x01q\r\x06 \x02)\x03\x08\"\x01B\x00S \x00 \x01|\"\x01 \x00SG\r\x06 \x01!\x00\x0c\x00\x0b\x0b \x05!\x0b\x0c\x03\x0b \x00B\x00S \x04 \x00|\"\x0b \x04SsE\r\x02\x0c\x03\x0b \x00B\x00S \x04 \x00|\"\x0b \x04SsE\r\x01\x0c\x02\x0b\x00\x0b\x02@\x02@\x02@\x02@\x02@ \x06\x0e\x04\x04\x02\x01\x00\x04\x0b \x07\x10\x80\x80\x80\x80\x00!\x00 \x02A\x006\x02( \x02 \x077\x03 \x02 \x00B \x88>\x02,B\x00!\x00\x03@ \x02 \x02A j\x10\x95\x80\x80\x80\x00 \x02)\x03\x00\"\x01B\x02Q\r\x03 \x01\xa7A\x01q\r\x05 \x02)\x03\x08\"\x01B\x00S \x00 \x01|\"\x01 \x00SG\r\x05 \x01!\x00\x0c\x00\x0b\x0b \t!\n\x0c\x02\x0b \x07B\x00S \x08 \x07|\"\n \x08Ss\r\x02\x0c\x01\x0b \x00B\x00S \x08 \x00|\"\n \x08Ss\r\x01\x0b \nB\x00S \x0b \n|\"\x00 \x0bSs\r\x00\x02@\x02@ \x00B\x80\x80\x80\x80\x80\x80\x80\xc0\x00|B\xff\xff\xff\xff\xff\xff\xff\xff\x00V\r\x00 \x00B\x08\x86B\x07\x84!\x00\x0c\x01\x0b \x00\x10\x84\x80\x80\x80\x00!\x00\x0b \x02A0j$\x80\x80\x80\x80\x00 \x00\x0f\x0b\x10\x97\x80\x80\x80\x00\x00\x0b\t\x00\x10\x9d\x80\x80\x80\x00\x00\x0b\x9f\x01\x02\x01\x7f\x01~#\x80\x80\x80\x80\x00A k\"\x01$\x80\x80\x80\x80\x00 \x01A\x08j \x00\x10\x93\x80\x80\x80\x00\x02@ \x01(\x02\x08A\x01F\r\x00B\x02!\x00\x02@ \x01)\x03\x18\"\x02\x10\x80\x80\x80\x80\x00B\x80\x80\x80\x80\x10T\r\x00 \x01A\x08j \x02\x10\x85\x80\x80\x80\x00\x10\x93\x80\x80\x80\x00 \x01(\x02\x08A\x01F\r\x01 \x01)\x03\x10!\x00 \x01 \x01)\x03\x187\x03\x10 \x01 \x007\x03\x08 \x01A\x08j\x10\x99\x80\x80\x80\x00!\x00\x0b \x01A j$\x80\x80\x80\x80\x00 \x00\x0f\x0b\x00\x0b$\x00A\xcc\x80\xc0\x80\x00\xadB \x86B\x04\x84 \x00\xadB \x86B\x04\x84B\x84\x80\x80\x80 \x10\x8a\x80\x80\x80\x00\x0b\xf6\x05\x03\x01\x7f\x01~\x01\x7f#\x80\x80\x80\x80\x00A\xc0\x00k\"\x02$\x80\x80\x80\x80\x00\x02@ \x00B\xff\x01\x83B\xcb\x00R\r\x00 \x00\x10\x80\x80\x80\x80\x00!\x03 \x02A\x006\x02\x10 \x02 \x007\x03\x08 \x02 \x03B \x88>\x02\x14 \x02A\x18j \x02A\x08j\x10\x8e\x80\x80\x80\x00 \x02)\x03\x18\"\x00B\x02Q\r\x00 \x00\xa7A\x01q\r\x00\x02@ \x02)\x03 \"\x00\xa7A\xff\x01q\"\x04A\xca\x00F\r\x00 \x04A\x0eG\r\x01\x0b\x02@\x02@\x02@\x02@\x02@\x02@ \x00A\xf4\x80\xc0\x80\x00A\x02\x10\x8f\x80\x80\x80\x00B \x88\xa7\x0e\x02\x01\x00\x06\x0b \x02(\x02\x10 \x02(\x02\x14\x10\x90\x80\x80\x80\x00A\x01K\r\x05 \x02A0j \x02A\x08j\x10\x8e\x80\x80\x80\x00 \x02)\x030\"\x00B\x02Q\r\x05 \x00\xa7A\x01q\r\x05 \x02A\x18j \x02)\x038\x10\x94\x80\x80\x80\x00 \x02(\x02\x18A\x01F\r\x05 \x01B\xff\x01\x83B\x04R\r\x05 \x02)\x03(\"\x00 \x01B\x84\x80\x80\x80p\x83\"\x01\x10\x86\x80\x80\x80\x00B\x01R\r\x01 \x00 \x01\x10\x87\x80\x80\x80\x00\"\x00B\xff\x01\x83B\xcb\x00R\r\x05 \x00\x10\x80\x80\x80\x80\x00!\x01 \x02A\x006\x02\x10 \x02 \x007\x03\x08 \x02 \x01B \x88>\x02\x14 \x02A\x18j \x02A\x08j\x10\x8e\x80\x80\x80\x00 \x02)\x03\x18\"\x00B\x02Q\r\x05 \x00\xa7A\x01q\r\x05\x02@ \x02)\x03 \"\x00\xa7A\xff\x01q\"\x04A\xca\x00F\r\x00 \x04A\x0eG\r\x06\x0b \x00A\xf4\x80\xc0\x80\x00A\x02\x10\x8f\x80\x80\x80\x00B \x88\xa7\x0e\x02\x03\x02\x05\x0b \x02(\x02\x10 \x02(\x02\x14\x10\x90\x80\x80\x80\x00\r\x04 \x01B\xff\x01\x83B\x04R\r\x04\x0bB\x02!\x00\x0c\x02\x0b \x02(\x02\x10 \x02(\x02\x14\x10\x90\x80\x80\x80\x00A\x01K\r\x02 \x02A0j \x02A\x08j\x10\x8e\x80\x80\x80\x00 \x02)\x030\"\x00B\x02Q\r\x02 \x00\xa7A\x01q\r\x02 \x02A\x18j \x02)\x038\x10\x94\x80\x80\x80\x00 \x02(\x02\x18A\x01F\r\x02 \x02)\x03(!\x00 \x02)\x03 !\x01 \x02A\x18jA\xe8\x80\xc0\x80\x00A\t\x10\x9b\x80\x80\x80\x00 \x02(\x02\x18\r\x02 \x02)\x03 !\x03 \x02 \x007\x03 \x02 \x017\x03\x18 \x02 \x02A\x18j\x10\x99\x80\x80\x80\x007\x03 \x02 \x037\x03\x18 \x02A\x18jA\x02\x10\x9c\x80\x80\x80\x00!\x00\x0c\x01\x0b \x02(\x02\x10 \x02(\x02\x14\x10\x90\x80\x80\x80\x00\r\x01 \x02A\x18jA\xdc\x80\xc0\x80\x00A\x0c\x10\x9b\x80\x80\x80\x00 \x02(\x02\x18\r\x01 \x02 \x02)\x03 7\x03\x18 \x02A\x18jA\x01\x10\x9c\x80\x80\x80\x00!\x00\x0b \x02A\xc0\x00j$\x80\x80\x80\x80\x00 \x00\x0f\x0b\x00\x0b\xd6\x01\x02\x01~\x03\x7f\x02@\x02@ \x02A\tK\r\x00B\x00!\x03A\x00!\x04\x03@\x02@ \x04A\tG\r\x00 \x03B\x08\x86B\x0e\x84!\x03\x0c\x03\x0bA\x01!\x05\x02@ \x01 \x04j-\x00\x00\"\x06A\xdf\x00F\r\x00\x02@\x02@ \x06APjA\xff\x01qA\nI\r\x00 \x06A\xbf\x7fjA\xff\x01qA\x1aI\r\x01 \x06A\x9f\x7fjA\xff\x01qA\x1aO\r\x04 \x06AEj!\x05\x0c\x02\x0b \x06ARj!\x05\x0c\x01\x0b \x06AKj!\x05\x0b \x03B\x06\x86 \x05\xadB\xff\x01\x83\x84!\x03 \x04A\x01j!\x04\x0c\x00\x0b\x0b \x01\xadB \x86B\x04\x84 \x02\xadB \x86B\x04\x84\x10\x89\x80\x80\x80\x00!\x03\x0b \x00B\x007\x03\x00 \x00 \x037\x03\x08\x0b\x1a\x00 \x00\xadB \x86B\x04\x84 \x01\xadB \x86B\x04\x84\x10\x88\x80\x80\x80\x00\x0b\x03\x00\x00\x0b\x0b\x8e\x01\x01\x00A\x80\x80\xc0\x00\x0b\x84\x01UdtAUdtBUdtCUdtD\x00\x00\x10\x00\x04\x00\x00\x00\x04\x00\x10\x00\x04\x00\x00\x00\x08\x00\x10\x00\x04\x00\x00\x00\x0c\x00\x10\x00\x04\x00\x00\x00abc\x000\x00\x10\x00\x01\x00\x00\x001\x00\x10\x00\x01\x00\x00\x002\x00\x10\x00\x01\x00\x00\x000\x00\x10\x00\x01\x00\x00\x001\x00\x10\x00\x01\x00\x00\x00NotRecursiveRecursive\x00\x00\x00\\\x00\x10\x00\x0c\x00\x00\x00h\x00\x10\x00\t\x00\x00\x00\x00\xdb\x1c\x0econtractspecv0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03add\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01a\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x07UdtEnum\x00\x00\x00\x00\x00\x00\x00\x00\x01b\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x07UdtEnum\x00\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07UdtEnum\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04UdtA\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04UdtB\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\tUdtStruct\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04UdtC\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x08UdtEnum2\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04UdtD\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x08UdtTuple\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08UdtEnum2\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01A\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x01B\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08UdtTuple\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x010\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x011\x00\x00\x00\x00\x00\x03\xea\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\tUdtStruct\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x01a\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x01b\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x01c\x00\x00\x00\x00\x00\x03\xea\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\trecursive\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01a\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x0cUdtRecursive\x00\x00\x00\x01\x00\x00\x03\xe8\x00\x00\x07\xd0\x00\x00\x00\x0cUdtRecursive\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cUdtRecursive\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01a\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x01b\x00\x00\x00\x00\x00\x03\xea\x00\x00\x07\xd0\x00\x00\x00\x0cUdtRecursive\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\rRecursiveEnum\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cNotRecursive\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\tRecursive\x00\x00\x00\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0fRecursiveToEnum\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fRecursiveToEnum\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01a\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x01b\x00\x00\x00\x00\x00\x03\xec\x00\x00\x00\x04\x00\x00\x07\xd0\x00\x00\x00\rRecursiveEnum\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0erecursive_enum\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x01a\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x00\rRecursiveEnum\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03key\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x03\xe9\x00\x00\x03\xe8\x00\x00\x07\xd0\x00\x00\x00\rRecursiveEnum\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x02\x00\x00\x00\xe3Context of a single authorized call performed by an address.\n\nCustom account contracts that implement `__check_auth` special function\nreceive a list of `Context` values corresponding to all the calls that\nneed to be authorized.\x00\x00\x00\x00\x00\x00\x00\x00\x07Context\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x14Contract invocation.\x00\x00\x00\x08Contract\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x0fContractContext\x00\x00\x00\x00\x01\x00\x00\x00=Contract that has a constructor with no arguments is created.\x00\x00\x00\x00\x00\x00\x14CreateContractHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x1bCreateContractHostFnContext\x00\x00\x00\x00\x01\x00\x00\x00DContract that has a constructor with 1 or more arguments is created.\x00\x00\x00\x1cCreateContractWithCtorHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00*CreateContractWithConstructorHostFnContext\x00\x00\x00\x00\x00\x01\x00\x00\x00\xbdAuthorization context of a single contract call.\n\nThis struct corresponds to a `require_auth_for_args` call for an address\nfrom `contract` function with `fn_name` name and `args` arguments.\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0fContractContext\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x04args\x00\x00\x03\xea\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08contract\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x07fn_name\x00\x00\x00\x00\x11\x00\x00\x00\x02\x00\x00\x00_Contract executable used for creating a new contract and used in\n`CreateContractHostFnContext`.\x00\x00\x00\x00\x00\x00\x00\x00\x12ContractExecutable\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Wasm\x00\x00\x00\x01\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x01\x00\x00\x008Value of contract node in InvokerContractAuthEntry tree.\x00\x00\x00\x00\x00\x00\x00\x15SubContractInvocation\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x07context\x00\x00\x00\x07\xd0\x00\x00\x00\x0fContractContext\x00\x00\x00\x00\x00\x00\x00\x00\x0fsub_invocations\x00\x00\x00\x03\xea\x00\x00\x07\xd0\x00\x00\x00\x18InvokerContractAuthEntry\x00\x00\x00\x02\x00\x00\x01/A node in the tree of authorizations performed on behalf of the current\ncontract as invoker of the contracts deeper in the call stack.\n\nThis is used as an argument of `authorize_as_current_contract` host function.\n\nThis tree corresponds `require_auth[_for_args]` calls on behalf of the\ncurrent contract.\x00\x00\x00\x00\x00\x00\x00\x00\x18InvokerContractAuthEntry\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x12Invoke a contract.\x00\x00\x00\x00\x00\x08Contract\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x15SubContractInvocation\x00\x00\x00\x00\x00\x00\x01\x00\x00\x005Create a contract passing 0 arguments to constructor.\x00\x00\x00\x00\x00\x00\x14CreateContractHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00\x1bCreateContractHostFnContext\x00\x00\x00\x00\x01\x00\x00\x00=Create a contract passing 0 or more arguments to constructor.\x00\x00\x00\x00\x00\x00\x1cCreateContractWithCtorHostFn\x00\x00\x00\x01\x00\x00\x07\xd0\x00\x00\x00*CreateContractWithConstructorHostFnContext\x00\x00\x00\x00\x00\x01\x00\x00\x00vAuthorization context for `create_contract` host function that creates a\nnew contract on behalf of authorizer address.\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1bCreateContractHostFnContext\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\nexecutable\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12ContractExecutable\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04salt\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x01\x00\x00\x00\xd6Authorization context for `create_contract` host function that creates a\nnew contract on behalf of authorizer address.\nThis is the same as `CreateContractHostFnContext`, but also has\ncontract constructor arguments.\x00\x00\x00\x00\x00\x00\x00\x00\x00*CreateContractWithConstructorHostFnContext\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x10constructor_args\x00\x00\x03\xea\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nexecutable\x00\x00\x00\x00\x07\xd0\x00\x00\x00\x12ContractExecutable\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04salt\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\nExecutable\x00\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04Wasm\x00\x00\x00\x01\x00\x00\x03\xee\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cStellarAsset\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07Account\x00\x00\xd1\x0b\x1ccontractspecv0.rssdk.graphv0SpGrV\x01\x00\x02\xf3\xb0\xab@i\rH\xb4\x81\x9c\x94|?A\xef\xcf\xf3%Q\xd5\x8b\x90\xb2B\x18\xfb\x8c>\xaa\x8c^2\x00\x03\x16\'d8\xff\xc9\xb1\xf8\x1cf\xb0\x84\xb1\xb8\xfay\x84`\xe4\xddp;\xc5*\x0e\xbaH:\x94\xbb\xb2\x87\xaf\xf7\x93\xba\x9eM\xde\x9a?\'\xa8\xb9\xcb\x94\x9f\x88\xf6L\xc0\xb9\x18\xd1\xc9\x1a5\xf8\x99\xa59\xc2\xcf\x9e\xeb\x9f\x12&\x9av(*\x7f17.3\x91\xccc\xfc\xec\xee3\x0f\x96\xf2P\x1b9\xe8\xc6\x8f\xf0\xe0\xebSpGrV\x01\x00\x02\xaf\xf7\x93\xba\x9eM\xde\x9a?\'\xa8\xb9\xcb\x94\x9f\x88\xf6L\xc0\xb9\x18\xd1\xc9\x1a5\xf8\x99\xa59\xc2\xcf\x9e\x00\x00SpGrV\x01\x00\x02\xeb\x9f\x12&\x9av(*\x7f17.3\x91\xccc\xfc\xec\xee3\x0f\x96\xf2P\x1b9\xe8\xc6\x8f\xf0\xe0\xeb\x00\x00SpGrV\x01\x00\x02\x16\'d8\xff\xc9\xb1\xf8\x1cf\xb0\x84\xb1\xb8\xfay\x84`\xe4\xddp;\xc5*\x0e\xbaH:\x94\xbb\xb2\x87\x00\x00SpGrV\x01\x00\x00\xeb\xb9m\xe34\x1d[[\xe4K\xe7\xe3\xf4.\x99\x9b\xf2\x1a\xe15\xa1D+\xa8\x1b\x1cV\n\xed\xc1\xa4\x89\x00\x02\xf3\xb0\xab@i\rH\xb4\x81\x9c\x94|?A\xef\xcf\xf3%Q\xd5\x8b\x90\xb2B\x18\xfb\x8c>\xaa\x8c^2\xf3\xb0\xab@i\rH\xb4\x81\x9c\x94|?A\xef\xcf\xf3%Q\xd5\x8b\x90\xb2B\x18\xfb\x8c>\xaa\x8c^2SpGrV\x01\x00\x02\xc8\x12\x91\xfe\xd7\x13\xf5\x9c\xe4\xc7\x03\xdc@#$F\r\x04\xe2j_\xb0\xacC\xfd\x0b\xc0J~<\xfc\x05\x00\x01\xc8\x12\x91\xfe\xd7\x13\xf5\x9c\xe4\xc7\x03\xdc@#$F\r\x04\xe2j_\xb0\xacC\xfd\x0b\xc0J~<\xfc\x05SpGrV\x01\x00\x02\xff{V \xab\r\xdcd\xe7~\x19\x83<\xc27t\xc6\x9d=\x9f\x8f\x12\x0e\x18>%\x08\x89.&\x00M\x00\x01\xe1oU\xdb\xd47\x98\x14z\xb2+\xbb\xdf\xdbn\x14$\x92\xbb\xf1M\xf2\x10&P\x0c\xd1\x13J\x97CiSpGrV\x01\x00\x02\xe1oU\xdb\xd47\x98\x14z\xb2+\xbb\xdf\xdbn\x14$\x92\xbb\xf1M\xf2\x10&P\x0c\xd1\x13J\x97Ci\x00\x01\xff{V \xab\r\xdcd\xe7~\x19\x83<\xc27t\xc6\x9d=\x9f\x8f\x12\x0e\x18>%\x08\x89.&\x00MSpGrV\x01\x00\x00(`\x83Z;\x970\xd8\xdaZp\xcf\x9e\xbf\x82\x86|0\xb6\x90\x10Mf\x13\xcf\xd76\x0cDn\xdb\xb2\x00\x02\xc8\x12\x91\xfe\xd7\x13\xf5\x9c\xe4\xc7\x03\xdc@#$F\r\x04\xe2j_\xb0\xacC\xfd\x0b\xc0J~<\xfc\x05\xc8\x12\x91\xfe\xd7\x13\xf5\x9c\xe4\xc7\x03\xdc@#$F\r\x04\xe2j_\xb0\xacC\xfd\x0b\xc0J~<\xfc\x05SpGrV\x01\x00\x00\x84H!\x0e\xfc\xdbM6\x02\xaaN\xe4\xee\x99J\x08\x94\x08\xa9\xc0D\x88Ci\xc9\x07~\xb9\xa6\xc5\xec\xaa\x00\x02\xff{V \xab\r\xdcd\xe7~\x19\x83<\xc27t\xc6\x9d=\x9f\x8f\x12\x0e\x18>%\x08\x89.&\x00M\xff{V \xab\r\xdcd\xe7~\x19\x83<\xc27t\xc6\x9d=\x9f\x8f\x12\x0e\x18>%\x08\x89.&\x00MSpGrV\x01\x00\x02\xa3J\xcf\xf7D\x93\x0bB]\x95\xeb\xfe\x03y\x83e5\\\x16\xeb\x94Ne\xe6Xw\x1f&\xf7\xc0pT\x00\x03\xf1\xf9\x90\x07E*e\xfd\x08\x8c\xc2\xb1\x10\xfd\xca\xae6T\x9e)[\xdb\xee_\xfa\xed\xcaE\x9bv\x98\xec\x15\xe5\x1a,\xc0\xc7\xef\xd4\xe0\xda\x0e\x16\x87\x1a\xae\xe73X\x1d2\x8a\x8aP\xab\x81\xef\x18\x8e:\xa2\xa9ns\x94\x0c\x1926\x1d\x90\x19\xc8\x8b=\xbe\xaf\xd7n\xcd=z\t\xb27\xa5.\xde:>\x03\xcd7\x12\xafSpGrV\x01\x00\x02\xf1\xf9\x90\x07E*e\xfd\x08\x8c\xc2\xb1\x10\xfd\xca\xae6T\x9e)[\xdb\xee_\xfa\xed\xcaE\x9bv\x98\xec\x00\x00SpGrV\x01\x00\x02\xb6\xb1Hy\xda\xca\xaf\xcc\x1f\x01\x07y\x9a#g}2\x1c.Q0Vf\xc7ze\xacm\x01\xf5Y\xcc\x00\x00SpGrV\x01\x00\x02\x9e)H\x8e\xf0\x01{{\xce\x9fdO\x0eD\xc0,\x0f\xe8\xee\'\x845r\x9f\xeb`\xd0\x12H\x17\x96g\x00\x02\xf1\xf9\x90\x07E*e\xfd\x08\x8c\xc2\xb1\x10\xfd\xca\xae6T\x9e)[\xdb\xee_\xfa\xed\xcaE\x9bv\x98\xecULqD\xd3\xfa:\x1f\x0c\xa5\xb7\x04\xe5H\x8b\x91J\x9e\x0fe\x7f\x9f[\xdbG#\xc7o\xb0\xf4\xcf\xe6SpGrV\x01\x00\x02ULqD\xd3\xfa:\x1f\x0c\xa5\xb7\x04\xe5H\x8b\x91J\x9e\x0fe\x7f\x9f[\xdbG#\xc7o\xb0\xf4\xcf\xe6\x00\x03\x9e)H\x8e\xf0\x01{{\xce\x9fdO\x0eD\xc0,\x0f\xe8\xee\'\x845r\x9f\xeb`\xd0\x12H\x17\x96g\x15\xe5\x1a,\xc0\xc7\xef\xd4\xe0\xda\x0e\x16\x87\x1a\xae\xe73X\x1d2\x8a\x8aP\xab\x81\xef\x18\x8e:\xa2\xa9ns\x94\x0c\x1926\x1d\x90\x19\xc8\x8b=\xbe\xaf\xd7n\xcd=z\t\xb27\xa5.\xde:>\x03\xcd7\x12\xafSpGrV\x01\x00\x02\x15\xe5\x1a,\xc0\xc7\xef\xd4\xe0\xda\x0e\x16\x87\x1a\xae\xe73X\x1d2\x8a\x8aP\xab\x81\xef\x18\x8e:\xa2\xa9n\x00\x01\xb6\xb1Hy\xda\xca\xaf\xcc\x1f\x01\x07y\x9a#g}2\x1c.Q0Vf\xc7ze\xacm\x01\xf5Y\xccSpGrV\x01\x00\x02s\x94\x0c\x1926\x1d\x90\x19\xc8\x8b=\xbe\xaf\xd7n\xcd=z\t\xb27\xa5.\xde:>\x03\xcd7\x12\xaf\x00\x01\xb6\xb1Hy\xda\xca\xaf\xcc\x1f\x01\x07y\x9a#g}2\x1c.Q0Vf\xc7ze\xacm\x01\xf5Y\xccSpGrV\x01\x00\x02L|{\r\xf4\xf2\x1a\xa8\xf6\x981\xe2K\xcb\x824N\xe6\x97\xed\xdf\xc2\x1cck\xd6\xceW\x9cx\x10\x1e\x00\x00\x00\x1e\x11contractenvmetav0\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x00\x00O\x0econtractmetav0\x00\x00\x00\x00\x00\x00\x00\x05rsver\x00\x00\x00\x00\x00\x00\x061.91.0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12rssdk_spec_shaking\x00\x00\x00\x00\x00\x012\x00\x00\x00"; + pub trait Contract { + fn add(env: soroban_sdk::Env, a: UdtEnum, b: UdtEnum) -> i64; + fn recursive(env: soroban_sdk::Env, a: UdtRecursive) -> Option; + fn recursive_enum( + env: soroban_sdk::Env, + a: RecursiveEnum, + key: u32, + ) -> Result, soroban_sdk::Error>; + } + ///Client is a client for calling the contract defined in "Contract". + pub struct Client<'a> { + pub env: soroban_sdk::Env, + pub address: soroban_sdk::Address, + #[doc(hidden)] + set_auths: Option<&'a [soroban_sdk::xdr::SorobanAuthorizationEntry]>, + #[doc(hidden)] + mock_auths: Option<&'a [soroban_sdk::testutils::MockAuth<'a>]>, + #[doc(hidden)] + mock_all_auths: bool, + #[doc(hidden)] + allow_non_root_auth: bool, + } + impl<'a> Client<'a> { + pub fn new(env: &soroban_sdk::Env, address: &soroban_sdk::Address) -> Self { + Self { + env: env.clone(), + address: address.clone(), + set_auths: None, + mock_auths: None, + mock_all_auths: false, + allow_non_root_auth: false, + } + } + /// Set authorizations in the environment which will be consumed by + /// contracts when they invoke `Address::require_auth` or + /// `Address::require_auth_for_args` functions. + /// + /// Requires valid signatures for the authorization to be successful. + /// To mock auth without requiring valid signatures, use `mock_auths`. + /// + /// See `soroban_sdk::Env::set_auths` for more details and examples. + pub fn set_auths( + &self, + auths: &'a [soroban_sdk::xdr::SorobanAuthorizationEntry], + ) -> Self { + Self { + env: self.env.clone(), + address: self.address.clone(), + set_auths: Some(auths), + mock_auths: self.mock_auths.clone(), + mock_all_auths: false, + allow_non_root_auth: false, + } + } + /// Mock authorizations in the environment which will cause matching invokes + /// of `Address::require_auth` and `Address::require_auth_for_args` to + /// pass. + /// + /// See `soroban_sdk::Env::set_auths` for more details and examples. + pub fn mock_auths( + &self, + mock_auths: &'a [soroban_sdk::testutils::MockAuth<'a>], + ) -> Self { + Self { + env: self.env.clone(), + address: self.address.clone(), + set_auths: self.set_auths.clone(), + mock_auths: Some(mock_auths), + mock_all_auths: false, + allow_non_root_auth: false, + } + } + /// Mock all calls to the `Address::require_auth` and + /// `Address::require_auth_for_args` functions in invoked contracts, + /// having them succeed as if authorization was provided. + /// + /// See `soroban_sdk::Env::mock_all_auths` for more details and + /// examples. + pub fn mock_all_auths(&self) -> Self { + Self { + env: self.env.clone(), + address: self.address.clone(), + set_auths: None, + mock_auths: None, + mock_all_auths: true, + allow_non_root_auth: false, + } + } + /// A version of `mock_all_auths` that allows authorizations that + /// are not present in the root invocation. + /// + /// Refer to `mock_all_auths` documentation for details and + /// prefer using `mock_all_auths` unless non-root authorization is + /// required. + /// + /// See `soroban_sdk::Env::mock_all_auths_allowing_non_root_auth` + /// for more details and examples. + pub fn mock_all_auths_allowing_non_root_auth(&self) -> Self { + Self { + env: self.env.clone(), + address: self.address.clone(), + set_auths: None, + mock_auths: None, + mock_all_auths: true, + allow_non_root_auth: true, + } + } + } + impl<'a> Client<'a> { + pub fn add(&self, a: &UdtEnum, b: &UdtEnum) -> i64 { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("add"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array( + &self.env, + [a.into_val(&self.env), b.into_val(&self.env)], + ), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn try_add( + &self, + a: &UdtEnum, + b: &UdtEnum, + ) -> Result< + Result< + i64, + >::Error, + >, + Result, + > { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("add"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array( + &self.env, + [a.into_val(&self.env), b.into_val(&self.env)], + ), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn recursive(&self, a: &UdtRecursive) -> Option { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("recursive"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array(&self.env, [a.into_val(&self.env)]), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn try_recursive( + &self, + a: &UdtRecursive, + ) -> Result< + Result< + Option, + as soroban_sdk::TryFromVal< + soroban_sdk::Env, + soroban_sdk::Val, + >>::Error, + >, + Result, + > { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("recursive"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array(&self.env, [a.into_val(&self.env)]), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn recursive_enum(&self, a: &RecursiveEnum, key: &u32) -> Option { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "recursive_enum") }, + ::soroban_sdk::Vec::from_array( + &self.env, + [a.into_val(&self.env), key.into_val(&self.env)], + ), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn try_recursive_enum( + &self, + a: &RecursiveEnum, + key: &u32, + ) -> Result< + Result< + Option, + as soroban_sdk::TryFromVal< + soroban_sdk::Env, + soroban_sdk::Val, + >>::Error, + >, + Result, + > { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "recursive_enum") }, + ::soroban_sdk::Vec::from_array( + &self.env, + [a.into_val(&self.env), key.into_val(&self.env)], + ), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + } + ///Args is a type for building arg lists for functions defined in "Contract". + pub struct Args; + impl Args { + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn add<'i>(a: &'i UdtEnum, b: &'i UdtEnum) -> (&'i UdtEnum, &'i UdtEnum) { + (a, b) + } + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn recursive<'i>(a: &'i UdtRecursive) -> (&'i UdtRecursive,) { + (a,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn recursive_enum<'i>( + a: &'i RecursiveEnum, + key: &'i u32, + ) -> (&'i RecursiveEnum, &'i u32) { + (a, key) + } + } + pub struct UdtTuple(pub i64, pub soroban_sdk::Vec); + #[automatically_derived] + impl ::core::fmt::Debug for UdtTuple { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_tuple_field2_finish(f, "UdtTuple", &self.0, &&self.1) + } + } + #[automatically_derived] + impl ::core::clone::Clone for UdtTuple { + #[inline] + fn clone(&self) -> UdtTuple { + UdtTuple( + ::core::clone::Clone::clone(&self.0), + ::core::clone::Clone::clone(&self.1), + ) + } + } + #[automatically_derived] + impl ::core::cmp::Eq for UdtTuple { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for UdtTuple {} + #[automatically_derived] + impl ::core::cmp::PartialEq for UdtTuple { + #[inline] + fn eq(&self, other: &UdtTuple) -> bool { + self.0 == other.0 && self.1 == other.1 + } + } + #[automatically_derived] + impl ::core::cmp::Ord for UdtTuple { + #[inline] + fn cmp(&self, other: &UdtTuple) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.0, &other.0) { + ::core::cmp::Ordering::Equal => ::core::cmp::Ord::cmp(&self.1, &other.1), + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for UdtTuple { + #[inline] + fn partial_cmp( + &self, + other: &UdtTuple, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.0, &other.0) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.1, &other.1) + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_UDTTUPLE: [u8; 64usize] = UdtTuple::spec_xdr(); + impl UdtTuple { + pub const fn spec_xdr() -> [u8; 64usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x08UdtTuple\0\0\0\x02\0\0\0\0\0\0\0\x010\0\0\0\0\0\0\x07\0\0\0\0\0\0\0\x011\0\0\0\0\0\x03\xea\0\0\0\x07" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for UdtTuple { + const SPEC_TYPE_ID: [u8; 32] = *b"\xeb\x9f\x12&\x9av(*\x7f17.3\x91\xccc\xfc\xec\xee3\x0f\x96\xf2P\x1b9\xe8\xc6\x8f\xf0\xe0\xeb"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_UDTTUPLE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\xeb\x9f\x12&\x9av(*\x7f17.3\x91\xccc\xfc\xec\xee3\x0f\x96\xf2P\x1b9\xe8\xc6\x8f\xf0\xe0\xeb", + [], + ); + impl soroban_sdk::TryFromVal for UdtTuple { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val, VecObject}; + let vec: VecObject = (*val).try_into().map_err(|_| ConversionError)?; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + env.vec_unpack_to_slice(vec, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + 0: vals[0].try_into_val(env).map_err(|_| ConversionError)?, + 1: vals[1].try_into_val(env).map_err(|_| ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UdtTuple, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + let vals: [Val; 2usize] = [ + (&val.0).try_into_val(env).map_err(|_| ConversionError)?, + (&val.1).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .vec_new_from_slice(&vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UdtTuple, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal for UdtTuple { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + if vec.len() != 2usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + Ok(Self { + 0: { + let rv: soroban_sdk::Val = (&vec[0].clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + 1: { + let rv: soroban_sdk::Val = (&vec[1].clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal for UdtTuple { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&UdtTuple> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UdtTuple) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + Ok(soroban_sdk::xdr::ScVec( + <[_]>::into_vec(::alloc::boxed::box_new([ + (&val.0) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + (&val.1) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ])) + .try_into()?, + )) + } + } + impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UdtTuple) -> Result { + (&val).try_into() + } + } + impl TryFrom<&UdtTuple> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UdtTuple) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UdtTuple) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryUdtTuple( + ::Prototype, + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + ); + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUdtTuple { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_tuple_field2_finish( + f, + "ArbitraryUdtTuple", + &self.0, + &&self.1, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUdtTuple { + #[inline] + fn clone(&self) -> ArbitraryUdtTuple { + ArbitraryUdtTuple( + ::core::clone::Clone::clone(&self.0), + ::core::clone::Clone::clone(&self.1), + ) + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUdtTuple { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUdtTuple {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUdtTuple { + #[inline] + fn eq(&self, other: &ArbitraryUdtTuple) -> bool { + self.0 == other.0 && self.1 == other.1 + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUdtTuple { + #[inline] + fn cmp(&self, other: &ArbitraryUdtTuple) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.0, &other.0) { + ::core::cmp::Ordering::Equal => ::core::cmp::Ord::cmp(&self.1, &other.1), + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUdtTuple { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUdtTuple, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.0, &other.0) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.1, &other.1) + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUdtTuple: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUdtTuple { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtTuple.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUdtTuple( + arbitrary::Arbitrary::arbitrary(u)?, + arbitrary::Arbitrary::arbitrary(u)?, + )) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtTuple.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtTuple.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUdtTuple( + arbitrary::Arbitrary::arbitrary(&mut u)?, + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + )) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtTuple.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UdtTuple { + type Prototype = ArbitraryUdtTuple; + } + impl soroban_sdk::TryFromVal for UdtTuple { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUdtTuple, + ) -> std::result::Result { + Ok(UdtTuple( + soroban_sdk::IntoVal::into_val(&v.0, env), + soroban_sdk::IntoVal::into_val(&v.1, env), + )) + } + } + }; + pub struct UdtStruct { + pub a: i64, + pub b: i64, + pub c: soroban_sdk::Vec, + } + #[automatically_derived] + impl ::core::fmt::Debug for UdtStruct { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "UdtStruct", + "a", + &self.a, + "b", + &self.b, + "c", + &&self.c, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for UdtStruct { + #[inline] + fn clone(&self) -> UdtStruct { + UdtStruct { + a: ::core::clone::Clone::clone(&self.a), + b: ::core::clone::Clone::clone(&self.b), + c: ::core::clone::Clone::clone(&self.c), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for UdtStruct { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for UdtStruct {} + #[automatically_derived] + impl ::core::cmp::PartialEq for UdtStruct { + #[inline] + fn eq(&self, other: &UdtStruct) -> bool { + self.a == other.a && self.b == other.b && self.c == other.c + } + } + #[automatically_derived] + impl ::core::cmp::Ord for UdtStruct { + #[inline] + fn cmp(&self, other: &UdtStruct) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.a, &other.a) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.b, &other.b) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.c, &other.c) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for UdtStruct { + #[inline] + fn partial_cmp( + &self, + other: &UdtStruct, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.a, &other.a) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp(&self.b, &other.b) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.c, &other.c) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_UDTSTRUCT: [u8; 84usize] = UdtStruct::spec_xdr(); + impl UdtStruct { + pub const fn spec_xdr() -> [u8; 84usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\tUdtStruct\0\0\0\0\0\0\x03\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x07\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x07\0\0\0\0\0\0\0\x01c\0\0\0\0\0\x03\xea\0\0\0\x07" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for UdtStruct { + const SPEC_TYPE_ID: [u8; 32] = *b"\x16'd8\xff\xc9\xb1\xf8\x1cf\xb0\x84\xb1\xb8\xfay\x84`\xe4\xddp;\xc5*\x0e\xbaH:\x94\xbb\xb2\x87"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_UDTSTRUCT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\x16'd8\xff\xc9\xb1\xf8\x1cf\xb0\x84\xb1\xb8\xfay\x84`\xe4\xddp;\xc5*\x0e\xbaH:\x94\xbb\xb2\x87", + [], + ); + impl soroban_sdk::TryFromVal for UdtStruct { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["a", "b", "c"]; + let mut vals: [Val; 3usize] = [Val::VOID.to_val(); 3usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + a: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + b: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + c: vals[2] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UdtStruct, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["a", "b", "c"]; + let vals: [Val; 3usize] = [ + (&val.a).try_into_val(env).map_err(|_| ConversionError)?, + (&val.b).try_into_val(env).map_err(|_| ConversionError)?, + (&val.c).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UdtStruct, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal for UdtStruct { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 3usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + a: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "a".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + b: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "b".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + c: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "c".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal for UdtStruct { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&UdtStruct> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UdtStruct) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "a".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.a) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "b".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.b) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "c".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.c) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } + } + impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UdtStruct) -> Result { + (&val).try_into() + } + } + impl TryFrom<&UdtStruct> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UdtStruct) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UdtStruct) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryUdtStruct { + a: ::Prototype, + b: ::Prototype, + c: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUdtStruct { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "ArbitraryUdtStruct", + "a", + &self.a, + "b", + &self.b, + "c", + &&self.c, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUdtStruct { + #[inline] + fn clone(&self) -> ArbitraryUdtStruct { + ArbitraryUdtStruct { + a: ::core::clone::Clone::clone(&self.a), + b: ::core::clone::Clone::clone(&self.b), + c: ::core::clone::Clone::clone(&self.c), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUdtStruct { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUdtStruct {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUdtStruct { + #[inline] + fn eq(&self, other: &ArbitraryUdtStruct) -> bool { + self.a == other.a && self.b == other.b && self.c == other.c + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUdtStruct { + #[inline] + fn cmp(&self, other: &ArbitraryUdtStruct) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.a, &other.a) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.b, &other.b) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.c, &other.c) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUdtStruct { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUdtStruct, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.a, &other.a) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp(&self.b, &other.b) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.c, &other.c) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUdtStruct: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUdtStruct { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtStruct.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUdtStruct { + a: arbitrary::Arbitrary::arbitrary(u)?, + b: arbitrary::Arbitrary::arbitrary(u)?, + c: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtStruct.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtStruct.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUdtStruct { + a: arbitrary::Arbitrary::arbitrary(&mut u)?, + b: arbitrary::Arbitrary::arbitrary(&mut u)?, + c: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtStruct.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UdtStruct { + type Prototype = ArbitraryUdtStruct; + } + impl soroban_sdk::TryFromVal for UdtStruct { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUdtStruct, + ) -> std::result::Result { + Ok(UdtStruct { + a: soroban_sdk::IntoVal::into_val(&v.a, env), + b: soroban_sdk::IntoVal::into_val(&v.b, env), + c: soroban_sdk::IntoVal::into_val(&v.c, env), + }) + } + } + }; + pub struct UdtRecursive { + pub a: soroban_sdk::Symbol, + pub b: soroban_sdk::Vec, + } + #[automatically_derived] + impl ::core::fmt::Debug for UdtRecursive { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UdtRecursive", + "a", + &self.a, + "b", + &&self.b, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for UdtRecursive { + #[inline] + fn clone(&self) -> UdtRecursive { + UdtRecursive { + a: ::core::clone::Clone::clone(&self.a), + b: ::core::clone::Clone::clone(&self.b), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for UdtRecursive { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for UdtRecursive {} + #[automatically_derived] + impl ::core::cmp::PartialEq for UdtRecursive { + #[inline] + fn eq(&self, other: &UdtRecursive) -> bool { + self.a == other.a && self.b == other.b + } + } + #[automatically_derived] + impl ::core::cmp::Ord for UdtRecursive { + #[inline] + fn cmp(&self, other: &UdtRecursive) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.a, &other.a) { + ::core::cmp::Ordering::Equal => ::core::cmp::Ord::cmp(&self.b, &other.b), + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for UdtRecursive { + #[inline] + fn partial_cmp( + &self, + other: &UdtRecursive, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.a, &other.a) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.b, &other.b) + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_UDTRECURSIVE: [u8; 84usize] = UdtRecursive::spec_xdr(); + impl UdtRecursive { + pub const fn spec_xdr() -> [u8; 84usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0cUdtRecursive\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x11\0\0\0\0\0\0\0\x01b\0\0\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x0cUdtRecursive" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for UdtRecursive { + const SPEC_TYPE_ID: [u8; 32] = *b"\xc8\x12\x91\xfe\xd7\x13\xf5\x9c\xe4\xc7\x03\xdc@#$F\r\x04\xe2j_\xb0\xacC\xfd\x0b\xc0J~<\xfc\x05"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_UDTRECURSIVE: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, + >( + 2, + *b"\xc8\x12\x91\xfe\xd7\x13\xf5\x9c\xe4\xc7\x03\xdc@#$F\r\x04\xe2j_\xb0\xacC\xfd\x0b\xc0J~<\xfc\x05", + [::SPEC_TYPE_ID], + ); + impl soroban_sdk::TryFromVal for UdtRecursive { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["a", "b"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + a: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + b: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UdtRecursive, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["a", "b"]; + let vals: [Val; 2usize] = [ + (&val.a).try_into_val(env).map_err(|_| ConversionError)?, + (&val.b).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UdtRecursive, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + impl soroban_sdk::TryFromVal for UdtRecursive { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 2usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + a: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "a".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + b: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "b".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal for UdtRecursive { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&UdtRecursive> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UdtRecursive) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "a".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.a) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "b".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.b) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } + } + impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UdtRecursive) -> Result { + (&val).try_into() + } + } + impl TryFrom<&UdtRecursive> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UdtRecursive) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UdtRecursive) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryUdtRecursive { + a: ::Prototype, + b: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUdtRecursive { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "ArbitraryUdtRecursive", + "a", + &self.a, + "b", + &&self.b, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUdtRecursive { + #[inline] + fn clone(&self) -> ArbitraryUdtRecursive { + ArbitraryUdtRecursive { + a: ::core::clone::Clone::clone(&self.a), + b: ::core::clone::Clone::clone(&self.b), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUdtRecursive { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUdtRecursive {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUdtRecursive { + #[inline] + fn eq(&self, other: &ArbitraryUdtRecursive) -> bool { + self.a == other.a && self.b == other.b + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUdtRecursive { + #[inline] + fn cmp(&self, other: &ArbitraryUdtRecursive) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.a, &other.a) { + ::core::cmp::Ordering::Equal => ::core::cmp::Ord::cmp(&self.b, &other.b), + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUdtRecursive { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUdtRecursive, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.a, &other.a) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.b, &other.b) + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUdtRecursive: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUdtRecursive { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtRecursive.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUdtRecursive { + a: arbitrary::Arbitrary::arbitrary(u)?, + b: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtRecursive.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtRecursive.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryUdtRecursive { + a: arbitrary::Arbitrary::arbitrary(&mut u)?, + b: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtRecursive.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UdtRecursive { + type Prototype = ArbitraryUdtRecursive; + } + impl soroban_sdk::TryFromVal for UdtRecursive { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUdtRecursive, + ) -> std::result::Result { + Ok(UdtRecursive { + a: soroban_sdk::IntoVal::into_val(&v.a, env), + b: soroban_sdk::IntoVal::into_val(&v.b, env), + }) + } + } + }; + pub struct RecursiveToEnum { + pub a: soroban_sdk::Symbol, + pub b: soroban_sdk::Map, + } + #[automatically_derived] + impl ::core::fmt::Debug for RecursiveToEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "RecursiveToEnum", + "a", + &self.a, + "b", + &&self.b, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for RecursiveToEnum { + #[inline] + fn clone(&self) -> RecursiveToEnum { + RecursiveToEnum { + a: ::core::clone::Clone::clone(&self.a), + b: ::core::clone::Clone::clone(&self.b), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for RecursiveToEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for RecursiveToEnum {} + #[automatically_derived] + impl ::core::cmp::PartialEq for RecursiveToEnum { + #[inline] + fn eq(&self, other: &RecursiveToEnum) -> bool { + self.a == other.a && self.b == other.b + } + } + #[automatically_derived] + impl ::core::cmp::Ord for RecursiveToEnum { + #[inline] + fn cmp(&self, other: &RecursiveToEnum) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.a, &other.a) { + ::core::cmp::Ordering::Equal => ::core::cmp::Ord::cmp(&self.b, &other.b), + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for RecursiveToEnum { + #[inline] + fn partial_cmp( + &self, + other: &RecursiveToEnum, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.a, &other.a) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.b, &other.b) + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_RECURSIVETOENUM: [u8; 96usize] = RecursiveToEnum::spec_xdr(); + impl RecursiveToEnum { + pub const fn spec_xdr() -> [u8; 96usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fRecursiveToEnum\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x11\0\0\0\0\0\0\0\x01b\0\0\0\0\0\x03\xec\0\0\0\x04\0\0\x07\xd0\0\0\0\rRecursiveEnum\0\0\0" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for RecursiveToEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"\xe1oU\xdb\xd47\x98\x14z\xb2+\xbb\xdf\xdbn\x14$\x92\xbb\xf1M\xf2\x10&P\x0c\xd1\x13J\x97Ci"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_RECURSIVETOENUM: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, + >( + 2, + *b"\xe1oU\xdb\xd47\x98\x14z\xb2+\xbb\xdf\xdbn\x14$\x92\xbb\xf1M\xf2\x10&P\x0c\xd1\x13J\x97Ci", + [::SPEC_TYPE_ID], + ); + impl soroban_sdk::TryFromVal for RecursiveToEnum { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["a", "b"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + a: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + b: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &RecursiveToEnum, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["a", "b"]; + let vals: [Val; 2usize] = [ + (&val.a).try_into_val(env).map_err(|_| ConversionError)?, + (&val.b).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&RecursiveToEnum, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + impl soroban_sdk::TryFromVal for RecursiveToEnum { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 2usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + a: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "a".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + b: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "b".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal for RecursiveToEnum { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&RecursiveToEnum> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &RecursiveToEnum) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "a".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.a) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "b".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.b) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } + } + impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: RecursiveToEnum) -> Result { + (&val).try_into() + } + } + impl TryFrom<&RecursiveToEnum> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &RecursiveToEnum) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: RecursiveToEnum) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryRecursiveToEnum { + a: ::Prototype, + b: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryRecursiveToEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "ArbitraryRecursiveToEnum", + "a", + &self.a, + "b", + &&self.b, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryRecursiveToEnum { + #[inline] + fn clone(&self) -> ArbitraryRecursiveToEnum { + ArbitraryRecursiveToEnum { + a: ::core::clone::Clone::clone(&self.a), + b: ::core::clone::Clone::clone(&self.b), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryRecursiveToEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryRecursiveToEnum {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryRecursiveToEnum { + #[inline] + fn eq(&self, other: &ArbitraryRecursiveToEnum) -> bool { + self.a == other.a && self.b == other.b + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryRecursiveToEnum { + #[inline] + fn cmp(&self, other: &ArbitraryRecursiveToEnum) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.a, &other.a) { + ::core::cmp::Ordering::Equal => ::core::cmp::Ord::cmp(&self.b, &other.b), + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryRecursiveToEnum { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryRecursiveToEnum, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.a, &other.a) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.b, &other.b) + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryRecursiveToEnum: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryRecursiveToEnum { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryRecursiveToEnum.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryRecursiveToEnum { + a: arbitrary::Arbitrary::arbitrary(u)?, + b: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryRecursiveToEnum.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryRecursiveToEnum.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryRecursiveToEnum { + a: arbitrary::Arbitrary::arbitrary(&mut u)?, + b: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryRecursiveToEnum.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for RecursiveToEnum { + type Prototype = ArbitraryRecursiveToEnum; + } + impl soroban_sdk::TryFromVal for RecursiveToEnum { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryRecursiveToEnum, + ) -> std::result::Result { + Ok(RecursiveToEnum { + a: soroban_sdk::IntoVal::into_val(&v.a, env), + b: soroban_sdk::IntoVal::into_val(&v.b, env), + }) + } + } + }; + pub struct ContractContext { + pub args: soroban_sdk::Vec, + pub contract: soroban_sdk::Address, + pub fn_name: soroban_sdk::Symbol, + } + #[automatically_derived] + impl ::core::fmt::Debug for ContractContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "ContractContext", + "args", + &self.args, + "contract", + &self.contract, + "fn_name", + &&self.fn_name, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ContractContext { + #[inline] + fn clone(&self) -> ContractContext { + ContractContext { + args: ::core::clone::Clone::clone(&self.args), + contract: ::core::clone::Clone::clone(&self.contract), + fn_name: ::core::clone::Clone::clone(&self.fn_name), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ContractContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ContractContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ContractContext { + #[inline] + fn eq(&self, other: &ContractContext) -> bool { + self.args == other.args + && self.contract == other.contract + && self.fn_name == other.fn_name + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ContractContext { + #[inline] + fn cmp(&self, other: &ContractContext) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.args, &other.args) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.contract, &other.contract) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.fn_name, &other.fn_name) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ContractContext { + #[inline] + fn partial_cmp( + &self, + other: &ContractContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.args, &other.args) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp(&self.contract, &other.contract) + { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.fn_name, &other.fn_name) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_CONTRACTCONTEXT: [u8; 96usize] = ContractContext::spec_xdr(); + impl ContractContext { + pub const fn spec_xdr() -> [u8; 96usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fContractContext\0\0\0\0\x03\0\0\0\0\0\0\0\x04args\0\0\x03\xea\0\0\0\0\0\0\0\0\0\0\0\x08contract\0\0\0\x13\0\0\0\0\0\0\0\x07fn_name\0\0\0\0\x11" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for ContractContext { + const SPEC_TYPE_ID: [u8; 32] = *b"\x03\x04uN\xea\xd7[\x13V\x9f\xd4\xbd\xc1\x8a\xd6\x7f\xd8iD\xa5B\x89qT\x0b'\xad(\xb8\x9f\x8f\x19"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CONTRACTCONTEXT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\x03\x04uN\xea\xd7[\x13V\x9f\xd4\xbd\xc1\x8a\xd6\x7f\xd8iD\xa5B\x89qT\x0b'\xad(\xb8\x9f\x8f\x19", + [], + ); + impl soroban_sdk::TryFromVal for ContractContext { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["args", "contract", "fn_name"]; + let mut vals: [Val; 3usize] = [Val::VOID.to_val(); 3usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + args: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + contract: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + fn_name: vals[2] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &ContractContext, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["args", "contract", "fn_name"]; + let vals: [Val; 3usize] = [ + (&val.args).try_into_val(env).map_err(|_| ConversionError)?, + (&val.contract) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.fn_name) + .try_into_val(env) + .map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&ContractContext, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + impl soroban_sdk::TryFromVal for ContractContext { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 3usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + args: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "args" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + contract: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "contract" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + fn_name: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "fn_name" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal for ContractContext { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&ContractContext> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &ContractContext) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "args" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.args) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "contract" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.contract) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "fn_name" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.fn_name) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } + } + impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: ContractContext) -> Result { + (&val).try_into() + } + } + impl TryFrom<&ContractContext> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &ContractContext) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: ContractContext) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryContractContext { + args: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + contract: ::Prototype, + fn_name: ::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryContractContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "ArbitraryContractContext", + "args", + &self.args, + "contract", + &self.contract, + "fn_name", + &&self.fn_name, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryContractContext { + #[inline] + fn clone(&self) -> ArbitraryContractContext { + ArbitraryContractContext { + args: ::core::clone::Clone::clone(&self.args), + contract: ::core::clone::Clone::clone(&self.contract), + fn_name: ::core::clone::Clone::clone(&self.fn_name), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryContractContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryContractContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryContractContext { + #[inline] + fn eq(&self, other: &ArbitraryContractContext) -> bool { + self.args == other.args + && self.contract == other.contract + && self.fn_name == other.fn_name + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryContractContext { + #[inline] + fn cmp(&self, other: &ArbitraryContractContext) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.args, &other.args) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.contract, &other.contract) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.fn_name, &other.fn_name) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryContractContext { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryContractContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.args, &other.args) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp( + &self.contract, + &other.contract, + ) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp( + &self.fn_name, + &other.fn_name, + ) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryContractContext: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryContractContext { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryContractContext { + args: arbitrary::Arbitrary::arbitrary(u)?, + contract: arbitrary::Arbitrary::arbitrary(u)?, + fn_name: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryContractContext { + args: arbitrary::Arbitrary::arbitrary(&mut u)?, + contract: arbitrary::Arbitrary::arbitrary(&mut u)?, + fn_name: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for ContractContext { + type Prototype = ArbitraryContractContext; + } + impl soroban_sdk::TryFromVal for ContractContext { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryContractContext, + ) -> std::result::Result { + Ok(ContractContext { + args: soroban_sdk::IntoVal::into_val(&v.args, env), + contract: soroban_sdk::IntoVal::into_val(&v.contract, env), + fn_name: soroban_sdk::IntoVal::into_val(&v.fn_name, env), + }) + } + } + }; + pub struct SubContractInvocation { + pub context: ContractContext, + pub sub_invocations: soroban_sdk::Vec, + } + #[automatically_derived] + impl ::core::fmt::Debug for SubContractInvocation { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "SubContractInvocation", + "context", + &self.context, + "sub_invocations", + &&self.sub_invocations, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for SubContractInvocation { + #[inline] + fn clone(&self) -> SubContractInvocation { + SubContractInvocation { + context: ::core::clone::Clone::clone(&self.context), + sub_invocations: ::core::clone::Clone::clone(&self.sub_invocations), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for SubContractInvocation { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for SubContractInvocation {} + #[automatically_derived] + impl ::core::cmp::PartialEq for SubContractInvocation { + #[inline] + fn eq(&self, other: &SubContractInvocation) -> bool { + self.context == other.context && self.sub_invocations == other.sub_invocations + } + } + #[automatically_derived] + impl ::core::cmp::Ord for SubContractInvocation { + #[inline] + fn cmp(&self, other: &SubContractInvocation) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.context, &other.context) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.sub_invocations, &other.sub_invocations) + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for SubContractInvocation { + #[inline] + fn partial_cmp( + &self, + other: &SubContractInvocation, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.context, &other.context) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp( + &self.sub_invocations, + &other.sub_invocations, + ) + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_SUBCONTRACTINVOCATION: [u8; 144usize] = + SubContractInvocation::spec_xdr(); + impl SubContractInvocation { + pub const fn spec_xdr() -> [u8; 144usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x15SubContractInvocation\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x07context\0\0\0\x07\xd0\0\0\0\x0fContractContext\0\0\0\0\0\0\0\0\x0fsub_invocations\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x18InvokerContractAuthEntry" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for SubContractInvocation { + const SPEC_TYPE_ID: [u8; 32] = *b" \x9d\xc5_\xba\x8fv\x18\x95\x02\xbdJ}\x97\x01KN\xd6\0\xf8\xb6\xefq\xa8j\x11\\\xc7\xd7\xd4\xcf\xf0"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_SUBCONTRACTINVOCATION: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, + >( + 2, + *b" \x9d\xc5_\xba\x8fv\x18\x95\x02\xbdJ}\x97\x01KN\xd6\0\xf8\xb6\xefq\xa8j\x11\\\xc7\xd7\xd4\xcf\xf0", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); + impl soroban_sdk::TryFromVal for SubContractInvocation { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["context", "sub_invocations"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + context: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + sub_invocations: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &SubContractInvocation, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["context", "sub_invocations"]; + let vals: [Val; 2usize] = [ + (&val.context) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.sub_invocations) + .try_into_val(env) + .map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&SubContractInvocation, + ) -> Result { + <_ as soroban_sdk::TryFromVal< + soroban_sdk::Env, + SubContractInvocation, + >>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal for SubContractInvocation { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 2usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + context: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "context" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + sub_invocations: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "sub_invocations" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal for SubContractInvocation { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&SubContractInvocation> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &SubContractInvocation) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "context" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.context) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "sub_invocations" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.sub_invocations) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } + } + impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: SubContractInvocation) -> Result { + (&val).try_into() + } + } + impl TryFrom<&SubContractInvocation> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &SubContractInvocation) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: SubContractInvocation) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitrarySubContractInvocation { + context: ::Prototype, + sub_invocations: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitrarySubContractInvocation { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "ArbitrarySubContractInvocation", + "context", + &self.context, + "sub_invocations", + &&self.sub_invocations, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitrarySubContractInvocation { + #[inline] + fn clone(&self) -> ArbitrarySubContractInvocation { + ArbitrarySubContractInvocation { + context: ::core::clone::Clone::clone(&self.context), + sub_invocations: ::core::clone::Clone::clone(&self.sub_invocations), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitrarySubContractInvocation { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitrarySubContractInvocation {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitrarySubContractInvocation { + #[inline] + fn eq(&self, other: &ArbitrarySubContractInvocation) -> bool { + self.context == other.context && self.sub_invocations == other.sub_invocations + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitrarySubContractInvocation { + #[inline] + fn cmp(&self, other: &ArbitrarySubContractInvocation) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.context, &other.context) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.sub_invocations, &other.sub_invocations) + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitrarySubContractInvocation { + #[inline] + fn partial_cmp( + &self, + other: &ArbitrarySubContractInvocation, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.context, &other.context) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp( + &self.sub_invocations, + &other.sub_invocations, + ) + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitrarySubContractInvocation: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitrarySubContractInvocation { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitrarySubContractInvocation.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitrarySubContractInvocation { + context: arbitrary::Arbitrary::arbitrary(u)?, + sub_invocations: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitrarySubContractInvocation.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitrarySubContractInvocation.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitrarySubContractInvocation { + context: arbitrary::Arbitrary::arbitrary(&mut u)?, + sub_invocations: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitrarySubContractInvocation.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for SubContractInvocation { + type Prototype = ArbitrarySubContractInvocation; + } + impl soroban_sdk::TryFromVal + for SubContractInvocation + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitrarySubContractInvocation, + ) -> std::result::Result { + Ok(SubContractInvocation { + context: soroban_sdk::IntoVal::into_val(&v.context, env), + sub_invocations: soroban_sdk::IntoVal::into_val(&v.sub_invocations, env), + }) + } + } + }; + pub struct CreateContractHostFnContext { + pub executable: ContractExecutable, + pub salt: soroban_sdk::BytesN<32>, + } + #[automatically_derived] + impl ::core::fmt::Debug for CreateContractHostFnContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "CreateContractHostFnContext", + "executable", + &self.executable, + "salt", + &&self.salt, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for CreateContractHostFnContext { + #[inline] + fn clone(&self) -> CreateContractHostFnContext { + CreateContractHostFnContext { + executable: ::core::clone::Clone::clone(&self.executable), + salt: ::core::clone::Clone::clone(&self.salt), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for CreateContractHostFnContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for CreateContractHostFnContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for CreateContractHostFnContext { + #[inline] + fn eq(&self, other: &CreateContractHostFnContext) -> bool { + self.executable == other.executable && self.salt == other.salt + } + } + #[automatically_derived] + impl ::core::cmp::Ord for CreateContractHostFnContext { + #[inline] + fn cmp(&self, other: &CreateContractHostFnContext) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.executable, &other.executable) { + ::core::cmp::Ordering::Equal => ::core::cmp::Ord::cmp(&self.salt, &other.salt), + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for CreateContractHostFnContext { + #[inline] + fn partial_cmp( + &self, + other: &CreateContractHostFnContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.executable, &other.executable) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_CREATECONTRACTHOSTFNCONTEXT: [u8; 116usize] = + CreateContractHostFnContext::spec_xdr(); + impl CreateContractHostFnContext { + pub const fn spec_xdr() -> [u8; 116usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x1bCreateContractHostFnContext\0\0\0\0\x02\0\0\0\0\0\0\0\nexecutable\0\0\0\0\x07\xd0\0\0\0\x12ContractExecutable\0\0\0\0\0\0\0\0\0\x04salt\0\0\x03\xee\0\0\0 " + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for CreateContractHostFnContext { + const SPEC_TYPE_ID: [u8; 32] = *b"\xe1\"T\xf0&\x19?P\xad\xa3\xa0\xd2\xf1\xea\xf8~\xde\xe7\x12\xe5_&\xb62Cl\xc8x\xcc.\xd4\xcd"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CREATECONTRACTHOSTFNCONTEXT: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, + >( + 2, + *b"\xe1\"T\xf0&\x19?P\xad\xa3\xa0\xd2\xf1\xea\xf8~\xde\xe7\x12\xe5_&\xb62Cl\xc8x\xcc.\xd4\xcd", + [::SPEC_TYPE_ID], + ); + impl soroban_sdk::TryFromVal for CreateContractHostFnContext { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["executable", "salt"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + executable: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + salt: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &CreateContractHostFnContext, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["executable", "salt"]; + let vals: [Val; 2usize] = [ + (&val.executable) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.salt).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&CreateContractHostFnContext, + ) -> Result { + <_ as soroban_sdk::TryFromVal< + soroban_sdk::Env, + CreateContractHostFnContext, + >>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal + for CreateContractHostFnContext + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 2usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + executable: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "executable" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + salt: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "salt" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal + for CreateContractHostFnContext + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&CreateContractHostFnContext> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: &CreateContractHostFnContext, + ) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "executable" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.executable) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "salt" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.salt) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } + } + impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: CreateContractHostFnContext) -> Result { + (&val).try_into() + } + } + impl TryFrom<&CreateContractHostFnContext> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: &CreateContractHostFnContext, + ) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: CreateContractHostFnContext) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryCreateContractHostFnContext { + executable: ::Prototype, + salt: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryCreateContractHostFnContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "ArbitraryCreateContractHostFnContext", + "executable", + &self.executable, + "salt", + &&self.salt, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryCreateContractHostFnContext { + #[inline] + fn clone(&self) -> ArbitraryCreateContractHostFnContext { + ArbitraryCreateContractHostFnContext { + executable: ::core::clone::Clone::clone(&self.executable), + salt: ::core::clone::Clone::clone(&self.salt), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryCreateContractHostFnContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryCreateContractHostFnContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryCreateContractHostFnContext { + #[inline] + fn eq(&self, other: &ArbitraryCreateContractHostFnContext) -> bool { + self.executable == other.executable && self.salt == other.salt + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryCreateContractHostFnContext { + #[inline] + fn cmp( + &self, + other: &ArbitraryCreateContractHostFnContext, + ) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.executable, &other.executable) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryCreateContractHostFnContext { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryCreateContractHostFnContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.executable, &other.executable) + { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext: + ::std::thread::LocalKey> = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryCreateContractHostFnContext { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryCreateContractHostFnContext { + executable: arbitrary::Arbitrary::arbitrary(u)?, + salt: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryCreateContractHostFnContext { + executable: arbitrary::Arbitrary::arbitrary(&mut u)?, + salt: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractHostFnContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for CreateContractHostFnContext { + type Prototype = ArbitraryCreateContractHostFnContext; + } + impl soroban_sdk::TryFromVal + for CreateContractHostFnContext + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryCreateContractHostFnContext, + ) -> std::result::Result { + Ok(CreateContractHostFnContext { + executable: soroban_sdk::IntoVal::into_val(&v.executable, env), + salt: soroban_sdk::IntoVal::into_val(&v.salt, env), + }) + } + } + }; + pub struct CreateContractWithConstructorHostFnContext { + pub constructor_args: soroban_sdk::Vec, + pub executable: ContractExecutable, + pub salt: soroban_sdk::BytesN<32>, + } + #[automatically_derived] + impl ::core::fmt::Debug for CreateContractWithConstructorHostFnContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "CreateContractWithConstructorHostFnContext", + "constructor_args", + &self.constructor_args, + "executable", + &self.executable, + "salt", + &&self.salt, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for CreateContractWithConstructorHostFnContext { + #[inline] + fn clone(&self) -> CreateContractWithConstructorHostFnContext { + CreateContractWithConstructorHostFnContext { + constructor_args: ::core::clone::Clone::clone(&self.constructor_args), + executable: ::core::clone::Clone::clone(&self.executable), + salt: ::core::clone::Clone::clone(&self.salt), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for CreateContractWithConstructorHostFnContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for CreateContractWithConstructorHostFnContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for CreateContractWithConstructorHostFnContext { + #[inline] + fn eq(&self, other: &CreateContractWithConstructorHostFnContext) -> bool { + self.constructor_args == other.constructor_args + && self.executable == other.executable + && self.salt == other.salt + } + } + #[automatically_derived] + impl ::core::cmp::Ord for CreateContractWithConstructorHostFnContext { + #[inline] + fn cmp( + &self, + other: &CreateContractWithConstructorHostFnContext, + ) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.constructor_args, &other.constructor_args) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.executable, &other.executable) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for CreateContractWithConstructorHostFnContext { + #[inline] + fn partial_cmp( + &self, + other: &CreateContractWithConstructorHostFnContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp( + &self.constructor_args, + &other.constructor_args, + ) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp( + &self.executable, + &other.executable, + ) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + pub static __SPEC_XDR_TYPE_CREATECONTRACTWITHCONSTRUCTORHOSTFNCONTEXT: [u8; 164usize] = + CreateContractWithConstructorHostFnContext::spec_xdr(); + impl CreateContractWithConstructorHostFnContext { + pub const fn spec_xdr() -> [u8; 164usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0*CreateContractWithConstructorHostFnContext\0\0\0\0\0\x03\0\0\0\0\0\0\0\x10constructor_args\0\0\x03\xea\0\0\0\0\0\0\0\0\0\0\0\nexecutable\0\0\0\0\x07\xd0\0\0\0\x12ContractExecutable\0\0\0\0\0\0\0\0\0\x04salt\0\0\x03\xee\0\0\0 " + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for CreateContractWithConstructorHostFnContext { + const SPEC_TYPE_ID: [u8; 32] = *b"\xd2;\xff\xe6\x97\xda;\x83c$F\x15Z\xf1r\xf4\xc18\xfda!\x0b\r\x87\x88\xa0\x9a\x08Yu\xccS"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CREATECONTRACTWITHCONSTRUCTORHOSTFNCONTEXT: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, + >( + 2, + *b"\xd2;\xff\xe6\x97\xda;\x83c$F\x15Z\xf1r\xf4\xc18\xfda!\x0b\r\x87\x88\xa0\x9a\x08Yu\xccS", + [::SPEC_TYPE_ID], + ); + impl soroban_sdk::TryFromVal + for CreateContractWithConstructorHostFnContext + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["constructor_args", "executable", "salt"]; + let mut vals: [Val; 3usize] = [Val::VOID.to_val(); 3usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + constructor_args: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + executable: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + salt: vals[2] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } + } + impl soroban_sdk::TryFromVal + for soroban_sdk::Val + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &CreateContractWithConstructorHostFnContext, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 3usize] = ["constructor_args", "executable", "salt"]; + let vals: [Val; 3usize] = [ + (&val.constructor_args) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.executable) + .try_into_val(env) + .map_err(|_| ConversionError)?, + (&val.salt).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } + } + impl soroban_sdk::TryFromVal + for soroban_sdk::Val + { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&CreateContractWithConstructorHostFnContext, + ) -> Result { + <_ as soroban_sdk::TryFromVal< + soroban_sdk::Env, + CreateContractWithConstructorHostFnContext, + >>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal + for CreateContractWithConstructorHostFnContext + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 3usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + constructor_args: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "constructor_args" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + executable: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "executable" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + salt: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "salt" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } + } + impl soroban_sdk::TryFromVal + for CreateContractWithConstructorHostFnContext + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&CreateContractWithConstructorHostFnContext> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: &CreateContractWithConstructorHostFnContext, + ) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "constructor_args" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.constructor_args) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "executable" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.executable) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "salt" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.salt) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } + } + impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: CreateContractWithConstructorHostFnContext, + ) -> Result { + (&val).try_into() + } + } + impl TryFrom<&CreateContractWithConstructorHostFnContext> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: &CreateContractWithConstructorHostFnContext, + ) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from( + val: CreateContractWithConstructorHostFnContext, + ) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryCreateContractWithConstructorHostFnContext { + constructor_args: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + executable: ::Prototype, + salt: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field3_finish( + f, + "ArbitraryCreateContractWithConstructorHostFnContext", + "constructor_args", + &self.constructor_args, + "executable", + &self.executable, + "salt", + &&self.salt, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn clone(&self) -> ArbitraryCreateContractWithConstructorHostFnContext { + ArbitraryCreateContractWithConstructorHostFnContext { + constructor_args: ::core::clone::Clone::clone(&self.constructor_args), + executable: ::core::clone::Clone::clone(&self.executable), + salt: ::core::clone::Clone::clone(&self.salt), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryCreateContractWithConstructorHostFnContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn eq(&self, other: &ArbitraryCreateContractWithConstructorHostFnContext) -> bool { + self.constructor_args == other.constructor_args + && self.executable == other.executable + && self.salt == other.salt + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn cmp( + &self, + other: &ArbitraryCreateContractWithConstructorHostFnContext, + ) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.constructor_args, &other.constructor_args) { + ::core::cmp::Ordering::Equal => { + match ::core::cmp::Ord::cmp(&self.executable, &other.executable) { + ::core::cmp::Ordering::Equal => { + ::core::cmp::Ord::cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryCreateContractWithConstructorHostFnContext { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryCreateContractWithConstructorHostFnContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp( + &self.constructor_args, + &other.constructor_args, + ) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + match ::core::cmp::PartialOrd::partial_cmp( + &self.executable, + &other.executable, + ) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.salt, &other.salt) + } + cmp => cmp, + } + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext: + ::std::thread::LocalKey> = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> + for ArbitraryCreateContractWithConstructorHostFnContext + { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext + .with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryCreateContractWithConstructorHostFnContext { + constructor_args: arbitrary::Arbitrary::arbitrary(u)?, + executable: arbitrary::Arbitrary::arbitrary(u)?, + salt: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext + .with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext + .with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryCreateContractWithConstructorHostFnContext { + constructor_args: arbitrary::Arbitrary::arbitrary(&mut u)?, + executable: arbitrary::Arbitrary::arbitrary(&mut u)?, + salt: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryCreateContractWithConstructorHostFnContext + .with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary + for CreateContractWithConstructorHostFnContext + { + type Prototype = ArbitraryCreateContractWithConstructorHostFnContext; + } + impl + soroban_sdk::TryFromVal< + soroban_sdk::Env, + ArbitraryCreateContractWithConstructorHostFnContext, + > for CreateContractWithConstructorHostFnContext + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryCreateContractWithConstructorHostFnContext, + ) -> std::result::Result { + Ok(CreateContractWithConstructorHostFnContext { + constructor_args: soroban_sdk::IntoVal::into_val(&v.constructor_args, env), + executable: soroban_sdk::IntoVal::into_val(&v.executable, env), + salt: soroban_sdk::IntoVal::into_val(&v.salt, env), + }) + } + } + }; + pub enum UdtEnum { + UdtA, + UdtB(UdtStruct), + UdtC(UdtEnum2), + UdtD(UdtTuple), + } + #[automatically_derived] + impl ::core::fmt::Debug for UdtEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + UdtEnum::UdtA => ::core::fmt::Formatter::write_str(f, "UdtA"), + UdtEnum::UdtB(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "UdtB", &__self_0) + } + UdtEnum::UdtC(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "UdtC", &__self_0) + } + UdtEnum::UdtD(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "UdtD", &__self_0) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for UdtEnum { + #[inline] + fn clone(&self) -> UdtEnum { + match self { + UdtEnum::UdtA => UdtEnum::UdtA, + UdtEnum::UdtB(__self_0) => UdtEnum::UdtB(::core::clone::Clone::clone(__self_0)), + UdtEnum::UdtC(__self_0) => UdtEnum::UdtC(::core::clone::Clone::clone(__self_0)), + UdtEnum::UdtD(__self_0) => UdtEnum::UdtD(::core::clone::Clone::clone(__self_0)), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for UdtEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for UdtEnum {} + #[automatically_derived] + impl ::core::cmp::PartialEq for UdtEnum { + #[inline] + fn eq(&self, other: &UdtEnum) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + (UdtEnum::UdtB(__self_0), UdtEnum::UdtB(__arg1_0)) => __self_0 == __arg1_0, + (UdtEnum::UdtC(__self_0), UdtEnum::UdtC(__arg1_0)) => __self_0 == __arg1_0, + (UdtEnum::UdtD(__self_0), UdtEnum::UdtD(__arg1_0)) => __self_0 == __arg1_0, + _ => true, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for UdtEnum { + #[inline] + fn cmp(&self, other: &UdtEnum) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + (UdtEnum::UdtB(__self_0), UdtEnum::UdtB(__arg1_0)) => { + ::core::cmp::Ord::cmp(__self_0, __arg1_0) + } + (UdtEnum::UdtC(__self_0), UdtEnum::UdtC(__arg1_0)) => { + ::core::cmp::Ord::cmp(__self_0, __arg1_0) + } + (UdtEnum::UdtD(__self_0), UdtEnum::UdtD(__arg1_0)) => { + ::core::cmp::Ord::cmp(__self_0, __arg1_0) + } + _ => ::core::cmp::Ordering::Equal, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for UdtEnum { + #[inline] + fn partial_cmp( + &self, + other: &UdtEnum, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + (UdtEnum::UdtB(__self_0), UdtEnum::UdtB(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + (UdtEnum::UdtC(__self_0), UdtEnum::UdtC(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + (UdtEnum::UdtD(__self_0), UdtEnum::UdtD(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + pub static __SPEC_XDR_TYPE_UDTENUM: [u8; 156usize] = UdtEnum::spec_xdr(); + impl UdtEnum { + pub const fn spec_xdr() -> [u8; 156usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x07UdtEnum\0\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x04UdtA\0\0\0\x01\0\0\0\0\0\0\0\x04UdtB\0\0\0\x01\0\0\x07\xd0\0\0\0\tUdtStruct\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04UdtC\0\0\0\x01\0\0\x07\xd0\0\0\0\x08UdtEnum2\0\0\0\x01\0\0\0\0\0\0\0\x04UdtD\0\0\0\x01\0\0\x07\xd0\0\0\0\x08UdtTuple" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for UdtEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"\xf3\xb0\xab@i\rH\xb4\x81\x9c\x94|?A\xef\xcf\xf3%Q\xd5\x8b\x90\xb2B\x18\xfb\x8c>\xaa\x8c^2"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_UDTENUM: [u8; 138usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 138usize, + 3usize, + >( + 2, + *b"\xf3\xb0\xab@i\rH\xb4\x81\x9c\x94|?A\xef\xcf\xf3%Q\xd5\x8b\x90\xb2B\x18\xfb\x8c>\xaa\x8c^2", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); + impl soroban_sdk::TryFromVal for UdtEnum { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["UdtA", "UdtB", "UdtC", "UdtD"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 0 { + return Err(soroban_sdk::ConversionError); + } + Self::UdtA + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::UdtB( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 2 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::UdtC( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 3 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::UdtD( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UdtEnum, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + UdtEnum::UdtA => { + let tup: (soroban_sdk::Val,) = + (soroban_sdk::Symbol::try_from_val(env, &"UdtA")?.to_val(),); + tup.try_into_val(env).map_err(Into::into) + } + UdtEnum::UdtB(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"UdtB")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + UdtEnum::UdtC(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"UdtC")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + UdtEnum::UdtD(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"UdtD")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UdtEnum, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal for UdtEnum { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "UdtA" => { + if iter.len() > 0 { + return Err(soroban_sdk::xdr::Error::Invalid); + } + Self::UdtA + } + "UdtB" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::UdtB( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "UdtC" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::UdtC( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "UdtD" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::UdtD( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl soroban_sdk::TryFromVal for UdtEnum { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&UdtEnum> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UdtEnum) -> Result { + extern crate alloc; + Ok(match val { + UdtEnum::UdtA => { + let symbol = soroban_sdk::xdr::ScSymbol( + "UdtA" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ); + let val = soroban_sdk::xdr::ScVal::Symbol(symbol); + (val,) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + } + UdtEnum::UdtB(value0) => ( + soroban_sdk::xdr::ScSymbol( + "UdtB" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + UdtEnum::UdtC(value0) => ( + soroban_sdk::xdr::ScSymbol( + "UdtC" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + UdtEnum::UdtD(value0) => ( + soroban_sdk::xdr::ScSymbol( + "UdtD" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UdtEnum) -> Result { + (&val).try_into() + } + } + impl TryFrom<&UdtEnum> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &UdtEnum) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: UdtEnum) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryUdtEnum { + UdtA, + UdtB(::Prototype), + UdtC(::Prototype), + UdtD(::Prototype), + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUdtEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryUdtEnum::UdtA => ::core::fmt::Formatter::write_str(f, "UdtA"), + ArbitraryUdtEnum::UdtB(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "UdtB", &__self_0) + } + ArbitraryUdtEnum::UdtC(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "UdtC", &__self_0) + } + ArbitraryUdtEnum::UdtD(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "UdtD", &__self_0) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUdtEnum { + #[inline] + fn clone(&self) -> ArbitraryUdtEnum { + match self { + ArbitraryUdtEnum::UdtA => ArbitraryUdtEnum::UdtA, + ArbitraryUdtEnum::UdtB(__self_0) => { + ArbitraryUdtEnum::UdtB(::core::clone::Clone::clone(__self_0)) + } + ArbitraryUdtEnum::UdtC(__self_0) => { + ArbitraryUdtEnum::UdtC(::core::clone::Clone::clone(__self_0)) + } + ArbitraryUdtEnum::UdtD(__self_0) => { + ArbitraryUdtEnum::UdtD(::core::clone::Clone::clone(__self_0)) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUdtEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUdtEnum {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUdtEnum { + #[inline] + fn eq(&self, other: &ArbitraryUdtEnum) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + ArbitraryUdtEnum::UdtB(__self_0), + ArbitraryUdtEnum::UdtB(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryUdtEnum::UdtC(__self_0), + ArbitraryUdtEnum::UdtC(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryUdtEnum::UdtD(__self_0), + ArbitraryUdtEnum::UdtD(__arg1_0), + ) => __self_0 == __arg1_0, + _ => true, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUdtEnum { + #[inline] + fn cmp(&self, other: &ArbitraryUdtEnum) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + ArbitraryUdtEnum::UdtB(__self_0), + ArbitraryUdtEnum::UdtB(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryUdtEnum::UdtC(__self_0), + ArbitraryUdtEnum::UdtC(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryUdtEnum::UdtD(__self_0), + ArbitraryUdtEnum::UdtD(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => ::core::cmp::Ordering::Equal, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUdtEnum { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUdtEnum, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + (ArbitraryUdtEnum::UdtB(__self_0), ArbitraryUdtEnum::UdtB(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + (ArbitraryUdtEnum::UdtC(__self_0), ArbitraryUdtEnum::UdtC(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + (ArbitraryUdtEnum::UdtD(__self_0), ArbitraryUdtEnum::UdtD(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUdtEnum: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUdtEnum { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtEnum.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) + * 4u64) + >> 32 + { + 0u64 => ArbitraryUdtEnum::UdtA, + 1u64 => { + ArbitraryUdtEnum::UdtB(arbitrary::Arbitrary::arbitrary(u)?) + } + 2u64 => { + ArbitraryUdtEnum::UdtC(arbitrary::Arbitrary::arbitrary(u)?) + } + 3u64 => { + ArbitraryUdtEnum::UdtD(arbitrary::Arbitrary::arbitrary(u)?) + } + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtEnum.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtEnum.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) + * 4u64) + >> 32 + { + 0u64 => ArbitraryUdtEnum::UdtA, + 1u64 => ArbitraryUdtEnum::UdtB( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 2u64 => ArbitraryUdtEnum::UdtC( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 3u64 => ArbitraryUdtEnum::UdtD( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtEnum.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all(&[]), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UdtEnum { + type Prototype = ArbitraryUdtEnum; + } + impl soroban_sdk::TryFromVal for UdtEnum { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUdtEnum, + ) -> std::result::Result { + Ok(match v { + ArbitraryUdtEnum::UdtA => UdtEnum::UdtA, + ArbitraryUdtEnum::UdtB(field_0) => { + UdtEnum::UdtB(soroban_sdk::IntoVal::into_val(field_0, env)) + } + ArbitraryUdtEnum::UdtC(field_0) => { + UdtEnum::UdtC(soroban_sdk::IntoVal::into_val(field_0, env)) + } + ArbitraryUdtEnum::UdtD(field_0) => { + UdtEnum::UdtD(soroban_sdk::IntoVal::into_val(field_0, env)) + } + }) + } + } + }; + pub enum RecursiveEnum { + NotRecursive, + Recursive(RecursiveToEnum), + } + #[automatically_derived] + impl ::core::fmt::Debug for RecursiveEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + RecursiveEnum::NotRecursive => { + ::core::fmt::Formatter::write_str(f, "NotRecursive") + } + RecursiveEnum::Recursive(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Recursive", &__self_0) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for RecursiveEnum { + #[inline] + fn clone(&self) -> RecursiveEnum { + match self { + RecursiveEnum::NotRecursive => RecursiveEnum::NotRecursive, + RecursiveEnum::Recursive(__self_0) => { + RecursiveEnum::Recursive(::core::clone::Clone::clone(__self_0)) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for RecursiveEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for RecursiveEnum {} + #[automatically_derived] + impl ::core::cmp::PartialEq for RecursiveEnum { + #[inline] + fn eq(&self, other: &RecursiveEnum) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + RecursiveEnum::Recursive(__self_0), + RecursiveEnum::Recursive(__arg1_0), + ) => __self_0 == __arg1_0, + _ => true, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for RecursiveEnum { + #[inline] + fn cmp(&self, other: &RecursiveEnum) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + RecursiveEnum::Recursive(__self_0), + RecursiveEnum::Recursive(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => ::core::cmp::Ordering::Equal, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for RecursiveEnum { + #[inline] + fn partial_cmp( + &self, + other: &RecursiveEnum, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + (RecursiveEnum::Recursive(__self_0), RecursiveEnum::Recursive(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + pub static __SPEC_XDR_TYPE_RECURSIVEENUM: [u8; 112usize] = RecursiveEnum::spec_xdr(); + impl RecursiveEnum { + pub const fn spec_xdr() -> [u8; 112usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\rRecursiveEnum\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x0cNotRecursive\0\0\0\x01\0\0\0\0\0\0\0\tRecursive\0\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x0fRecursiveToEnum\0" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for RecursiveEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"\xff{V \xab\r\xdcd\xe7~\x19\x83<\xc27t\xc6\x9d=\x9f\x8f\x12\x0e\x18>%\x08\x89.&\0M"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_RECURSIVEENUM: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, + >( + 2, + *b"\xff{V \xab\r\xdcd\xe7~\x19\x83<\xc27t\xc6\x9d=\x9f\x8f\x12\x0e\x18>%\x08\x89.&\0M", + [::SPEC_TYPE_ID], + ); + impl soroban_sdk::TryFromVal for RecursiveEnum { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["NotRecursive", "Recursive"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 0 { + return Err(soroban_sdk::ConversionError); + } + Self::NotRecursive + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Recursive( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &RecursiveEnum, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + RecursiveEnum::NotRecursive => { + let tup: (soroban_sdk::Val,) = + (soroban_sdk::Symbol::try_from_val(env, &"NotRecursive")?.to_val(),); + tup.try_into_val(env).map_err(Into::into) + } + RecursiveEnum::Recursive(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Recursive")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&RecursiveEnum, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + impl soroban_sdk::TryFromVal for RecursiveEnum { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "NotRecursive" => { + if iter.len() > 0 { + return Err(soroban_sdk::xdr::Error::Invalid); + } + Self::NotRecursive + } + "Recursive" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::Recursive( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl soroban_sdk::TryFromVal for RecursiveEnum { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&RecursiveEnum> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &RecursiveEnum) -> Result { + extern crate alloc; + Ok(match val { + RecursiveEnum::NotRecursive => { + let symbol = soroban_sdk::xdr::ScSymbol( + "NotRecursive" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ); + let val = soroban_sdk::xdr::ScVal::Symbol(symbol); + (val,) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + } + RecursiveEnum::Recursive(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Recursive" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: RecursiveEnum) -> Result { + (&val).try_into() + } + } + impl TryFrom<&RecursiveEnum> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &RecursiveEnum) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: RecursiveEnum) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryRecursiveEnum { + NotRecursive, + Recursive( + ::Prototype, + ), + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryRecursiveEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryRecursiveEnum::NotRecursive => { + ::core::fmt::Formatter::write_str(f, "NotRecursive") + } + ArbitraryRecursiveEnum::Recursive(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "Recursive", + &__self_0, + ) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryRecursiveEnum { + #[inline] + fn clone(&self) -> ArbitraryRecursiveEnum { + match self { + ArbitraryRecursiveEnum::NotRecursive => { + ArbitraryRecursiveEnum::NotRecursive + } + ArbitraryRecursiveEnum::Recursive(__self_0) => { + ArbitraryRecursiveEnum::Recursive(::core::clone::Clone::clone(__self_0)) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryRecursiveEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryRecursiveEnum {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryRecursiveEnum { + #[inline] + fn eq(&self, other: &ArbitraryRecursiveEnum) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + ArbitraryRecursiveEnum::Recursive(__self_0), + ArbitraryRecursiveEnum::Recursive(__arg1_0), + ) => __self_0 == __arg1_0, + _ => true, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryRecursiveEnum { + #[inline] + fn cmp(&self, other: &ArbitraryRecursiveEnum) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + ArbitraryRecursiveEnum::Recursive(__self_0), + ArbitraryRecursiveEnum::Recursive(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => ::core::cmp::Ordering::Equal, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryRecursiveEnum { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryRecursiveEnum, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + ArbitraryRecursiveEnum::Recursive(__self_0), + ArbitraryRecursiveEnum::Recursive(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryRecursiveEnum: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryRecursiveEnum { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryRecursiveEnum.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) + * 2u64) + >> 32 + { + 0u64 => ArbitraryRecursiveEnum::NotRecursive, + 1u64 => ArbitraryRecursiveEnum::Recursive( + arbitrary::Arbitrary::arbitrary(u)?, + ), + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryRecursiveEnum.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryRecursiveEnum.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) + * 2u64) + >> 32 + { + 0u64 => ArbitraryRecursiveEnum::NotRecursive, + 1u64 => ArbitraryRecursiveEnum::Recursive( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryRecursiveEnum.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all(&[]), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for RecursiveEnum { + type Prototype = ArbitraryRecursiveEnum; + } + impl soroban_sdk::TryFromVal for RecursiveEnum { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryRecursiveEnum, + ) -> std::result::Result { + Ok(match v { + ArbitraryRecursiveEnum::NotRecursive => RecursiveEnum::NotRecursive, + ArbitraryRecursiveEnum::Recursive(field_0) => { + RecursiveEnum::Recursive(soroban_sdk::IntoVal::into_val(field_0, env)) + } + }) + } + } + }; + pub enum Context { + Contract(ContractContext), + CreateContractHostFn(CreateContractHostFnContext), + CreateContractWithCtorHostFn(CreateContractWithConstructorHostFnContext), + } + #[automatically_derived] + impl ::core::fmt::Debug for Context { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + Context::Contract(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Contract", &__self_0) + } + Context::CreateContractHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractHostFn", + &__self_0, + ) + } + Context::CreateContractWithCtorHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractWithCtorHostFn", + &__self_0, + ) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for Context { + #[inline] + fn clone(&self) -> Context { + match self { + Context::Contract(__self_0) => { + Context::Contract(::core::clone::Clone::clone(__self_0)) + } + Context::CreateContractHostFn(__self_0) => { + Context::CreateContractHostFn(::core::clone::Clone::clone(__self_0)) + } + Context::CreateContractWithCtorHostFn(__self_0) => { + Context::CreateContractWithCtorHostFn(::core::clone::Clone::clone(__self_0)) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for Context { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for Context {} + #[automatically_derived] + impl ::core::cmp::PartialEq for Context { + #[inline] + fn eq(&self, other: &Context) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + (Context::Contract(__self_0), Context::Contract(__arg1_0)) => { + __self_0 == __arg1_0 + } + ( + Context::CreateContractHostFn(__self_0), + Context::CreateContractHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + ( + Context::CreateContractWithCtorHostFn(__self_0), + Context::CreateContractWithCtorHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for Context { + #[inline] + fn cmp(&self, other: &Context) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + (Context::Contract(__self_0), Context::Contract(__arg1_0)) => { + ::core::cmp::Ord::cmp(__self_0, __arg1_0) + } + ( + Context::CreateContractHostFn(__self_0), + Context::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + Context::CreateContractWithCtorHostFn(__self_0), + Context::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for Context { + #[inline] + fn partial_cmp( + &self, + other: &Context, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + (Context::Contract(__self_0), Context::Contract(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + ( + Context::CreateContractHostFn(__self_0), + Context::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + Context::CreateContractWithCtorHostFn(__self_0), + Context::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + pub static __SPEC_XDR_TYPE_CONTEXT: [u8; 244usize] = Context::spec_xdr(); + impl Context { + pub const fn spec_xdr() -> [u8; 244usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x07Context\0\0\0\0\x03\0\0\0\x01\0\0\0\0\0\0\0\x08Contract\0\0\0\x01\0\0\x07\xd0\0\0\0\x0fContractContext\0\0\0\0\x01\0\0\0\0\0\0\0\x14CreateContractHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0\x1bCreateContractHostFnContext\0\0\0\0\x01\0\0\0\0\0\0\0\x1cCreateContractWithCtorHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0*CreateContractWithConstructorHostFnContext\0\0" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for Context { + const SPEC_TYPE_ID: [u8; 32] = *b"\r\xb6\x0b\xec\x8f\xd04l1\xb3-\xa0{\x90\xa3\xc2\xab\x93\xd4\x82x\xe1_\x8a\xa8N?.\xcd\xc1\xfc\x08"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CONTEXT: [u8; 138usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 138usize, + 3usize, + >( + 2, + *b"\r\xb6\x0b\xec\x8f\xd04l1\xb3-\xa0{\x90\xa3\xc2\xab\x93\xd4\x82x\xe1_\x8a\xa8N?.\xcd\xc1\xfc\x08", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); + impl soroban_sdk::TryFromVal for Context { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &[ + "Contract", + "CreateContractHostFn", + "CreateContractWithCtorHostFn", + ]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Contract( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 2 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractWithCtorHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &Context, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + Context::Contract(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Contract")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + Context::CreateContractHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"CreateContractHostFn")? + .to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + Context::CreateContractWithCtorHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val( + env, + &"CreateContractWithCtorHostFn", + )? + .to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&Context, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal for Context { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "Contract" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::Contract( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "CreateContractHostFn" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::CreateContractHostFn( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "CreateContractWithCtorHostFn" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::CreateContractWithCtorHostFn( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl soroban_sdk::TryFromVal for Context { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&Context> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &Context) -> Result { + extern crate alloc; + Ok(match val { + Context::Contract(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Contract" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + Context::CreateContractHostFn(value0) => ( + soroban_sdk::xdr::ScSymbol( + "CreateContractHostFn" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + Context::CreateContractWithCtorHostFn(value0) => ( + soroban_sdk::xdr::ScSymbol( + "CreateContractWithCtorHostFn" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Context) -> Result { + (&val).try_into() + } + } + impl TryFrom<&Context> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &Context) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Context) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryContext { + Contract( + ::Prototype, + ), + CreateContractHostFn( + ::Prototype, + ), + CreateContractWithCtorHostFn( + ::Prototype, + ), + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryContext { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryContext::Contract(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, "Contract", &__self_0, + ) + } + ArbitraryContext::CreateContractHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractHostFn", + &__self_0, + ) + } + ArbitraryContext::CreateContractWithCtorHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractWithCtorHostFn", + &__self_0, + ) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryContext { + #[inline] + fn clone(&self) -> ArbitraryContext { + match self { + ArbitraryContext::Contract(__self_0) => { + ArbitraryContext::Contract(::core::clone::Clone::clone(__self_0)) + } + ArbitraryContext::CreateContractHostFn(__self_0) => { + ArbitraryContext::CreateContractHostFn(::core::clone::Clone::clone( + __self_0, + )) + } + ArbitraryContext::CreateContractWithCtorHostFn(__self_0) => { + ArbitraryContext::CreateContractWithCtorHostFn( + ::core::clone::Clone::clone(__self_0), + ) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryContext { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryContext {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryContext { + #[inline] + fn eq(&self, other: &ArbitraryContext) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + ArbitraryContext::Contract(__self_0), + ArbitraryContext::Contract(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryContext::CreateContractHostFn(__self_0), + ArbitraryContext::CreateContractHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryContext::CreateContractWithCtorHostFn(__self_0), + ArbitraryContext::CreateContractWithCtorHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryContext { + #[inline] + fn cmp(&self, other: &ArbitraryContext) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + ArbitraryContext::Contract(__self_0), + ArbitraryContext::Contract(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryContext::CreateContractHostFn(__self_0), + ArbitraryContext::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryContext::CreateContractWithCtorHostFn(__self_0), + ArbitraryContext::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryContext { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryContext, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + ArbitraryContext::Contract(__self_0), + ArbitraryContext::Contract(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + ArbitraryContext::CreateContractHostFn(__self_0), + ArbitraryContext::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + ArbitraryContext::CreateContractWithCtorHostFn(__self_0), + ArbitraryContext::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryContext: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryContext { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) + * 3u64) + >> 32 + { + 0u64 => ArbitraryContext::Contract( + arbitrary::Arbitrary::arbitrary(u)?, + ), + 1u64 => ArbitraryContext::CreateContractHostFn( + arbitrary::Arbitrary::arbitrary(u)?, + ), + 2u64 => ArbitraryContext::CreateContractWithCtorHostFn( + arbitrary::Arbitrary::arbitrary(u)?, + ), + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) + * 3u64) + >> 32 + { + 0u64 => ArbitraryContext::Contract( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 1u64 => ArbitraryContext::CreateContractHostFn( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 2u64 => ArbitraryContext::CreateContractWithCtorHostFn( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContext.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for Context { + type Prototype = ArbitraryContext; + } + impl soroban_sdk::TryFromVal for Context { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryContext, + ) -> std::result::Result { + Ok(match v { + ArbitraryContext::Contract(field_0) => { + Context::Contract(soroban_sdk::IntoVal::into_val(field_0, env)) + } + ArbitraryContext::CreateContractHostFn(field_0) => { + Context::CreateContractHostFn(soroban_sdk::IntoVal::into_val( + field_0, env, + )) + } + ArbitraryContext::CreateContractWithCtorHostFn(field_0) => { + Context::CreateContractWithCtorHostFn(soroban_sdk::IntoVal::into_val( + field_0, env, + )) + } + }) + } + } + }; + pub enum ContractExecutable { + Wasm(soroban_sdk::BytesN<32>), + } + #[automatically_derived] + impl ::core::fmt::Debug for ContractExecutable { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ContractExecutable::Wasm(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm", &__self_0) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ContractExecutable { + #[inline] + fn clone(&self) -> ContractExecutable { + match self { + ContractExecutable::Wasm(__self_0) => { + ContractExecutable::Wasm(::core::clone::Clone::clone(__self_0)) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ContractExecutable { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ContractExecutable {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ContractExecutable { + #[inline] + fn eq(&self, other: &ContractExecutable) -> bool { + match (self, other) { + (ContractExecutable::Wasm(__self_0), ContractExecutable::Wasm(__arg1_0)) => { + __self_0 == __arg1_0 + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ContractExecutable { + #[inline] + fn cmp(&self, other: &ContractExecutable) -> ::core::cmp::Ordering { + match (self, other) { + (ContractExecutable::Wasm(__self_0), ContractExecutable::Wasm(__arg1_0)) => { + ::core::cmp::Ord::cmp(__self_0, __arg1_0) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ContractExecutable { + #[inline] + fn partial_cmp( + &self, + other: &ContractExecutable, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match (self, other) { + (ContractExecutable::Wasm(__self_0), ContractExecutable::Wasm(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + } + } + } + pub static __SPEC_XDR_TYPE_CONTRACTEXECUTABLE: [u8; 68usize] = + ContractExecutable::spec_xdr(); + impl ContractExecutable { + pub const fn spec_xdr() -> [u8; 68usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x12ContractExecutable\0\0\0\0\0\x01\0\0\0\x01\0\0\0\0\0\0\0\x04Wasm\0\0\0\x01\0\0\x03\xee\0\0\0 " + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for ContractExecutable { + const SPEC_TYPE_ID: [u8; 32] = *b"^\xbe34\xd8\x99\x84\x91\x81\x9fu\x9fu\x05\xb8\xb4\x14\x95\xb7\x9d|\x06$\x04y\xe9\"\xb9\x14\xfc\xf9\x85"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_CONTRACTEXECUTABLE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"^\xbe34\xd8\x99\x84\x91\x81\x9fu\x9fu\x05\xb8\xb4\x14\x95\xb7\x9d|\x06$\x04y\xe9\"\xb9\x14\xfc\xf9\x85", + [], + ); + impl soroban_sdk::TryFromVal for ContractExecutable { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["Wasm"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Wasm( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &ContractExecutable, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + ContractExecutable::Wasm(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Wasm")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&ContractExecutable, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + impl soroban_sdk::TryFromVal for ContractExecutable { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "Wasm" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::Wasm( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl soroban_sdk::TryFromVal for ContractExecutable { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&ContractExecutable> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &ContractExecutable) -> Result { + extern crate alloc; + Ok(match val { + ContractExecutable::Wasm(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Wasm" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: ContractExecutable) -> Result { + (&val).try_into() + } + } + impl TryFrom<&ContractExecutable> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &ContractExecutable) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: ContractExecutable) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryContractExecutable { + Wasm( + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + ), + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryContractExecutable { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryContractExecutable::Wasm(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm", &__self_0) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryContractExecutable { + #[inline] + fn clone(&self) -> ArbitraryContractExecutable { + match self { + ArbitraryContractExecutable::Wasm(__self_0) => { + ArbitraryContractExecutable::Wasm(::core::clone::Clone::clone(__self_0)) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryContractExecutable { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryContractExecutable {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryContractExecutable { + #[inline] + fn eq(&self, other: &ArbitraryContractExecutable) -> bool { + match (self, other) { + ( + ArbitraryContractExecutable::Wasm(__self_0), + ArbitraryContractExecutable::Wasm(__arg1_0), + ) => __self_0 == __arg1_0, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryContractExecutable { + #[inline] + fn cmp(&self, other: &ArbitraryContractExecutable) -> ::core::cmp::Ordering { + match (self, other) { + ( + ArbitraryContractExecutable::Wasm(__self_0), + ArbitraryContractExecutable::Wasm(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryContractExecutable { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryContractExecutable, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match (self, other) { + ( + ArbitraryContractExecutable::Wasm(__self_0), + ArbitraryContractExecutable::Wasm(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryContractExecutable: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryContractExecutable { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractExecutable.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) + * 1u64) + >> 32 + { + 0u64 => ArbitraryContractExecutable::Wasm( + arbitrary::Arbitrary::arbitrary(u)?, + ), + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractExecutable.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractExecutable.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) + * 1u64) + >> 32 + { + 0u64 => ArbitraryContractExecutable::Wasm( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryContractExecutable.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for ContractExecutable { + type Prototype = ArbitraryContractExecutable; + } + impl soroban_sdk::TryFromVal for ContractExecutable { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryContractExecutable, + ) -> std::result::Result { + Ok(match v { + ArbitraryContractExecutable::Wasm(field_0) => { + ContractExecutable::Wasm(soroban_sdk::IntoVal::into_val(field_0, env)) + } + }) + } + } + }; + pub enum InvokerContractAuthEntry { + Contract(SubContractInvocation), + CreateContractHostFn(CreateContractHostFnContext), + CreateContractWithCtorHostFn(CreateContractWithConstructorHostFnContext), + } + #[automatically_derived] + impl ::core::fmt::Debug for InvokerContractAuthEntry { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + InvokerContractAuthEntry::Contract(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Contract", &__self_0) + } + InvokerContractAuthEntry::CreateContractHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractHostFn", + &__self_0, + ) + } + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractWithCtorHostFn", + &__self_0, + ) + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for InvokerContractAuthEntry { + #[inline] + fn clone(&self) -> InvokerContractAuthEntry { + match self { + InvokerContractAuthEntry::Contract(__self_0) => { + InvokerContractAuthEntry::Contract(::core::clone::Clone::clone(__self_0)) + } + InvokerContractAuthEntry::CreateContractHostFn(__self_0) => { + InvokerContractAuthEntry::CreateContractHostFn(::core::clone::Clone::clone( + __self_0, + )) + } + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0) => { + InvokerContractAuthEntry::CreateContractWithCtorHostFn( + ::core::clone::Clone::clone(__self_0), + ) + } + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for InvokerContractAuthEntry { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for InvokerContractAuthEntry {} + #[automatically_derived] + impl ::core::cmp::PartialEq for InvokerContractAuthEntry { + #[inline] + fn eq(&self, other: &InvokerContractAuthEntry) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + InvokerContractAuthEntry::Contract(__self_0), + InvokerContractAuthEntry::Contract(__arg1_0), + ) => __self_0 == __arg1_0, + ( + InvokerContractAuthEntry::CreateContractHostFn(__self_0), + InvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + ( + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0), + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for InvokerContractAuthEntry { + #[inline] + fn cmp(&self, other: &InvokerContractAuthEntry) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + InvokerContractAuthEntry::Contract(__self_0), + InvokerContractAuthEntry::Contract(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractHostFn(__self_0), + InvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0), + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for InvokerContractAuthEntry { + #[inline] + fn partial_cmp( + &self, + other: &InvokerContractAuthEntry, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + InvokerContractAuthEntry::Contract(__self_0), + InvokerContractAuthEntry::Contract(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractHostFn(__self_0), + InvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__self_0), + InvokerContractAuthEntry::CreateContractWithCtorHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + pub static __SPEC_XDR_TYPE_INVOKERCONTRACTAUTHENTRY: [u8; 268usize] = + InvokerContractAuthEntry::spec_xdr(); + impl InvokerContractAuthEntry { + pub const fn spec_xdr() -> [u8; 268usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x18InvokerContractAuthEntry\0\0\0\x03\0\0\0\x01\0\0\0\0\0\0\0\x08Contract\0\0\0\x01\0\0\x07\xd0\0\0\0\x15SubContractInvocation\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x14CreateContractHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0\x1bCreateContractHostFnContext\0\0\0\0\x01\0\0\0\0\0\0\0\x1cCreateContractWithCtorHostFn\0\0\0\x01\0\0\x07\xd0\0\0\0*CreateContractWithConstructorHostFnContext\0\0" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for InvokerContractAuthEntry { + const SPEC_TYPE_ID: [u8; 32] = *b"\xf0{\xa6\xe9r\xf3\x10\xf6\x0b)\xdb\x8e\r\xea\xe0\xa0\x89\xca\x1a\x1c\x12\xf8\x8f'K\xda\x9b\x87\xab\xaa\xf8="; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_INVOKERCONTRACTAUTHENTRY: [u8; 138usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 138usize, + 3usize, + >( + 2, + *b"\xf0{\xa6\xe9r\xf3\x10\xf6\x0b)\xdb\x8e\r\xea\xe0\xa0\x89\xca\x1a\x1c\x12\xf8\x8f'K\xda\x9b\x87\xab\xaa\xf8=", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); + impl soroban_sdk::TryFromVal for InvokerContractAuthEntry { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &[ + "Contract", + "CreateContractHostFn", + "CreateContractWithCtorHostFn", + ]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Contract( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 2 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::CreateContractWithCtorHostFn( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &InvokerContractAuthEntry, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + InvokerContractAuthEntry::Contract(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Contract")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + InvokerContractAuthEntry::CreateContractHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"CreateContractHostFn")? + .to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + InvokerContractAuthEntry::CreateContractWithCtorHostFn(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val( + env, + &"CreateContractWithCtorHostFn", + )? + .to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&InvokerContractAuthEntry, + ) -> Result { + <_ as soroban_sdk::TryFromVal< + soroban_sdk::Env, + InvokerContractAuthEntry, + >>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal + for InvokerContractAuthEntry + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "Contract" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::Contract( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "CreateContractHostFn" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::CreateContractHostFn( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "CreateContractWithCtorHostFn" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::CreateContractWithCtorHostFn( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl soroban_sdk::TryFromVal + for InvokerContractAuthEntry + { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&InvokerContractAuthEntry> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &InvokerContractAuthEntry) -> Result { + extern crate alloc; + Ok(match val { + InvokerContractAuthEntry::Contract(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Contract" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + InvokerContractAuthEntry::CreateContractHostFn(value0) => ( + soroban_sdk::xdr::ScSymbol( + "CreateContractHostFn" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + InvokerContractAuthEntry::CreateContractWithCtorHostFn(value0) => ( + soroban_sdk::xdr::ScSymbol( + "CreateContractWithCtorHostFn" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: InvokerContractAuthEntry) -> Result { + (&val).try_into() + } + } + impl TryFrom<&InvokerContractAuthEntry> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &InvokerContractAuthEntry) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: InvokerContractAuthEntry) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryInvokerContractAuthEntry { + Contract( + ::Prototype, + ), + CreateContractHostFn( + ::Prototype, + ), + CreateContractWithCtorHostFn( + ::Prototype, + ), + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryInvokerContractAuthEntry { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryInvokerContractAuthEntry::Contract(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, "Contract", &__self_0, + ) + } + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractHostFn", + &__self_0, + ) + } + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __self_0, + ) => ::core::fmt::Formatter::debug_tuple_field1_finish( + f, + "CreateContractWithCtorHostFn", + &__self_0, + ), + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryInvokerContractAuthEntry { + #[inline] + fn clone(&self) -> ArbitraryInvokerContractAuthEntry { + match self { + ArbitraryInvokerContractAuthEntry::Contract(__self_0) => { + ArbitraryInvokerContractAuthEntry::Contract( + ::core::clone::Clone::clone(__self_0), + ) + } + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0) => { + ArbitraryInvokerContractAuthEntry::CreateContractHostFn( + ::core::clone::Clone::clone(__self_0), + ) + } + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __self_0, + ) => ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + ::core::clone::Clone::clone(__self_0), + ), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryInvokerContractAuthEntry { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + ::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryInvokerContractAuthEntry {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryInvokerContractAuthEntry { + #[inline] + fn eq(&self, other: &ArbitraryInvokerContractAuthEntry) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + ArbitraryInvokerContractAuthEntry::Contract(__self_0), + ArbitraryInvokerContractAuthEntry::Contract(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0), + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => __self_0 == __arg1_0, + ( + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __self_0, + ), + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __arg1_0, + ), + ) => __self_0 == __arg1_0, + _ => unsafe { ::core::intrinsics::unreachable() }, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryInvokerContractAuthEntry { + #[inline] + fn cmp(&self, other: &ArbitraryInvokerContractAuthEntry) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + ArbitraryInvokerContractAuthEntry::Contract(__self_0), + ArbitraryInvokerContractAuthEntry::Contract(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0), + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + ( + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __self_0, + ), + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __arg1_0, + ), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => unsafe { ::core::intrinsics::unreachable() }, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryInvokerContractAuthEntry { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryInvokerContractAuthEntry, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + ArbitraryInvokerContractAuthEntry::Contract(__self_0), + ArbitraryInvokerContractAuthEntry::Contract(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__self_0), + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + ( + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __self_0, + ), + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + __arg1_0, + ), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryInvokerContractAuthEntry { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from( + ::arbitrary(u)?, + ) * 3u64) >> 32 + { + 0u64 => { + ArbitraryInvokerContractAuthEntry::Contract( + arbitrary::Arbitrary::arbitrary(u)?, + ) + } + 1u64 => { + ArbitraryInvokerContractAuthEntry::CreateContractHostFn( + arbitrary::Arbitrary::arbitrary(u)?, + ) + } + 2u64 => { + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + arbitrary::Arbitrary::arbitrary(u)?, + ) + } + _ => { + ::core::panicking::panic( + "internal error: entered unreachable code", + ) + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from( + ::arbitrary(&mut u)?, + ) * 3u64) >> 32 + { + 0u64 => { + ArbitraryInvokerContractAuthEntry::Contract( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ) + } + 1u64 => { + ArbitraryInvokerContractAuthEntry::CreateContractHostFn( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ) + } + 2u64 => { + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ) + } + _ => { + ::core::panicking::panic( + "internal error: entered unreachable code", + ) + } + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryInvokerContractAuthEntry.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all( + &[ + <::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for InvokerContractAuthEntry { + type Prototype = ArbitraryInvokerContractAuthEntry; + } + impl soroban_sdk::TryFromVal + for InvokerContractAuthEntry + { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryInvokerContractAuthEntry, + ) -> std::result::Result { + Ok(match v { + ArbitraryInvokerContractAuthEntry::Contract(field_0) => { + InvokerContractAuthEntry::Contract(soroban_sdk::IntoVal::into_val( + field_0, env, + )) + } + ArbitraryInvokerContractAuthEntry::CreateContractHostFn(field_0) => { + InvokerContractAuthEntry::CreateContractHostFn( + soroban_sdk::IntoVal::into_val(field_0, env), + ) + } + ArbitraryInvokerContractAuthEntry::CreateContractWithCtorHostFn( + field_0, + ) => InvokerContractAuthEntry::CreateContractWithCtorHostFn( + soroban_sdk::IntoVal::into_val(field_0, env), + ), + }) + } + } + }; + pub enum Executable { + Wasm(soroban_sdk::BytesN<32>), + StellarAsset, + Account, + } + #[automatically_derived] + impl ::core::fmt::Debug for Executable { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + Executable::Wasm(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm", &__self_0) + } + Executable::StellarAsset => { + ::core::fmt::Formatter::write_str(f, "StellarAsset") + } + Executable::Account => ::core::fmt::Formatter::write_str(f, "Account"), + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for Executable { + #[inline] + fn clone(&self) -> Executable { + match self { + Executable::Wasm(__self_0) => { + Executable::Wasm(::core::clone::Clone::clone(__self_0)) + } + Executable::StellarAsset => Executable::StellarAsset, + Executable::Account => Executable::Account, + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for Executable { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq>; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for Executable {} + #[automatically_derived] + impl ::core::cmp::PartialEq for Executable { + #[inline] + fn eq(&self, other: &Executable) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + (Executable::Wasm(__self_0), Executable::Wasm(__arg1_0)) => { + __self_0 == __arg1_0 + } + _ => true, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for Executable { + #[inline] + fn cmp(&self, other: &Executable) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + (Executable::Wasm(__self_0), Executable::Wasm(__arg1_0)) => { + ::core::cmp::Ord::cmp(__self_0, __arg1_0) + } + _ => ::core::cmp::Ordering::Equal, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for Executable { + #[inline] + fn partial_cmp( + &self, + other: &Executable, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + (Executable::Wasm(__self_0), Executable::Wasm(__arg1_0)) => { + ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0) + } + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + pub static __SPEC_XDR_TYPE_EXECUTABLE: [u8; 104usize] = Executable::spec_xdr(); + impl Executable { + pub const fn spec_xdr() -> [u8; 104usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\nExecutable\0\0\0\0\0\x03\0\0\0\x01\0\0\0\0\0\0\0\x04Wasm\0\0\0\x01\0\0\x03\xee\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\x0cStellarAsset\0\0\0\0\0\0\0\0\0\0\0\x07Account\0" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for Executable { + const SPEC_TYPE_ID: [u8; 32] = *b"L|{\r\xf4\xf2\x1a\xa8\xf6\x981\xe2K\xcb\x824N\xe6\x97\xed\xdf\xc2\x1cck\xd6\xceW\x9cx\x10\x1e"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_EXECUTABLE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"L|{\r\xf4\xf2\x1a\xa8\xf6\x981\xe2K\xcb\x824N\xe6\x97\xed\xdf\xc2\x1cck\xd6\xceW\x9cx\x10\x1e", + [], + ); + impl soroban_sdk::TryFromVal for Executable { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["Wasm", "StellarAsset", "Account"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) + as usize + { + 0 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Wasm( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + 1 => { + if iter.len() > 0 { + return Err(soroban_sdk::ConversionError); + } + Self::StellarAsset + } + 2 => { + if iter.len() > 0 { + return Err(soroban_sdk::ConversionError); + } + Self::Account + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &Executable, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + Executable::Wasm(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Wasm")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + Executable::StellarAsset => { + let tup: (soroban_sdk::Val,) = + (soroban_sdk::Symbol::try_from_val(env, &"StellarAsset")?.to_val(),); + tup.try_into_val(env).map_err(Into::into) + } + Executable::Account => { + let tup: (soroban_sdk::Val,) = + (soroban_sdk::Symbol::try_from_val(env, &"Account")?.to_val(),); + tup.try_into_val(env).map_err(Into::into) + } + } + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&Executable, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val( + env, *val, + ) + } + } + impl soroban_sdk::TryFromVal for Executable { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVec, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let vec = val; + let mut iter = vec.iter(); + let discriminant: soroban_sdk::xdr::ScSymbol = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .clone() + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let discriminant_name: &str = &discriminant.to_utf8_string()?; + Ok(match discriminant_name { + "Wasm" => { + if iter.len() > 1usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + let rv0: soroban_sdk::Val = iter + .next() + .ok_or(soroban_sdk::xdr::Error::Invalid)? + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + Self::Wasm( + rv0.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + } + "StellarAsset" => { + if iter.len() > 0 { + return Err(soroban_sdk::xdr::Error::Invalid); + } + Self::StellarAsset + } + "Account" => { + if iter.len() > 0 { + return Err(soroban_sdk::xdr::Error::Invalid); + } + Self::Account + } + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) + } + } + impl soroban_sdk::TryFromVal for Executable { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Vec(Some(vec)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, vec) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } + } + impl TryFrom<&Executable> for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &Executable) -> Result { + extern crate alloc; + Ok(match val { + Executable::Wasm(value0) => ( + soroban_sdk::xdr::ScSymbol( + "Wasm" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ), + value0, + ) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + Executable::StellarAsset => { + let symbol = soroban_sdk::xdr::ScSymbol( + "StellarAsset" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ); + let val = soroban_sdk::xdr::ScVal::Symbol(symbol); + (val,) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + } + Executable::Account => { + let symbol = soroban_sdk::xdr::ScSymbol( + "Account" + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ); + let val = soroban_sdk::xdr::ScVal::Symbol(symbol); + (val,) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + } + }) + } + } + impl TryFrom for soroban_sdk::xdr::ScVec { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Executable) -> Result { + (&val).try_into() + } + } + impl TryFrom<&Executable> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &Executable) -> Result { + Ok(soroban_sdk::xdr::ScVal::Vec(Some(val.try_into()?))) + } + } + impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: Executable) -> Result { + (&val).try_into() + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryExecutable { + Wasm( + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + ), + StellarAsset, + Account, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryExecutable { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + ArbitraryExecutable::Wasm(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm", &__self_0) + } + ArbitraryExecutable::StellarAsset => { + ::core::fmt::Formatter::write_str(f, "StellarAsset") + } + ArbitraryExecutable::Account => { + ::core::fmt::Formatter::write_str(f, "Account") + } + } + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryExecutable { + #[inline] + fn clone(&self) -> ArbitraryExecutable { + match self { + ArbitraryExecutable::Wasm(__self_0) => { + ArbitraryExecutable::Wasm(::core::clone::Clone::clone(__self_0)) + } + ArbitraryExecutable::StellarAsset => ArbitraryExecutable::StellarAsset, + ArbitraryExecutable::Account => ArbitraryExecutable::Account, + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryExecutable { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryExecutable {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryExecutable { + #[inline] + fn eq(&self, other: &ArbitraryExecutable) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + ( + ArbitraryExecutable::Wasm(__self_0), + ArbitraryExecutable::Wasm(__arg1_0), + ) => __self_0 == __arg1_0, + _ => true, + } + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryExecutable { + #[inline] + fn cmp(&self, other: &ArbitraryExecutable) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) { + ::core::cmp::Ordering::Equal => match (self, other) { + ( + ArbitraryExecutable::Wasm(__self_0), + ArbitraryExecutable::Wasm(__arg1_0), + ) => ::core::cmp::Ord::cmp(__self_0, __arg1_0), + _ => ::core::cmp::Ordering::Equal, + }, + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryExecutable { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryExecutable, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + match (self, other) { + ( + ArbitraryExecutable::Wasm(__self_0), + ArbitraryExecutable::Wasm(__arg1_0), + ) => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0), + _ => ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr), + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryExecutable: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryExecutable { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryExecutable.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) + * 3u64) + >> 32 + { + 0u64 => ArbitraryExecutable::Wasm( + arbitrary::Arbitrary::arbitrary(u)?, + ), + 1u64 => ArbitraryExecutable::StellarAsset, + 2u64 => ArbitraryExecutable::Account, + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryExecutable.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryExecutable.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) + * 3u64) + >> 32 + { + 0u64 => ArbitraryExecutable::Wasm( + arbitrary::Arbitrary::arbitrary_take_rest(u)?, + ), + 1u64 => ArbitraryExecutable::StellarAsset, + 2u64 => ArbitraryExecutable::Account, + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryExecutable.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all( + &[ + arbitrary::size_hint::and_all( + &[ + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ), + arbitrary::size_hint::and_all(&[]), + arbitrary::size_hint::and_all(&[]), + ], + ) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for Executable { + type Prototype = ArbitraryExecutable; + } + impl soroban_sdk::TryFromVal for Executable { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryExecutable, + ) -> std::result::Result { + Ok(match v { + ArbitraryExecutable::Wasm(field_0) => { + Executable::Wasm(soroban_sdk::IntoVal::into_val(field_0, env)) + } + ArbitraryExecutable::StellarAsset => Executable::StellarAsset, + ArbitraryExecutable::Account => Executable::Account, + }) + } + } + }; + pub enum UdtEnum2 { + A = 10, + B = 15, + } + #[automatically_derived] + impl ::core::fmt::Debug for UdtEnum2 { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + UdtEnum2::A => "A", + UdtEnum2::B => "B", + }, + ) + } + } + #[automatically_derived] + impl ::core::marker::Copy for UdtEnum2 {} + #[automatically_derived] + impl ::core::clone::Clone for UdtEnum2 { + #[inline] + fn clone(&self) -> UdtEnum2 { + *self + } + } + #[automatically_derived] + impl ::core::cmp::Eq for UdtEnum2 { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for UdtEnum2 {} + #[automatically_derived] + impl ::core::cmp::PartialEq for UdtEnum2 { + #[inline] + fn eq(&self, other: &UdtEnum2) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } + } + #[automatically_derived] + impl ::core::cmp::Ord for UdtEnum2 { + #[inline] + fn cmp(&self, other: &UdtEnum2) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for UdtEnum2 { + #[inline] + fn partial_cmp( + &self, + other: &UdtEnum2, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr) + } + } + pub static __SPEC_XDR_TYPE_UDTENUM2: [u8; 60usize] = UdtEnum2::spec_xdr(); + impl UdtEnum2 { + pub const fn spec_xdr() -> [u8; 60usize] { + *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x08UdtEnum2\0\0\0\x02\0\0\0\0\0\0\0\x01A\0\0\0\0\0\0\n\0\0\0\0\0\0\0\x01B\0\0\0\0\0\0\x0f" + } + } + impl soroban_sdk::spec_shaking::SpecTypeId for UdtEnum2 { + const SPEC_TYPE_ID: [u8; 32] = *b"\xaf\xf7\x93\xba\x9eM\xde\x9a?'\xa8\xb9\xcb\x94\x9f\x88\xf6L\xc0\xb9\x18\xd1\xc9\x1a5\xf8\x99\xa59\xc2\xcf\x9e"; + } + #[allow(non_upper_case_globals)] + pub static __SPEC_GRAPH_TYPE_UDTENUM2: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, + >( + 2, + *b"\xaf\xf7\x93\xba\x9eM\xde\x9a?'\xa8\xb9\xcb\x94\x9f\x88\xf6L\xc0\xb9\x18\xd1\xc9\x1a5\xf8\x99\xa59\xc2\xcf\x9e", + [], + ); + impl soroban_sdk::TryFromVal for UdtEnum2 { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::TryIntoVal; + let discriminant: u32 = val.try_into_val(env)?; + Ok(match discriminant { + 10u32 => Self::A, + 15u32 => Self::B, + _ => Err(soroban_sdk::ConversionError {})?, + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &UdtEnum2, + ) -> Result { + Ok(match val { + UdtEnum2::A => 10u32.into(), + UdtEnum2::B => 15u32.into(), + }) + } + } + impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UdtEnum2, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } + } + impl soroban_sdk::TryFromVal for UdtEnum2 { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::U32(discriminant) = val { + Ok(match *discriminant { + 10u32 => Self::A, + 15u32 => Self::B, + _ => Err(soroban_sdk::xdr::Error::Invalid)?, + }) } else { - self.env.mock_all_auths(); + Err(soroban_sdk::xdr::Error::Invalid) } } } - use soroban_sdk::{FromVal, IntoVal}; - let res = self.env.try_invoke_contract( - &self.address, - &{ - #[allow(deprecated)] - const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("add"); - SYMBOL - }, - ::soroban_sdk::Vec::from_array( - &self.env, - [a.into_val(&self.env), b.into_val(&self.env)], - ), - ); - if let Some(old_auth_manager) = old_auth_manager { - self.env.host().set_auth_manager(old_auth_manager).unwrap(); + impl TryInto for &UdtEnum2 { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_into(self) -> Result { + Ok(match self { + UdtEnum2::A => 10u32.into(), + UdtEnum2::B => 15u32.into(), + }) + } } - res - } -} -impl ContractArgs { - #[inline(always)] - #[allow(clippy::unused_unit)] - pub fn add<'i>(a: &'i UdtEnum, b: &'i UdtEnum) -> (&'i UdtEnum, &'i UdtEnum) { - (a, b) - } -} -#[doc(hidden)] -#[allow(non_snake_case)] -#[deprecated(note = "use `ContractClient::new(&env, &contract_id).add` instead")] -#[allow(deprecated)] -pub fn __Contract__add__invoke_raw( - env: soroban_sdk::Env, - arg_0: soroban_sdk::Val, - arg_1: soroban_sdk::Val, -) -> soroban_sdk::Val { - soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( - ::add( - <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( - <_ as soroban_sdk::TryFromValForContractFn< - soroban_sdk::Env, - soroban_sdk::Val, - >>::try_from_val_for_contract_fn(&env, &arg_0), - ), - <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( - <_ as soroban_sdk::TryFromValForContractFn< - soroban_sdk::Env, - soroban_sdk::Val, - >>::try_from_val_for_contract_fn(&env, &arg_1), - ), - ), - &env, - ) -} -#[doc(hidden)] -#[allow(non_snake_case)] -#[deprecated(note = "use `ContractClient::new(&env, &contract_id).add` instead")] -pub fn __Contract__add__invoke_raw_slice( - env: soroban_sdk::Env, - args: &[soroban_sdk::Val], -) -> soroban_sdk::Val { - if args.len() != 2usize { - { - ::core::panicking::panic_fmt(format_args!( - "invalid number of input arguments: {0} expected, got {1}", - 2usize, - args.len(), - )); - }; - } - #[allow(deprecated)] - __Contract__add__invoke_raw(env, args[0usize], args[1usize]) -} -#[doc(hidden)] -#[allow(non_snake_case)] -#[deprecated(note = "use `ContractClient::new(&env, &contract_id).add` instead")] -pub extern "C" fn __Contract__add__invoke_raw_extern( - arg_0: soroban_sdk::Val, - arg_1: soroban_sdk::Val, -) -> soroban_sdk::Val { - #[allow(deprecated)] - __Contract__add__invoke_raw(soroban_sdk::Env::default(), arg_0, arg_1) -} -#[doc(hidden)] -#[allow(non_snake_case)] -#[allow(unused)] -fn __Contract____7e9e5ac30f2216fd0fd6f5faed316f2d5983361a4203c3330cfa46ef65bb4767_ctor() { - #[allow(unsafe_code)] - { - #[link_section = ".init_array"] - #[used] - #[allow(non_upper_case_globals, non_snake_case)] - #[doc(hidden)] - static f: extern "C" fn() -> ::ctor::__support::CtorRetType = { - #[link_section = ".text.startup"] - #[allow(non_snake_case)] - extern "C" fn f() -> ::ctor::__support::CtorRetType { - unsafe { - __Contract____7e9e5ac30f2216fd0fd6f5faed316f2d5983361a4203c3330cfa46ef65bb4767_ctor(); + impl TryInto for UdtEnum2 { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_into(self) -> Result { + Ok(match self { + UdtEnum2::A => 10u32.into(), + UdtEnum2::B => 15u32.into(), + }) + } + } + const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub enum ArbitraryUdtEnum2 { + A, + B, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryUdtEnum2 { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + ArbitraryUdtEnum2::A => "A", + ArbitraryUdtEnum2::B => "B", + }, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryUdtEnum2 { + #[inline] + fn clone(&self) -> ArbitraryUdtEnum2 { + match self { + ArbitraryUdtEnum2::A => ArbitraryUdtEnum2::A, + ArbitraryUdtEnum2::B => ArbitraryUdtEnum2::B, + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryUdtEnum2 { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () {} + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryUdtEnum2 {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryUdtEnum2 { + #[inline] + fn eq(&self, other: &ArbitraryUdtEnum2) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryUdtEnum2 { + #[inline] + fn cmp(&self, other: &ArbitraryUdtEnum2) -> ::core::cmp::Ordering { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryUdtEnum2 { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryUdtEnum2, + ) -> ::core::option::Option<::core::cmp::Ordering> { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr) + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryUdtEnum2: ::std::thread::LocalKey< + std::cell::Cell, + > = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } }; - core::default::Default::default() + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryUdtEnum2 { + fn arbitrary( + u: &mut arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtEnum2.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(u)?) + * 2u64) + >> 32 + { + 0u64 => ArbitraryUdtEnum2::A, + 1u64 => ArbitraryUdtEnum2::B, + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtEnum2.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtEnum2.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok( + match (u64::from(::arbitrary(&mut u)?) + * 2u64) + >> 32 + { + 0u64 => ArbitraryUdtEnum2::A, + 1u64 => ArbitraryUdtEnum2::B, + _ => ::core::panicking::panic( + "internal error: entered unreachable code", + ), + }, + ) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryUdtEnum2.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::and( + ::size_hint(depth), + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::or_all(&[ + arbitrary::size_hint::and_all(&[]), + arbitrary::size_hint::and_all(&[]), + ]) + }), + ) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for UdtEnum2 { + type Prototype = ArbitraryUdtEnum2; + } + impl soroban_sdk::TryFromVal for UdtEnum2 { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryUdtEnum2, + ) -> std::result::Result { + Ok(match v { + ArbitraryUdtEnum2::A => UdtEnum2::A, + ArbitraryUdtEnum2::B => UdtEnum2::B, + }) + } } - f }; } - { - ::register( - "add", - #[allow(deprecated)] - &__Contract__add__invoke_raw_slice, - ); - } -} -mod test { - use super::*; - use soroban_sdk::{vec, xdr::ScVal, Bytes, Env, TryFromVal}; extern crate test; - #[rustc_test_marker = "test::test_serializing"] + #[rustc_test_marker = "test_with_wasm::test_add"] #[doc(hidden)] - pub const test_serializing: test::TestDescAndFn = test::TestDescAndFn { + pub const test_add: test::TestDescAndFn = test::TestDescAndFn { desc: test::TestDesc { - name: test::StaticTestName("test::test_serializing"), + name: test::StaticTestName("test_with_wasm::test_add"), ignore: false, ignore_message: ::core::option::Option::None, source_file: "tests/udt/src/lib.rs", - start_line: 60usize, + start_line: 203usize, start_col: 8usize, - end_line: 60usize, - end_col: 24usize, + end_line: 203usize, + end_col: 16usize, compile_fail: false, no_run: false, should_panic: test::ShouldPanic::No, @@ -2200,26 +12899,39 @@ mod test { }, testfn: test::StaticTestFn( #[coverage(off)] - || test::assert_test_result(test_serializing()), + || test::assert_test_result(test_add()), ), }; - fn test_serializing() { - use soroban_sdk::xdr::ToXdr; + fn test_add() { let e = Env::default(); - let udt = UdtStruct { + let contract_id = e.register(contract::WASM, ()); + let client = contract::Client::new(&e, &contract_id); + let udt = contract::UdtStruct { a: 10, b: 12, c: ::soroban_sdk::Vec::from_array(&e, [1]), }; - let bin = udt.to_xdr(&e); - let expected_bytes = [ - 0u8, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 15, 0, 0, 0, 1, 97, 0, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 15, 0, 0, 0, 1, 98, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 0, 0, 12, 0, 0, 0, 15, 0, 0, 0, 1, 99, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 1, 0, 0, 0, - 1, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 1, - ]; - let expected_bytes = Bytes::from_array(&e, &expected_bytes); - match (&bin, &expected_bytes) { + let z = client.add(&contract::UdtEnum::UdtA, &contract::UdtEnum::UdtB(udt)); + match (&z, &22) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::None, + ); + } + } + }; + let udt1 = contract::UdtEnum2::A; + let udt2 = contract::UdtTuple(1, ::soroban_sdk::Vec::from_array(&e, [2, 3])); + let z = client.add( + &contract::UdtEnum::UdtC(udt1), + &contract::UdtEnum::UdtD(udt2), + ); + match (&z, &16) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -2234,18 +12946,18 @@ mod test { }; } extern crate test; - #[rustc_test_marker = "test::test_add"] + #[rustc_test_marker = "test_with_wasm::test_recursive"] #[doc(hidden)] - pub const test_add: test::TestDescAndFn = test::TestDescAndFn { + pub const test_recursive: test::TestDescAndFn = test::TestDescAndFn { desc: test::TestDesc { - name: test::StaticTestName("test::test_add"), + name: test::StaticTestName("test_with_wasm::test_recursive"), ignore: false, ignore_message: ::core::option::Option::None, source_file: "tests/udt/src/lib.rs", - start_line: 80usize, + start_line: 226usize, start_col: 8usize, - end_line: 80usize, - end_col: 16usize, + end_line: 226usize, + end_col: 22usize, compile_fail: false, no_run: false, should_panic: test::ShouldPanic::No, @@ -2253,20 +12965,39 @@ mod test { }, testfn: test::StaticTestFn( #[coverage(off)] - || test::assert_test_result(test_add()), + || test::assert_test_result(test_recursive()), ), }; - fn test_add() { + fn test_recursive() { let e = Env::default(); - let contract_id = e.register(Contract, ()); - let client = ContractClient::new(&e, &contract_id); - let udt = UdtStruct { - a: 10, - b: 12, - c: ::soroban_sdk::Vec::from_array(&e, [1]), + let contract_id = e.register(contract::WASM, ()); + let client = contract::Client::new(&e, &contract_id); + let recursive_udt_0 = contract::UdtRecursive { + a: { + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("0"); + SYMBOL + }, + b: ::soroban_sdk::Vec::new(&e), }; - let z = client.add(&UdtEnum::UdtA, &UdtEnum::UdtB(udt)); - match (&z, &22) { + let recursive_udt_1 = contract::UdtRecursive { + a: { + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("1"); + SYMBOL + }, + b: ::soroban_sdk::Vec::from_array(&e, [recursive_udt_0.clone()]), + }; + let recursive_udt_2 = contract::UdtRecursive { + a: { + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("2"); + SYMBOL + }, + b: ::soroban_sdk::Vec::from_array(&e, [recursive_udt_1.clone()]), + }; + let result_0 = client.recursive(&recursive_udt_2); + match (&result_0, &Some(recursive_udt_1)) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -2279,10 +13010,22 @@ mod test { } } }; - let udt1 = UdtEnum2::A; - let udt2 = UdtTuple(1, ::soroban_sdk::Vec::from_array(&e, [2, 3])); - let z = client.add(&UdtEnum::UdtC(udt1), &UdtEnum::UdtD(udt2)); - match (&z, &16) { + let result_1 = client.recursive(&result_0.unwrap()); + match (&result_1, &Some(recursive_udt_0)) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::None, + ); + } + } + }; + let result_2 = client.recursive(&result_1.unwrap()); + match (&result_2, &None) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -2297,18 +13040,18 @@ mod test { }; } extern crate test; - #[rustc_test_marker = "test::test_scval_accessibility_from_udt_types"] + #[rustc_test_marker = "test_with_wasm::test_recursive_enum"] #[doc(hidden)] - pub const test_scval_accessibility_from_udt_types: test::TestDescAndFn = test::TestDescAndFn { + pub const test_recursive_enum: test::TestDescAndFn = test::TestDescAndFn { desc: test::TestDesc { - name: test::StaticTestName("test::test_scval_accessibility_from_udt_types"), + name: test::StaticTestName("test_with_wasm::test_recursive_enum"), ignore: false, ignore_message: ::core::option::Option::None, source_file: "tests/udt/src/lib.rs", - start_line: 100usize, + start_line: 255usize, start_col: 8usize, - end_line: 100usize, - end_col: 47usize, + end_line: 255usize, + end_col: 27usize, compile_fail: false, no_run: false, should_panic: test::ShouldPanic::No, @@ -2316,19 +13059,37 @@ mod test { }, testfn: test::StaticTestFn( #[coverage(off)] - || test::assert_test_result(test_scval_accessibility_from_udt_types()), + || test::assert_test_result(test_recursive_enum()), ), }; - fn test_scval_accessibility_from_udt_types() { + fn test_recursive_enum() { let e = Env::default(); - let udt = UdtStruct { - a: 10, - b: 12, - c: ::soroban_sdk::Vec::from_array(&e, [1]), + let contract_id = e.register(contract::WASM, ()); + let client = contract::Client::new(&e, &contract_id); + let entry = contract::RecursiveEnum::Recursive(contract::RecursiveToEnum { + a: { + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("test"); + SYMBOL + }, + b: Map::from_array(&e, [(42u32, contract::RecursiveEnum::NotRecursive)]), + }); + let result = client.recursive_enum(&entry, &42); + match (&result, &Some(contract::RecursiveEnum::NotRecursive)) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::None, + ); + } + } }; - let val: ScVal = udt.clone().try_into().unwrap(); - let roundtrip = UdtStruct::try_from_val(&e, &val).unwrap(); - match (&udt, &roundtrip) { + let none_result = client.recursive_enum(&entry, &43); + match (&none_result, &None) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -2350,7 +13111,12 @@ pub fn main() -> () { extern crate test; test::test_main_static(&[ &test_add, + &test_recursive, + &test_recursive_enum, &test_scval_accessibility_from_udt_types, &test_serializing, + &test_add, + &test_recursive, + &test_recursive_enum, ]) } diff --git a/tests-expanded/test_udt_wasm32v1-none.rs b/tests-expanded/test_udt_wasm32v1-none.rs index dc5a208c0..c4e02dd10 100644 --- a/tests-expanded/test_udt_wasm32v1-none.rs +++ b/tests-expanded/test_udt_wasm32v1-none.rs @@ -4,7 +4,7 @@ extern crate core; #[prelude_import] use core::prelude::rust_2021::*; -use soroban_sdk::{contract, contractimpl, contracttype, Vec}; +use soroban_sdk::{contract, contractimpl, contracttype, Error, Map, Symbol, Vec}; pub enum UdtEnum2 { A = 10, B = 15, @@ -56,16 +56,19 @@ impl UdtEnum2 { *b"\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\x08UdtEnum2\0\0\0\x02\0\0\0\0\0\0\0\x01A\0\0\0\0\0\0\n\0\0\0\0\0\0\0\x01B\0\0\0\0\0\0\x0f" } } -impl soroban_sdk::SpecShakingMarker for UdtEnum2 { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xaf\xf7\x93\xba\x9eM\xde\x9a"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UdtEnum2 { + const SPEC_TYPE_ID: [u8; 32] = *b"\xaf\xf7\x93\xba\x9eM\xde\x9a?'\xa8\xb9\xcb\x94\x9f\x88\xf6L\xc0\xb9\x18\xd1\xc9\x1a5\xf8\x99\xa59\xc2\xcf\x9e"; } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UDTENUM2: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\xaf\xf7\x93\xba\x9eM\xde\x9a?'\xa8\xb9\xcb\x94\x9f\x88\xf6L\xc0\xb9\x18\xd1\xc9\x1a5\xf8\x99\xa59\xc2\xcf\x9e", + [], +); impl soroban_sdk::TryFromVal for UdtEnum2 { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -176,19 +179,23 @@ impl UdtEnum { *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x07UdtEnum\0\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\x04UdtA\0\0\0\x01\0\0\0\0\0\0\0\x04UdtB\0\0\0\x01\0\0\x07\xd0\0\0\0\tUdtStruct\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x04UdtC\0\0\0\x01\0\0\x07\xd0\0\0\0\x08UdtEnum2\0\0\0\x01\0\0\0\0\0\0\0\x04UdtD\0\0\0\x01\0\0\x07\xd0\0\0\0\x08UdtTuple" } } -impl soroban_sdk::SpecShakingMarker for UdtEnum { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xf3\xb0\xab@i\rH\xb4"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UdtEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"\xf3\xb0\xab@i\rH\xb4\x81\x9c\x94|?A\xef\xcf\xf3%Q\xd5\x8b\x90\xb2B\x18\xfb\x8c>\xaa\x8c^2"; } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UDTENUM: [u8; 138usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 138usize, + 3usize, +>( + 2, + *b"\xf3\xb0\xab@i\rH\xb4\x81\x9c\x94|?A\xef\xcf\xf3%Q\xd5\x8b\x90\xb2B\x18\xfb\x8c>\xaa\x8c^2", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); impl soroban_sdk::TryFromVal for UdtEnum { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -341,18 +348,19 @@ impl UdtTuple { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x08UdtTuple\0\0\0\x02\0\0\0\0\0\0\0\x010\0\0\0\0\0\0\x07\0\0\0\0\0\0\0\x011\0\0\0\0\0\x03\xea\0\0\0\x07" } } -impl soroban_sdk::SpecShakingMarker for UdtTuple { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\xeb\x9f\x12&\x9av(*"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UdtTuple { + const SPEC_TYPE_ID: [u8; 32] = *b"\xeb\x9f\x12&\x9av(*\x7f17.3\x91\xccc\xfc\xec\xee3\x0f\x96\xf2P\x1b9\xe8\xc6\x8f\xf0\xe0\xeb"; } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UDTTUPLE: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\xeb\x9f\x12&\x9av(*\x7f17.3\x91\xccc\xfc\xec\xee3\x0f\x96\xf2P\x1b9\xe8\xc6\x8f\xf0\xe0\xeb", + [], +); impl soroban_sdk::TryFromVal for UdtTuple { type Error = soroban_sdk::ConversionError; #[inline(always)] @@ -457,19 +465,19 @@ impl UdtStruct { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\tUdtStruct\0\0\0\0\0\0\x03\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x07\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x07\0\0\0\0\0\0\0\x01c\0\0\0\0\0\x03\xea\0\0\0\x07" } } -impl soroban_sdk::SpecShakingMarker for UdtStruct { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - ::spec_shaking_marker(); - as soroban_sdk::SpecShakingMarker>::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\x16'd8\xff\xc9\xb1\xf8"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for UdtStruct { + const SPEC_TYPE_ID: [u8; 32] = *b"\x16'd8\xff\xc9\xb1\xf8\x1cf\xb0\x84\xb1\xb8\xfay\x84`\xe4\xddp;\xc5*\x0e\xbaH:\x94\xbb\xb2\x87"; } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UDTSTRUCT: [u8; 42usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 42usize, + 0usize, +>( + 2, + *b"\x16'd8\xff\xc9\xb1\xf8\x1cf\xb0\x84\xb1\xb8\xfay\x84`\xe4\xddp;\xc5*\x0e\xbaH:\x94\xbb\xb2\x87", + [], +); impl soroban_sdk::TryFromVal for UdtStruct { type Error = soroban_sdk::ConversionError; fn try_from_val( @@ -524,6 +532,387 @@ impl soroban_sdk::TryFromVal for soroban_sdk::Val <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) } } +pub struct UdtRecursive { + pub a: Symbol, + pub b: Vec, +} +#[automatically_derived] +impl ::core::clone::Clone for UdtRecursive { + #[inline] + fn clone(&self) -> UdtRecursive { + UdtRecursive { + a: ::core::clone::Clone::clone(&self.a), + b: ::core::clone::Clone::clone(&self.b), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for UdtRecursive { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "UdtRecursive", + "a", + &self.a, + "b", + &&self.b, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for UdtRecursive { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for UdtRecursive {} +#[automatically_derived] +impl ::core::cmp::PartialEq for UdtRecursive { + #[inline] + fn eq(&self, other: &UdtRecursive) -> bool { + self.a == other.a && self.b == other.b + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_UDTRECURSIVE: [u8; 84usize] = UdtRecursive::spec_xdr(); +impl UdtRecursive { + pub const fn spec_xdr() -> [u8; 84usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0cUdtRecursive\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x11\0\0\0\0\0\0\0\x01b\0\0\0\0\0\x03\xea\0\0\x07\xd0\0\0\0\x0cUdtRecursive" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for UdtRecursive { + const SPEC_TYPE_ID: [u8; 32] = *b"\xc8\x12\x91\xfe\xd7\x13\xf5\x9c\xe4\xc7\x03\xdc@#$F\r\x04\xe2j_\xb0\xacC\xfd\x0b\xc0J~<\xfc\x05"; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_UDTRECURSIVE: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 2, + *b"\xc8\x12\x91\xfe\xd7\x13\xf5\x9c\xe4\xc7\x03\xdc@#$F\r\x04\xe2j_\xb0\xacC\xfd\x0b\xc0J~<\xfc\x05", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::TryFromVal for UdtRecursive { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["a", "b"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + a: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + b: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &UdtRecursive, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["a", "b"]; + let vals: [Val; 2usize] = [ + (&val.a).try_into_val(env).map_err(|_| ConversionError)?, + (&val.b).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&UdtRecursive, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +pub struct RecursiveToEnum { + pub a: Symbol, + pub b: Map, +} +#[automatically_derived] +impl ::core::clone::Clone for RecursiveToEnum { + #[inline] + fn clone(&self) -> RecursiveToEnum { + RecursiveToEnum { + a: ::core::clone::Clone::clone(&self.a), + b: ::core::clone::Clone::clone(&self.b), + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for RecursiveToEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "RecursiveToEnum", + "a", + &self.a, + "b", + &&self.b, + ) + } +} +#[automatically_derived] +impl ::core::cmp::Eq for RecursiveToEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + let _: ::core::cmp::AssertParamIsEq>; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for RecursiveToEnum {} +#[automatically_derived] +impl ::core::cmp::PartialEq for RecursiveToEnum { + #[inline] + fn eq(&self, other: &RecursiveToEnum) -> bool { + self.a == other.a && self.b == other.b + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_RECURSIVETOENUM: [u8; 96usize] = RecursiveToEnum::spec_xdr(); +impl RecursiveToEnum { + pub const fn spec_xdr() -> [u8; 96usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x0fRecursiveToEnum\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x11\0\0\0\0\0\0\0\x01b\0\0\0\0\0\x03\xec\0\0\0\x04\0\0\x07\xd0\0\0\0\rRecursiveEnum\0\0\0" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for RecursiveToEnum { + const SPEC_TYPE_ID: [u8; 32] = *b"\xe1oU\xdb\xd47\x98\x14z\xb2+\xbb\xdf\xdbn\x14$\x92\xbb\xf1M\xf2\x10&P\x0c\xd1\x13J\x97Ci"; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_RECURSIVETOENUM: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 2, + *b"\xe1oU\xdb\xd47\x98\x14z\xb2+\xbb\xdf\xdbn\x14$\x92\xbb\xf1M\xf2\x10&P\x0c\xd1\x13J\x97Ci", + [::SPEC_TYPE_ID], +); +impl soroban_sdk::TryFromVal for RecursiveToEnum { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["a", "b"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + a: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + b: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &RecursiveToEnum, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["a", "b"]; + let vals: [Val; 2usize] = [ + (&val.a).try_into_val(env).map_err(|_| ConversionError)?, + (&val.b).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&RecursiveToEnum, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +pub enum RecursiveEnum { + NotRecursive, + Recursive(RecursiveToEnum), +} +#[automatically_derived] +impl ::core::clone::Clone for RecursiveEnum { + #[inline] + fn clone(&self) -> RecursiveEnum { + match self { + RecursiveEnum::NotRecursive => RecursiveEnum::NotRecursive, + RecursiveEnum::Recursive(__self_0) => { + RecursiveEnum::Recursive(::core::clone::Clone::clone(__self_0)) + } + } + } +} +#[automatically_derived] +impl ::core::fmt::Debug for RecursiveEnum { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + match self { + RecursiveEnum::NotRecursive => ::core::fmt::Formatter::write_str(f, "NotRecursive"), + RecursiveEnum::Recursive(__self_0) => { + ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Recursive", &__self_0) + } + } + } +} +#[automatically_derived] +impl ::core::cmp::Eq for RecursiveEnum { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq; + } +} +#[automatically_derived] +impl ::core::marker::StructuralPartialEq for RecursiveEnum {} +#[automatically_derived] +impl ::core::cmp::PartialEq for RecursiveEnum { + #[inline] + fn eq(&self, other: &RecursiveEnum) -> bool { + let __self_discr = ::core::intrinsics::discriminant_value(self); + let __arg1_discr = ::core::intrinsics::discriminant_value(other); + __self_discr == __arg1_discr + && match (self, other) { + (RecursiveEnum::Recursive(__self_0), RecursiveEnum::Recursive(__arg1_0)) => { + __self_0 == __arg1_0 + } + _ => true, + } + } +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_RECURSIVEENUM: [u8; 112usize] = RecursiveEnum::spec_xdr(); +impl RecursiveEnum { + pub const fn spec_xdr() -> [u8; 112usize] { + *b"\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\rRecursiveEnum\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\x0cNotRecursive\0\0\0\x01\0\0\0\0\0\0\0\tRecursive\0\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x0fRecursiveToEnum\0" + } +} +impl soroban_sdk::spec_shaking::SpecTypeId for RecursiveEnum { + const SPEC_TYPE_ID: [u8; 32] = + *b"\xff{V \xab\r\xdcd\xe7~\x19\x83<\xc27t\xc6\x9d=\x9f\x8f\x12\x0e\x18>%\x08\x89.&\0M"; +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_TYPE_RECURSIVEENUM: [u8; 74usize] = + soroban_sdk::spec_shaking::encode_graph_record::<74usize, 1usize>( + 2, + *b"\xff{V \xab\r\xdcd\xe7~\x19\x83<\xc27t\xc6\x9d=\x9f\x8f\x12\x0e\x18>%\x08\x89.&\0M", + [::SPEC_TYPE_ID], + ); +impl soroban_sdk::TryFromVal for RecursiveEnum { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{EnvBase, TryFromVal, TryIntoVal}; + const CASES: &'static [&'static str] = &["NotRecursive", "Recursive"]; + let vec: soroban_sdk::Vec = val.try_into_val(env)?; + let mut iter = vec.try_iter(); + let discriminant: soroban_sdk::Symbol = iter + .next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?; + Ok( + match u32::from(env.symbol_index_in_strs(discriminant.to_symbol_val(), CASES)?) as usize + { + 0 => { + if iter.len() > 0 { + return Err(soroban_sdk::ConversionError); + } + Self::NotRecursive + } + 1 => { + if iter.len() > 1usize { + return Err(soroban_sdk::ConversionError); + } + Self::Recursive( + iter.next() + .ok_or(soroban_sdk::ConversionError)?? + .try_into_val(env)?, + ) + } + _ => Err(soroban_sdk::ConversionError {})?, + }, + ) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &RecursiveEnum, + ) -> Result { + use soroban_sdk::{TryFromVal, TryIntoVal}; + match val { + RecursiveEnum::NotRecursive => { + let tup: (soroban_sdk::Val,) = + (soroban_sdk::Symbol::try_from_val(env, &"NotRecursive")?.to_val(),); + tup.try_into_val(env).map_err(Into::into) + } + RecursiveEnum::Recursive(ref value0) => { + let tup: (soroban_sdk::Val, soroban_sdk::Val) = ( + soroban_sdk::Symbol::try_from_val(env, &"Recursive")?.to_val(), + value0.try_into_val(env)?, + ); + tup.try_into_val(env).map_err(Into::into) + } + } + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&RecursiveEnum, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} pub struct Contract; ///ContractArgs is a type for building arg lists for functions defined in "Contract". pub struct ContractArgs; @@ -559,6 +948,19 @@ impl Contract { }; a + b } + pub fn recursive(a: UdtRecursive) -> Option { + if a.b.is_empty() { + None + } else { + Some(a.b.first_unchecked()) + } + } + pub fn recursive_enum(a: RecursiveEnum, key: u32) -> Result, Error> { + match a { + RecursiveEnum::NotRecursive => Ok(None), + RecursiveEnum::Recursive(router) => Ok(router.b.get(key)), + } + } } #[doc(hidden)] #[allow(non_snake_case)] @@ -575,6 +977,74 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x03add\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\x07\xd0\0\0\0\x07UdtEnum\0\0\0\0\0\0\0\0\x01b\0\0\0\0\0\x07\xd0\0\0\0\x07UdtEnum\0\0\0\0\x01\0\0\0\x07" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_ADD: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"\xeb\xb9m\xe34\x1d[[\xe4K\xe7\xe3\xf4.\x99\x9b\xf2\x1a\xe15\xa1D+\xa8\x1b\x1cV\n\xed\xc1\xa4\x89", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__recursive__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_FN_RECURSIVE: [u8; 88usize] = super::Contract::spec_xdr_recursive(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_recursive() -> [u8; 88usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\trecursive\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x01a\0\0\0\0\0\x07\xd0\0\0\0\x0cUdtRecursive\0\0\0\x01\0\0\x03\xe8\0\0\x07\xd0\0\0\0\x0cUdtRecursive" + } +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_RECURSIVE: [u8; 106usize] = + soroban_sdk::spec_shaking::encode_graph_record::<106usize, 2usize>( + 0, + *b"(`\x83Z;\x970\xd8\xdaZp\xcf\x9e\xbf\x82\x86|0\xb6\x90\x10Mf\x13\xcf\xd76\x0cDn\xdb\xb2", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], + ); +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__recursive_enum__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_FN_RECURSIVE_ENUM: [u8; 124usize] = + super::Contract::spec_xdr_recursive_enum(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_recursive_enum() -> [u8; 124usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0erecursive_enum\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\x07\xd0\0\0\0\rRecursiveEnum\0\0\0\0\0\0\0\0\0\0\x03key\0\0\0\0\x04\0\0\0\x01\0\0\x03\xe9\0\0\x03\xe8\0\0\x07\xd0\0\0\0\rRecursiveEnum\0\0\0\0\0\0\x03" + } +} +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_RECURSIVE_ENUM: [u8; 106usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 106usize, + 2usize, +>( + 0, + *b"\x84H!\x0e\xfc\xdbM6\x02\xaaN\xe4\xee\x99J\x08\x94\x08\xa9\xc0D\x88Ci\xc9\x07~\xb9\xa6\xc5\xec\xaa", + [ + ::SPEC_TYPE_ID, + ::SPEC_TYPE_ID, + ], +); impl<'a> ContractClient<'a> { pub fn add(&self, a: &UdtEnum, b: &UdtEnum) -> i64 { use core::ops::Not; @@ -616,6 +1086,82 @@ impl<'a> ContractClient<'a> { ); res } + pub fn recursive(&self, a: &UdtRecursive) -> Option { + use core::ops::Not; + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("recursive"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array(&self.env, [a.into_val(&self.env)]), + ); + res + } + pub fn try_recursive( + &self, + a: &UdtRecursive, + ) -> Result< + Result< + Option, + as soroban_sdk::TryFromVal>::Error, + >, + Result, + >{ + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("recursive"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array(&self.env, [a.into_val(&self.env)]), + ); + res + } + pub fn recursive_enum(&self, a: &RecursiveEnum, key: &u32) -> Option { + use core::ops::Not; + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "recursive_enum") }, + ::soroban_sdk::Vec::from_array( + &self.env, + [a.into_val(&self.env), key.into_val(&self.env)], + ), + ); + res + } + pub fn try_recursive_enum( + &self, + a: &RecursiveEnum, + key: &u32, + ) -> Result< + Result< + Option, + as soroban_sdk::TryFromVal< + soroban_sdk::Env, + soroban_sdk::Val, + >>::Error, + >, + Result, + > { + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "recursive_enum") }, + ::soroban_sdk::Vec::from_array( + &self.env, + [a.into_val(&self.env), key.into_val(&self.env)], + ), + ); + res + } } impl ContractArgs { #[inline(always)] @@ -623,6 +1169,16 @@ impl ContractArgs { pub fn add<'i>(a: &'i UdtEnum, b: &'i UdtEnum) -> (&'i UdtEnum, &'i UdtEnum) { (a, b) } + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn recursive<'i>(a: &'i UdtRecursive) -> (&'i UdtRecursive,) { + (a,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn recursive_enum<'i>(a: &'i RecursiveEnum, key: &'i u32) -> (&'i RecursiveEnum, &'i u32) { + (a, key) + } } #[doc(hidden)] #[allow(non_snake_case)] @@ -662,3 +1218,71 @@ pub extern "C" fn __Contract__add__invoke_raw_extern( #[allow(deprecated)] __Contract__add__invoke_raw(soroban_sdk::Env::default(), arg_0, arg_1) } +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).recursive` instead")] +#[allow(deprecated)] +pub fn __Contract__recursive__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::recursive( + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).recursive` instead")] +#[export_name = "recursive"] +pub extern "C" fn __Contract__recursive__invoke_raw_extern( + arg_0: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__recursive__invoke_raw(soroban_sdk::Env::default(), arg_0) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).recursive_enum` instead")] +#[allow(deprecated)] +pub fn __Contract__recursive_enum__invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, +) -> soroban_sdk::Val { + soroban_sdk::IntoValForContractFn::into_val_for_contract_fn( + ::recursive_enum( + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_1), + ), + ), + &env, + ) +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[deprecated(note = "use `ContractClient::new(&env, &contract_id).recursive_enum` instead")] +#[export_name = "recursive_enum"] +pub extern "C" fn __Contract__recursive_enum__invoke_raw_extern( + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, +) -> soroban_sdk::Val { + #[allow(deprecated)] + __Contract__recursive_enum__invoke_raw(soroban_sdk::Env::default(), arg_0, arg_1) +} diff --git a/tests-expanded/test_workspace_contract_tests.rs b/tests-expanded/test_workspace_contract_tests.rs index 208c4564e..35624bc17 100644 --- a/tests-expanded/test_workspace_contract_tests.rs +++ b/tests-expanded/test_workspace_contract_tests.rs @@ -156,6 +156,15 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x05value\0\0\0\0\0\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x05Value\0\0\0" } } +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_VALUE: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"\xab\x8b\x8d\xf5b\x83\x98\xd7!D\xad\xa7\x1b\xbf\x9e\x1aa\xaf%C|J\x12\xf0\x81mI\xd7\x8e\xa6;\xd7", + [::SPEC_TYPE_ID], +); impl<'a> ContractClient<'a> { pub fn value(&self) -> Value { use core::ops::Not; diff --git a/tests-expanded/test_workspace_contract_wasm32v1-none.rs b/tests-expanded/test_workspace_contract_wasm32v1-none.rs index 5380b450d..87af5560a 100644 --- a/tests-expanded/test_workspace_contract_wasm32v1-none.rs +++ b/tests-expanded/test_workspace_contract_wasm32v1-none.rs @@ -45,6 +45,16 @@ impl Contract { *b"\0\0\0\0\0\0\0\0\0\0\0\x05value\0\0\0\0\0\0\0\0\0\0\x01\0\0\x07\xd0\0\0\0\x05Value\0\0\0" } } +#[link_section = "contractspecv0.rssdk.graphv0"] +#[allow(non_upper_case_globals)] +pub static __SPEC_GRAPH_FN_CONTRACT_VALUE: [u8; 74usize] = soroban_sdk::spec_shaking::encode_graph_record::< + 74usize, + 1usize, +>( + 0, + *b"\xab\x8b\x8d\xf5b\x83\x98\xd7!D\xad\xa7\x1b\xbf\x9e\x1aa\xaf%C|J\x12\xf0\x81mI\xd7\x8e\xa6;\xd7", + [::SPEC_TYPE_ID], +); impl<'a> ContractClient<'a> { pub fn value(&self) -> Value { use core::ops::Not; diff --git a/tests-expanded/test_workspace_lib_tests.rs b/tests-expanded/test_workspace_lib_tests.rs index cb8fd3bae..d68c14317 100644 --- a/tests-expanded/test_workspace_lib_tests.rs +++ b/tests-expanded/test_workspace_lib_tests.rs @@ -39,13 +39,18 @@ impl Value { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x05Value\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05value\0\0\0\0\0\0\x05" } } -impl soroban_sdk::SpecShakingMarker for Value { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - } +impl soroban_sdk::spec_shaking::SpecTypeId for Value { + const SPEC_TYPE_ID: [u8; 32] = *b"\x82\xf8t\xbe\t\x04b\\( + 2, + *b"\x82\xf8t\xbe\t\x04b\\ for Value { type Error = soroban_sdk::ConversionError; fn try_from_val( diff --git a/tests-expanded/test_workspace_lib_wasm32v1-none.rs b/tests-expanded/test_workspace_lib_wasm32v1-none.rs index 616d0ad54..e6ea4beca 100644 --- a/tests-expanded/test_workspace_lib_wasm32v1-none.rs +++ b/tests-expanded/test_workspace_lib_wasm32v1-none.rs @@ -40,17 +40,19 @@ impl Value { *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\x05Value\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05value\0\0\0\0\0\0\x05" } } -impl soroban_sdk::SpecShakingMarker for Value { - #[doc(hidden)] - #[inline(always)] - fn spec_shaking_marker() { - ::spec_shaking_marker(); - { - static MARKER: [u8; 14usize] = *b"SpEcV1\x82\xf8t\xbe\t\x04b\\"; - let _ = unsafe { ::core::ptr::read_volatile(MARKER.as_ptr()) }; - } - } +impl soroban_sdk::spec_shaking::SpecTypeId for Value { + const SPEC_TYPE_ID: [u8; 32] = *b"\x82\xf8t\xbe\t\x04b\\( + 2, + *b"\x82\xf8t\xbe\t\x04b\\ for Value { type Error = soroban_sdk::ConversionError; fn try_from_val( diff --git a/tests/associated_type_contracttrait/test_snapshots/test_with_wasm/test_exec.1.json b/tests/associated_type_contracttrait/test_snapshots/test_with_wasm/test_exec.1.json index 9e96fafb8..d8e1b1fc7 100644 --- a/tests/associated_type_contracttrait/test_snapshots/test_with_wasm/test_exec.1.json +++ b/tests/associated_type_contracttrait/test_snapshots/test_with_wasm/test_exec.1.json @@ -18,7 +18,7 @@ } }, "executable": { - "wasm": "5b61633ece44ac16e4c83604f38a43507220578262c9df06d078a39c465912d9" + "wasm": "91b40a7927ad58d0fc738509797054a1ca93e8cb64eb48acf0a8fa0e47016712" }, "constructor_args": [] } @@ -72,7 +72,7 @@ "val": { "contract_instance": { "executable": { - "wasm": "5b61633ece44ac16e4c83604f38a43507220578262c9df06d078a39c465912d9" + "wasm": "91b40a7927ad58d0fc738509797054a1ca93e8cb64eb48acf0a8fa0e47016712" }, "storage": null } @@ -106,8 +106,8 @@ } } }, - "hash": "5b61633ece44ac16e4c83604f38a43507220578262c9df06d078a39c465912d9", - "code": "0061736d0100000001110360027e7e017e6000017e60027f7f017e02070101620169000003040301020105030100110621047f01418080c0000b7f00418f80c0000b7f00418f80c0000b7f00419080c0000b073806066d656d6f72790200046578656300010565786563320003015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030a3e031000418080c0800041071082808080000b1a002000ad4220864204842001ad4220864204841080808080000b1000418780c0800041081082808080000b0b180100418080c0000b0f64656661756c7464656661756c7432004b0e636f6e7472616374737065637630000000000000000000000004657865630000000000000001000000100000000000000000000000056578656332000000000000000000000100000010001e11636f6e7472616374656e766d6574617630000000000000001a00000000004f0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e39312e3000000000000000000012727373646b5f737065635f7368616b696e6700000000000132000000" + "hash": "91b40a7927ad58d0fc738509797054a1ca93e8cb64eb48acf0a8fa0e47016712", + "code": "0061736d0100000001110360027e7e017e6000017e60027f7f017e02070101620169000003040301020105030100110621047f01418080c0000b7f00418f80c0000b7f00418f80c0000b7f00419080c0000b073806066d656d6f72790200046578656300010565786563320003015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030a3e031000418080c0800041071082808080000b1a002000ad4220864204842001ad4220864204841080808080000b1000418780c0800041081082808080000b0b180100418080c0000b0f64656661756c7464656661756c743200df150e636f6e747261637473706563763000000000000000000000000465786563000000000000000100000010000000000000000000000005657865633200000000000000000000010000001000000002000000e3436f6e74657874206f6620612073696e676c6520617574686f72697a65642063616c6c20706572666f726d656420627920616e20616464726573732e0a0a437573746f6d206163636f756e7420636f6e747261637473207468617420696d706c656d656e7420605f5f636865636b5f6175746860207370656369616c2066756e6374696f6e0a726563656976652061206c697374206f662060436f6e74657874602076616c75657320636f72726573706f6e64696e6720746f20616c6c207468652063616c6c7320746861740a6e65656420746f20626520617574686f72697a65642e000000000000000007436f6e7465787400000000030000000100000014436f6e747261637420696e766f636174696f6e2e00000008436f6e747261637400000001000007d00000000f436f6e7472616374436f6e7465787400000000010000003d436f6e7472616374207468617420686173206120636f6e7374727563746f722077697468206e6f20617267756d656e747320697320637265617465642e00000000000014437265617465436f6e7472616374486f7374466e00000001000007d00000001b437265617465436f6e7472616374486f7374466e436f6e74657874000000000100000044436f6e7472616374207468617420686173206120636f6e7374727563746f7220776974682031206f72206d6f726520617267756d656e747320697320637265617465642e0000001c437265617465436f6e74726163745769746843746f72486f7374466e00000001000007d00000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e74657874000000000001000000bd417574686f72697a6174696f6e20636f6e74657874206f6620612073696e676c6520636f6e74726163742063616c6c2e0a0a546869732073747275637420636f72726573706f6e647320746f20612060726571756972655f617574685f666f725f61726773602063616c6c20666f7220616e20616464726573730a66726f6d2060636f6e7472616374602066756e6374696f6e20776974682060666e5f6e616d6560206e616d6520616e642060617267736020617267756d656e74732e000000000000000000000f436f6e7472616374436f6e746578740000000003000000000000000461726773000003ea000000000000000000000008636f6e7472616374000000130000000000000007666e5f6e616d650000000011000000020000005f436f6e74726163742065786563757461626c65207573656420666f72206372656174696e672061206e657720636f6e747261637420616e64207573656420696e0a60437265617465436f6e7472616374486f7374466e436f6e74657874602e000000000000000012436f6e747261637445786563757461626c650000000000010000000100000000000000045761736d00000001000003ee00000020000000010000003856616c7565206f6620636f6e7472616374206e6f646520696e20496e766f6b6572436f6e747261637441757468456e74727920747265652e0000000000000015537562436f6e7472616374496e766f636174696f6e000000000000020000000000000007636f6e7465787400000007d00000000f436f6e7472616374436f6e7465787400000000000000000f7375625f696e766f636174696f6e7300000003ea000007d000000018496e766f6b6572436f6e747261637441757468456e747279000000020000012f41206e6f646520696e207468652074726565206f6620617574686f72697a6174696f6e7320706572666f726d6564206f6e20626568616c66206f66207468652063757272656e740a636f6e747261637420617320696e766f6b6572206f662074686520636f6e7472616374732064656570657220696e207468652063616c6c20737461636b2e0a0a54686973206973207573656420617320616e20617267756d656e74206f662060617574686f72697a655f61735f63757272656e745f636f6e74726163746020686f73742066756e6374696f6e2e0a0a54686973207472656520636f72726573706f6e64732060726571756972655f617574685b5f666f725f617267735d602063616c6c73206f6e20626568616c66206f66207468650a63757272656e7420636f6e74726163742e000000000000000018496e766f6b6572436f6e747261637441757468456e747279000000030000000100000012496e766f6b65206120636f6e74726163742e000000000008436f6e747261637400000001000007d000000015537562436f6e7472616374496e766f636174696f6e0000000000000100000035437265617465206120636f6e74726163742070617373696e67203020617267756d656e747320746f20636f6e7374727563746f722e00000000000014437265617465436f6e7472616374486f7374466e00000001000007d00000001b437265617465436f6e7472616374486f7374466e436f6e7465787400000000010000003d437265617465206120636f6e74726163742070617373696e672030206f72206d6f726520617267756d656e747320746f20636f6e7374727563746f722e0000000000001c437265617465436f6e74726163745769746843746f72486f7374466e00000001000007d00000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e7465787400000000000100000076417574686f72697a6174696f6e20636f6e7465787420666f7220606372656174655f636f6e74726163746020686f73742066756e6374696f6e2074686174206372656174657320610a6e657720636f6e7472616374206f6e20626568616c66206f6620617574686f72697a657220616464726573732e0000000000000000001b437265617465436f6e7472616374486f7374466e436f6e746578740000000002000000000000000a65786563757461626c650000000007d000000012436f6e747261637445786563757461626c650000000000000000000473616c74000003ee0000002000000001000000d6417574686f72697a6174696f6e20636f6e7465787420666f7220606372656174655f636f6e74726163746020686f73742066756e6374696f6e2074686174206372656174657320610a6e657720636f6e7472616374206f6e20626568616c66206f6620617574686f72697a657220616464726573732e0a54686973206973207468652073616d652061732060437265617465436f6e7472616374486f7374466e436f6e74657874602c2062757420616c736f206861730a636f6e747261637420636f6e7374727563746f7220617267756d656e74732e0000000000000000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e746578740000000000030000000000000010636f6e7374727563746f725f61726773000003ea00000000000000000000000a65786563757461626c650000000007d000000012436f6e747261637445786563757461626c650000000000000000000473616c74000003ee000000200000000200000000000000000000000a45786563757461626c650000000000030000000100000000000000045761736d00000001000003ee0000002000000000000000000000000c5374656c6c617241737365740000000000000000000000074163636f756e74000081061c636f6e74726163747370656376302e727373646b2e677261706876305370477256010000a520354a3b50911067e90e43393637c513e623b2a0577476ee4ceda1965d7af200005370477256010000d336b88c63486f019c696bcf29446936484e474c78530fbcf214fd156a9446f000005370477256010002a34acff744930b425d95ebfe03798365355c16eb944e65e658771f26f7c070540003f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec15e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e73940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af5370477256010002f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec00005370477256010002b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc000053704772560100029e29488ef0017b7bce9f644f0e44c02c0fe8ee278435729feb60d012481796670002f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec554c7144d3fa3a1f0ca5b704e5488b914a9e0f657f9f5bdb4723c76fb0f4cfe65370477256010002554c7144d3fa3a1f0ca5b704e5488b914a9e0f657f9f5bdb4723c76fb0f4cfe600039e29488ef0017b7bce9f644f0e44c02c0fe8ee278435729feb60d0124817966715e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e73940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af537047725601000215e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e0001b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc537047725601000273940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af0001b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc53704772560100024c7c7b0df4f21aa8f69831e24bcb82344ee697eddfc21c636bd6ce579c78101e0000001e11636f6e7472616374656e766d6574617630000000000000001a00000000004f0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e39312e3000000000000000000012727373646b5f737065635f7368616b696e6700000000000132000000" } }, "ext": "v0" diff --git a/tests/spec_shaking_v1/src/test.rs b/tests/spec_shaking_v1/src/test.rs index 9981a953c..cf407e746 100644 --- a/tests/spec_shaking_v1/src/test.rs +++ b/tests/spec_shaking_v1/src/test.rs @@ -53,6 +53,8 @@ fn test_spec_shaking_v1() { "with_non_pub_error", "with_tuple", "with_tuple_return", + "__check_auth", + "__constructor", ] { assert!( fn_names.contains(&expected_fn.into()), @@ -89,12 +91,17 @@ fn test_spec_shaking_v1() { "UsedResultOk", "UsedTupleElement", "UsedTupleReturnElement", + "UsedRecursiveRoot", + "UsedRecursiveNode", + "UsedRecursiveLeaf", + "UsedLeaf", "UnusedNonContractFnParam", "UnusedNonContractFnReturn", "UnusedStruct", "UnusedEnum", "UnusedIntEnum", "UnusedEvent", + "Context" ]; for name in pub_types { assert!( @@ -145,6 +152,32 @@ fn test_spec_shaking_v1() { ); } + // sdk contract types are not in the WASM spec + let sdk_types = [ + "Executable", + "InvokerContractAuthEntry", + "SubContractInvocation", + "ContractContext", + "CreateContractHostFnContext", + "CreateContractWithConstructorHostFnContext", + "ContractExecutable", + ]; + for name in sdk_types { + assert!( + !all_names.contains(name), + "sdk contract type {name} should NOT have a spec entry" + ); + } + // ensure the `Context` is the user-defined context + assert!( + entries.iter().any(|e| matches!( + e, + ScSpecEntry::UdtStructV0(s) if s.name.to_utf8_string_lossy() == "Context" + )), + "User-defined Context should be retained as a reachable contract spec UDT" + ); + + // WASM-imported types have export = false without the feature, so they do // not contribute additional spec entries. (Their names overlap with // lib-imported types above, which ARE present from rlib linking.) diff --git a/tests/spec_shaking_v2/src/lib.rs b/tests/spec_shaking_v2/src/lib.rs index ab4ddb884..c7b6036db 100644 --- a/tests/spec_shaking_v2/src/lib.rs +++ b/tests/spec_shaking_v2/src/lib.rs @@ -1,13 +1,13 @@ #![no_std] use soroban_sdk::{ - assert_with_error, contract, contracterror, contractevent, contractimpl, contracttype, - panic_with_error, Env, Map, Symbol, Vec, + assert_with_error, auth::CustomAccountInterface, contract, contracterror, contractevent, + contractimpl, contracttype, crypto::Hash, panic_with_error, Env, Map, Symbol, Vec, }; #[contract] pub struct Contract; -// --- Used types: markers expected --- +// --- Used types: reachable from function specs or event-root markers --- // Used as fn param (struct with nested type) #[contracttype] @@ -17,6 +17,20 @@ pub struct UsedParamStruct { pub nested: UsedNestedInStruct, } +// Used only as constructor param +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct UsedConstructorMeta { + pub val: u32, +} + +// Used as fn param with the same name as soroban_sdk::auth::Context. +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct Context { + pub val: u32, +} + // Used as fn return (union enum) #[contracttype] #[derive(Clone, Debug, Eq, PartialEq)] @@ -41,6 +55,14 @@ pub enum UsedErrorEnum { Invalid = 2, } +// Used as custom account error return. +#[contracterror] +#[derive(Copy, Clone, Debug, Eq, PartialEq)] +pub enum UsedAuthErrorEnum { + NotFound = 1, + Invalid = 2, +} + // Used only via panic_with_error! (never appears in a Result return). #[contracterror] #[derive(Copy, Clone, Debug, Eq, PartialEq)] @@ -48,6 +70,13 @@ pub enum UsedPanicErrorEnum { Boom = 1, } +// Used only via panic_with_error! as a reference (never appears in a Result return). +#[contracterror] +#[derive(Copy, Clone, Debug, Eq, PartialEq)] +pub enum UsedPanicErrorEnumRef { + Boom = 1, +} + // Used only via assert_with_error! (never appears in a Result return). #[contracterror] #[derive(Copy, Clone, Debug, Eq, PartialEq)] @@ -98,6 +127,13 @@ pub struct UsedResultOk { pub data: u32, } +// Used as custom account signature type in __check_auth. +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct CustomSignature { + pub nonce: u32, +} + // Used as published event (simple, primitive fields only) #[contractevent] #[derive(Clone, Debug, Eq, PartialEq)] @@ -223,7 +259,30 @@ pub struct UsedTupleReturnElement { pub val: u32, } -// --- Non-pub used types: spec entries + markers expected with feature --- +// Used as nested type in Vec element in fn param +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct UsedVecInnerVecElement { + pub val: u32, +} + +// Used as nested type in Vec element in fn param +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct UsedVecInnerElement { + pub val: u32, +} + +// Used as type in Vec element in fn param containing custom types +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct UsedVecElementNested { + pub val: u32, + pub inner: UsedVecInnerElement, + pub vec_inner: Vec, +} + +// --- Non-pub used types: spec entries expected with feature --- // Non-pub struct used as fn param #[contracttype] @@ -239,17 +298,44 @@ enum UsedNonPubError { Fail = 1, } +// --- Recursive types: graph pruning should include all reachable entries --- + +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct UsedRecursiveRoot { + pub val: UsedRecursiveNode, +} + +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum UsedRecursiveNode { + NotRecursive(UsedLeaf), + Recursive(UsedRecursiveLeaf), +} + +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct UsedRecursiveLeaf { + pub val: Vec, +} + +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct UsedLeaf { + pub val: u32, +} + // --- Lib-imported types (Rust crate dep): rlib statics linked into cdylib --- // Only StructC is used in a contract fn; other spec_lib types have spec entries -// but no markers. +// but are not rooted by any function or published event. -// --- WASM-imported types (contractimport!): only used ones should have markers --- +// --- WASM-imported types (contractimport!): only used ones should survive pruning --- mod wasm_imported { soroban_sdk::contractimport!(file = "../../target/wasm32v1-none/release/test_spec_import.wasm"); } -// --- Unused types: no markers expected --- +// --- Unused types: not rooted by function specs or published events --- #[contracttype] #[derive(Clone, Debug, Eq, PartialEq)] @@ -301,14 +387,14 @@ pub struct UnusedNonContractFnReturn { pub x: u32, } -// Non-pub unused struct: spec entry exists but no marker +// Non-pub unused struct: spec entry exists but is not rooted. #[contracttype] #[derive(Clone, Debug, Eq, PartialEq)] struct UnusedNonPubStruct { pub x: u32, } -// Non-pub unused error: spec entry exists but no marker +// Non-pub unused error: spec entry exists but is not rooted. #[contracterror] #[derive(Copy, Clone, Debug, Eq, PartialEq)] enum UnusedNonPubError { @@ -318,8 +404,12 @@ enum UnusedNonPubError { #[allow(private_interfaces)] #[contractimpl] impl Contract { + pub fn __constructor(_env: Env, _meta: UsedConstructorMeta) {} + pub fn with_param(_env: Env, _s: UsedParamStruct, _ie: UsedParamIntEnum) {} + pub fn with_context(_env: Env, _context: Context) {} + pub fn with_return(_env: Env) -> UsedReturnEnum { UsedReturnEnum::A(1) } @@ -334,6 +424,12 @@ impl Contract { } } + pub fn with_panic_error_ref(env: Env, fail: bool) { + if fail { + panic_with_error!(&env, &UsedPanicErrorEnumRef::Boom); + } + } + pub fn with_assert_error(env: Env, ok: bool) { assert_with_error!(&env, ok, UsedAssertErrorEnum::Bad); } @@ -349,6 +445,8 @@ impl Contract { pub fn with_vec(_env: Env, _v: Vec) {} + pub fn with_vec_nested(_env: Env, _v: Vec) {} + pub fn with_map(_env: Env, _m: Map) {} pub fn with_option(_env: Env, _o: Option) {} @@ -357,6 +455,8 @@ impl Contract { Ok(UsedResultOk { data: 1 }) } + pub fn with_recursion(_env: Env, _r: UsedRecursiveRoot) {} + pub fn publish_simple(env: Env) { UsedEventSimple { kind: Symbol::new(&env, "transfer"), @@ -430,8 +530,23 @@ impl Contract { } } -// Non-contractimpl function: types used here should NOT have markers since -// they are not at a contract boundary. +#[contractimpl] +impl CustomAccountInterface for Contract { + type Error = UsedAuthErrorEnum; + type Signature = CustomSignature; + + fn __check_auth( + _env: Env, + _signature_payload: Hash<32>, + _signatures: Self::Signature, + _auth_contexts: Vec, + ) -> Result<(), UsedAuthErrorEnum> { + Ok(()) + } +} + +// Non-contractimpl function: types used here should not be kept since they are +// not at a contract boundary. #[allow(dead_code)] fn non_contract_fn(_s: UnusedNonContractFnParam) -> UnusedNonContractFnReturn { UnusedNonContractFnReturn { x: 1 } diff --git a/tests/spec_shaking_v2/src/test.rs b/tests/spec_shaking_v2/src/test.rs index 40c3cc360..fb577bfc3 100644 --- a/tests/spec_shaking_v2/src/test.rs +++ b/tests/spec_shaking_v2/src/test.rs @@ -12,12 +12,22 @@ fn test_spec_shaking_v2() { // Read all spec entries from the WASM. let entries = soroban_spec::read::from_wasm(WASM).unwrap(); - // Find markers embedded in the WASM data section. + // Find event-root markers embedded in the WASM data section. let markers = soroban_spec::shaking::find_all(WASM); + let graph = soroban_spec::shaking::find_graph(WASM).unwrap(); - // Filter entries using markers. - let filtered: Vec<_> = - soroban_spec::shaking::filter(entries.iter().cloned(), &markers).collect(); + // Filter entries using function roots, event-root markers, and sidecar graph refs. + assert!(!graph.entries.is_empty()); + let filtered: Vec<_> = soroban_spec::shaking::filter(entries.iter().cloned(), &markers, &graph) + .unwrap() + .collect(); + + let shaken = soroban_spec::strip::shake_contract_spec(WASM).unwrap(); + assert_eq!(soroban_spec::read::from_wasm(&shaken).unwrap(), filtered); + assert!(soroban_spec::shaking::find_graph(&shaken) + .unwrap() + .entries + .is_empty()); // Collect names of filtered entries by kind for assertions. let filtered_names: HashSet = @@ -35,14 +45,19 @@ fn test_spec_shaking_v2() { }) .collect(); for expected_fn in [ + "__constructor", "with_param", + "with_context", "with_return", "with_error", "with_panic_error", + "with_panic_error_ref", "with_assert_error", "with_panic_raw_error", "with_vec", + "with_vec_nested", "with_map", + "with_recursion", "publish_simple", "publish_topic_type", "publish_data_type", @@ -57,6 +72,7 @@ fn test_spec_shaking_v2() { "with_non_pub_error", "with_tuple", "with_tuple_return", + "__check_auth", ] { assert!( fn_names.contains(&expected_fn.into()), @@ -67,12 +83,16 @@ fn test_spec_shaking_v2() { // Used types/events should be present. let used = [ // fn param/return/error types + "UsedConstructorMeta", + "Context", "UsedParamStruct", "UsedReturnEnum", "UsedParamIntEnum", "UsedErrorEnum", + "UsedAuthErrorEnum", // error types used only via panic_with_error! / assert_with_error! "UsedPanicErrorEnum", + "UsedPanicErrorEnumRef", "UsedAssertErrorEnum", // nested in fn param struct "UsedNestedInStruct", @@ -80,10 +100,21 @@ fn test_spec_shaking_v2() { "UsedVecElement", "UsedMapKey", "UsedMapVal", + // vec element with nested custom types in data + "UsedVecInnerVecElement", + "UsedVecInnerElement", + "UsedVecElementNested", // Option element type in fn param "UsedOptionElement", // Result Ok type in fn return "UsedResultOk", + // custom account signature type + "CustomSignature", + // SDK auth types used by custom account auth context + "ContractContext", + "CreateContractHostFnContext", + "CreateContractWithConstructorHostFnContext", + "ContractExecutable", // simple event "UsedEventSimple", // event with custom type in topic @@ -115,6 +146,11 @@ fn test_spec_shaking_v2() { "StructC", // wasm-imported type used as fn param "StructA", + // recursive type used as fn param + "UsedRecursiveRoot", + "UsedRecursiveNode", + "UsedRecursiveLeaf", + "UsedLeaf", ]; for name in used { assert!( @@ -123,7 +159,27 @@ fn test_spec_shaking_v2() { ); } - // Unused types/events should exist in unfiltered entries (they have spec entries, just no markers). + // If two types with the same name are included, retain both + assert!( + filtered.iter().any(|e| matches!( + e, + ScSpecEntry::UdtUnionV0(u) if u.name.to_utf8_string_lossy() == "Context" + )), + "SDK auth Context should be retained as a reachable contract spec UDT" + ); + assert!( + filtered.iter().any(|e| matches!( + e, + ScSpecEntry::UdtStructV0(s) if s.name.to_utf8_string_lossy() == "Context" + )), + "User-defined Context should be retained as a reachable contract spec UDT" + ); + + // Function input/output types are rooted from contractspecv0. Events and + // panic/assert-only errors need markers because their reachability is not in the spec. + assert_eq!(markers.len(), 9); + + // Unused types/events should exist in unfiltered entries. let unused = [ "UnusedStruct", "UnusedEnum", @@ -133,7 +189,7 @@ fn test_spec_shaking_v2() { // Types used only in non-contractimpl fns (not at contract boundary) "UnusedNonContractFnParam", "UnusedNonContractFnReturn", - // Non-pub unused types (spec entries generated by feature, but no markers) + // Non-pub unused types (spec entries generated by feature) "UnusedNonPubStruct", "UnusedNonPubError", // Lib-imported types not used in any contract fn (rlib statics linked into cdylib) @@ -153,6 +209,10 @@ fn test_spec_shaking_v2() { "EventA", "EventB", "EventC", + // SDK-owned types emitted as v2 spec candidates but not reachable here + "Executable", + "InvokerContractAuthEntry", + "SubContractInvocation", ]; let all_names: HashSet = entries.iter().filter_map(entry_name).collect(); for name in unused { @@ -169,6 +229,7 @@ fn test_spec_shaking_v2() { "unused type/event {name} should be absent from filtered entries, but was found" ); } + assert_eq!(all_names.len() - filtered_names.len(), unused.len()); } /// Extract the name from a non-function spec entry. diff --git a/tests/tuples/test_snapshots/test/test_wasm_tuple1.1.json b/tests/tuples/test_snapshots/test/test_wasm_tuple1.1.json index 8b912ea12..10a4c5117 100644 --- a/tests/tuples/test_snapshots/test/test_wasm_tuple1.1.json +++ b/tests/tuples/test_snapshots/test/test_wasm_tuple1.1.json @@ -18,7 +18,7 @@ } }, "executable": { - "wasm": "410dc845492e2dda43b2653584a870cd877607a840671eb5b78279747b295a52" + "wasm": "e916030c809a5211907236c6af16ee952f7bd175c5cd70f685b6e8d04e5d0280" }, "constructor_args": [] } @@ -71,7 +71,7 @@ "val": { "contract_instance": { "executable": { - "wasm": "410dc845492e2dda43b2653584a870cd877607a840671eb5b78279747b295a52" + "wasm": "e916030c809a5211907236c6af16ee952f7bd175c5cd70f685b6e8d04e5d0280" }, "storage": null } @@ -105,8 +105,8 @@ } } }, - "hash": "410dc845492e2dda43b2653584a870cd877607a840671eb5b78279747b295a52", - "code": "0061736d01000000011f0560017e017e60027e7e017e60037e7e7e017e60037e7f7f0060027f7f017e021904016901320000016901310000017601670001017601680002030605000304000005030100100621047f01418080c0000b7f00418080c0000b7f00418080c0000b7f00418080c0000b074507066d656d6f72790200067475706c65310004067475706c6532000707766f69645f666e0008015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030ac803057801017f23808080800041106b220124808080800002400240200042ff018342cb00520d00200142023703082000200141086a41011085808080002001290308220042ff01834204510d010b000b2001200042848080807083370308200141086a41011086808080002100200141106a24808080800020000b1d0020002001ad4220864204842002ad4220864204841083808080001a0b1a002000ad4220864204842001ad4220864204841082808080000bff0102027f017e23808080800041106b2201248080808000024002400240200042ff018342cb00520d00410021020240034020024110460d01200120026a4202370300200241086a21020c000b0b2000200141021085808080002001290300220342ff01834204520d0020012903082200a741ff0171220241c100460d0120024107470d00200042088721000c020b000b200010808080800021000b0240024020004280808080808080c0007c42ffffffffffffffff00560d00200042088642078421000c010b200010818080800021000b200120003703082001200342848080807083370300200141021086808080002100200141106a24808080800020000b13000240200042ff01834202510d00000b42020b0b090100418080c0000b0000cb010e636f6e74726163747370656376300000000000000000000000067475706c6531000000000001000000000000000361726700000003ed000000010000000400000001000003ed00000001000000040000000000000000000000067475706c6532000000000001000000000000000361726700000003ed00000002000000040000000700000001000003ed000000020000000400000007000000000000000000000007766f69645f666e00000000010000000000000008766f69645f617267000000020000000100000002001e11636f6e7472616374656e766d6574617630000000000000001a00000000004f0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e39312e3000000000000000000012727373646b5f737065635f7368616b696e6700000000000132000000" + "hash": "e916030c809a5211907236c6af16ee952f7bd175c5cd70f685b6e8d04e5d0280", + "code": "0061736d01000000011f0560017e017e60027e7e017e60037e7e7e017e60037e7f7f0060027f7f017e021904016901320000016901310000017601670001017601680002030605000304000005030100100621047f01418080c0000b7f00418080c0000b7f00418080c0000b7f00418080c0000b074507066d656d6f72790200067475706c65310004067475706c6532000707766f69645f666e0008015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030ac803057801017f23808080800041106b220124808080800002400240200042ff018342cb00520d00200142023703082000200141086a41011085808080002001290308220042ff01834204510d010b000b2001200042848080807083370308200141086a41011086808080002100200141106a24808080800020000b1d0020002001ad4220864204842002ad4220864204841083808080001a0b1a002000ad4220864204842001ad4220864204841082808080000bff0102027f017e23808080800041106b2201248080808000024002400240200042ff018342cb00520d00410021020240034020024110460d01200120026a4202370300200241086a21020c000b0b2000200141021085808080002001290300220342ff01834204520d0020012903082200a741ff0171220241c100460d0120024107470d00200042088721000c020b000b200010808080800021000b0240024020004280808080808080c0007c42ffffffffffffffff00560d00200042088642078421000c010b200010818080800021000b200120003703082001200342848080807083370300200141021086808080002100200141106a24808080800020000b13000240200042ff01834202510d00000b42020b0b090100418080c0000b0000df160e636f6e74726163747370656376300000000000000000000000067475706c6531000000000001000000000000000361726700000003ed000000010000000400000001000003ed00000001000000040000000000000000000000067475706c6532000000000001000000000000000361726700000003ed00000002000000040000000700000001000003ed000000020000000400000007000000000000000000000007766f69645f666e00000000010000000000000008766f69645f61726700000002000000010000000200000002000000e3436f6e74657874206f6620612073696e676c6520617574686f72697a65642063616c6c20706572666f726d656420627920616e20616464726573732e0a0a437573746f6d206163636f756e7420636f6e747261637473207468617420696d706c656d656e7420605f5f636865636b5f6175746860207370656369616c2066756e6374696f6e0a726563656976652061206c697374206f662060436f6e74657874602076616c75657320636f72726573706f6e64696e6720746f20616c6c207468652063616c6c7320746861740a6e65656420746f20626520617574686f72697a65642e000000000000000007436f6e7465787400000000030000000100000014436f6e747261637420696e766f636174696f6e2e00000008436f6e747261637400000001000007d00000000f436f6e7472616374436f6e7465787400000000010000003d436f6e7472616374207468617420686173206120636f6e7374727563746f722077697468206e6f20617267756d656e747320697320637265617465642e00000000000014437265617465436f6e7472616374486f7374466e00000001000007d00000001b437265617465436f6e7472616374486f7374466e436f6e74657874000000000100000044436f6e7472616374207468617420686173206120636f6e7374727563746f7220776974682031206f72206d6f726520617267756d656e747320697320637265617465642e0000001c437265617465436f6e74726163745769746843746f72486f7374466e00000001000007d00000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e74657874000000000001000000bd417574686f72697a6174696f6e20636f6e74657874206f6620612073696e676c6520636f6e74726163742063616c6c2e0a0a546869732073747275637420636f72726573706f6e647320746f20612060726571756972655f617574685f666f725f61726773602063616c6c20666f7220616e20616464726573730a66726f6d2060636f6e7472616374602066756e6374696f6e20776974682060666e5f6e616d6560206e616d6520616e642060617267736020617267756d656e74732e000000000000000000000f436f6e7472616374436f6e746578740000000003000000000000000461726773000003ea000000000000000000000008636f6e7472616374000000130000000000000007666e5f6e616d650000000011000000020000005f436f6e74726163742065786563757461626c65207573656420666f72206372656174696e672061206e657720636f6e747261637420616e64207573656420696e0a60437265617465436f6e7472616374486f7374466e436f6e74657874602e000000000000000012436f6e747261637445786563757461626c650000000000010000000100000000000000045761736d00000001000003ee00000020000000010000003856616c7565206f6620636f6e7472616374206e6f646520696e20496e766f6b6572436f6e747261637441757468456e74727920747265652e0000000000000015537562436f6e7472616374496e766f636174696f6e000000000000020000000000000007636f6e7465787400000007d00000000f436f6e7472616374436f6e7465787400000000000000000f7375625f696e766f636174696f6e7300000003ea000007d000000018496e766f6b6572436f6e747261637441757468456e747279000000020000012f41206e6f646520696e207468652074726565206f6620617574686f72697a6174696f6e7320706572666f726d6564206f6e20626568616c66206f66207468652063757272656e740a636f6e747261637420617320696e766f6b6572206f662074686520636f6e7472616374732064656570657220696e207468652063616c6c20737461636b2e0a0a54686973206973207573656420617320616e20617267756d656e74206f662060617574686f72697a655f61735f63757272656e745f636f6e74726163746020686f73742066756e6374696f6e2e0a0a54686973207472656520636f72726573706f6e64732060726571756972655f617574685b5f666f725f617267735d602063616c6c73206f6e20626568616c66206f66207468650a63757272656e7420636f6e74726163742e000000000000000018496e766f6b6572436f6e747261637441757468456e747279000000030000000100000012496e766f6b65206120636f6e74726163742e000000000008436f6e747261637400000001000007d000000015537562436f6e7472616374496e766f636174696f6e0000000000000100000035437265617465206120636f6e74726163742070617373696e67203020617267756d656e747320746f20636f6e7374727563746f722e00000000000014437265617465436f6e7472616374486f7374466e00000001000007d00000001b437265617465436f6e7472616374486f7374466e436f6e7465787400000000010000003d437265617465206120636f6e74726163742070617373696e672030206f72206d6f726520617267756d656e747320746f20636f6e7374727563746f722e0000000000001c437265617465436f6e74726163745769746843746f72486f7374466e00000001000007d00000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e7465787400000000000100000076417574686f72697a6174696f6e20636f6e7465787420666f7220606372656174655f636f6e74726163746020686f73742066756e6374696f6e2074686174206372656174657320610a6e657720636f6e7472616374206f6e20626568616c66206f6620617574686f72697a657220616464726573732e0000000000000000001b437265617465436f6e7472616374486f7374466e436f6e746578740000000002000000000000000a65786563757461626c650000000007d000000012436f6e747261637445786563757461626c650000000000000000000473616c74000003ee0000002000000001000000d6417574686f72697a6174696f6e20636f6e7465787420666f7220606372656174655f636f6e74726163746020686f73742066756e6374696f6e2074686174206372656174657320610a6e657720636f6e7472616374206f6e20626568616c66206f6620617574686f72697a657220616464726573732e0a54686973206973207468652073616d652061732060437265617465436f6e7472616374486f7374466e436f6e74657874602c2062757420616c736f206861730a636f6e747261637420636f6e7374727563746f7220617267756d656e74732e0000000000000000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e746578740000000000030000000000000010636f6e7374727563746f725f61726773000003ea00000000000000000000000a65786563757461626c650000000007d000000012436f6e747261637445786563757461626c650000000000000000000473616c74000003ee000000200000000200000000000000000000000a45786563757461626c650000000000030000000100000000000000045761736d00000001000003ee0000002000000000000000000000000c5374656c6c617241737365740000000000000000000000074163636f756e740000ab061c636f6e74726163747370656376302e727373646b2e677261706876305370477256010000b0ef3c66b19868936d8fedf36fe11acad3eba677e1030b95cd42853ca153612100005370477256010000779ea13aed4e8a29ca95d46599fd9594466630772b4eef85876be5385365a36c0000537047725601000094832a3753b5431d4afd4496ff3e6a2e238be3d8d8400756f59331c6e7a1dc4300005370477256010002a34acff744930b425d95ebfe03798365355c16eb944e65e658771f26f7c070540003f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec15e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e73940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af5370477256010002f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec00005370477256010002b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc000053704772560100029e29488ef0017b7bce9f644f0e44c02c0fe8ee278435729feb60d012481796670002f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec554c7144d3fa3a1f0ca5b704e5488b914a9e0f657f9f5bdb4723c76fb0f4cfe65370477256010002554c7144d3fa3a1f0ca5b704e5488b914a9e0f657f9f5bdb4723c76fb0f4cfe600039e29488ef0017b7bce9f644f0e44c02c0fe8ee278435729feb60d0124817966715e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e73940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af537047725601000215e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e0001b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc537047725601000273940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af0001b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc53704772560100024c7c7b0df4f21aa8f69831e24bcb82344ee697eddfc21c636bd6ce579c78101e0000001e11636f6e7472616374656e766d6574617630000000000000001a00000000004f0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e39312e3000000000000000000012727373646b5f737065635f7368616b696e6700000000000132000000" } }, "ext": "v0" diff --git a/tests/tuples/test_snapshots/test/test_wasm_tuple2.1.json b/tests/tuples/test_snapshots/test/test_wasm_tuple2.1.json index 8b912ea12..10a4c5117 100644 --- a/tests/tuples/test_snapshots/test/test_wasm_tuple2.1.json +++ b/tests/tuples/test_snapshots/test/test_wasm_tuple2.1.json @@ -18,7 +18,7 @@ } }, "executable": { - "wasm": "410dc845492e2dda43b2653584a870cd877607a840671eb5b78279747b295a52" + "wasm": "e916030c809a5211907236c6af16ee952f7bd175c5cd70f685b6e8d04e5d0280" }, "constructor_args": [] } @@ -71,7 +71,7 @@ "val": { "contract_instance": { "executable": { - "wasm": "410dc845492e2dda43b2653584a870cd877607a840671eb5b78279747b295a52" + "wasm": "e916030c809a5211907236c6af16ee952f7bd175c5cd70f685b6e8d04e5d0280" }, "storage": null } @@ -105,8 +105,8 @@ } } }, - "hash": "410dc845492e2dda43b2653584a870cd877607a840671eb5b78279747b295a52", - "code": "0061736d01000000011f0560017e017e60027e7e017e60037e7e7e017e60037e7f7f0060027f7f017e021904016901320000016901310000017601670001017601680002030605000304000005030100100621047f01418080c0000b7f00418080c0000b7f00418080c0000b7f00418080c0000b074507066d656d6f72790200067475706c65310004067475706c6532000707766f69645f666e0008015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030ac803057801017f23808080800041106b220124808080800002400240200042ff018342cb00520d00200142023703082000200141086a41011085808080002001290308220042ff01834204510d010b000b2001200042848080807083370308200141086a41011086808080002100200141106a24808080800020000b1d0020002001ad4220864204842002ad4220864204841083808080001a0b1a002000ad4220864204842001ad4220864204841082808080000bff0102027f017e23808080800041106b2201248080808000024002400240200042ff018342cb00520d00410021020240034020024110460d01200120026a4202370300200241086a21020c000b0b2000200141021085808080002001290300220342ff01834204520d0020012903082200a741ff0171220241c100460d0120024107470d00200042088721000c020b000b200010808080800021000b0240024020004280808080808080c0007c42ffffffffffffffff00560d00200042088642078421000c010b200010818080800021000b200120003703082001200342848080807083370300200141021086808080002100200141106a24808080800020000b13000240200042ff01834202510d00000b42020b0b090100418080c0000b0000cb010e636f6e74726163747370656376300000000000000000000000067475706c6531000000000001000000000000000361726700000003ed000000010000000400000001000003ed00000001000000040000000000000000000000067475706c6532000000000001000000000000000361726700000003ed00000002000000040000000700000001000003ed000000020000000400000007000000000000000000000007766f69645f666e00000000010000000000000008766f69645f617267000000020000000100000002001e11636f6e7472616374656e766d6574617630000000000000001a00000000004f0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e39312e3000000000000000000012727373646b5f737065635f7368616b696e6700000000000132000000" + "hash": "e916030c809a5211907236c6af16ee952f7bd175c5cd70f685b6e8d04e5d0280", + "code": "0061736d01000000011f0560017e017e60027e7e017e60037e7e7e017e60037e7f7f0060027f7f017e021904016901320000016901310000017601670001017601680002030605000304000005030100100621047f01418080c0000b7f00418080c0000b7f00418080c0000b7f00418080c0000b074507066d656d6f72790200067475706c65310004067475706c6532000707766f69645f666e0008015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030ac803057801017f23808080800041106b220124808080800002400240200042ff018342cb00520d00200142023703082000200141086a41011085808080002001290308220042ff01834204510d010b000b2001200042848080807083370308200141086a41011086808080002100200141106a24808080800020000b1d0020002001ad4220864204842002ad4220864204841083808080001a0b1a002000ad4220864204842001ad4220864204841082808080000bff0102027f017e23808080800041106b2201248080808000024002400240200042ff018342cb00520d00410021020240034020024110460d01200120026a4202370300200241086a21020c000b0b2000200141021085808080002001290300220342ff01834204520d0020012903082200a741ff0171220241c100460d0120024107470d00200042088721000c020b000b200010808080800021000b0240024020004280808080808080c0007c42ffffffffffffffff00560d00200042088642078421000c010b200010818080800021000b200120003703082001200342848080807083370300200141021086808080002100200141106a24808080800020000b13000240200042ff01834202510d00000b42020b0b090100418080c0000b0000df160e636f6e74726163747370656376300000000000000000000000067475706c6531000000000001000000000000000361726700000003ed000000010000000400000001000003ed00000001000000040000000000000000000000067475706c6532000000000001000000000000000361726700000003ed00000002000000040000000700000001000003ed000000020000000400000007000000000000000000000007766f69645f666e00000000010000000000000008766f69645f61726700000002000000010000000200000002000000e3436f6e74657874206f6620612073696e676c6520617574686f72697a65642063616c6c20706572666f726d656420627920616e20616464726573732e0a0a437573746f6d206163636f756e7420636f6e747261637473207468617420696d706c656d656e7420605f5f636865636b5f6175746860207370656369616c2066756e6374696f6e0a726563656976652061206c697374206f662060436f6e74657874602076616c75657320636f72726573706f6e64696e6720746f20616c6c207468652063616c6c7320746861740a6e65656420746f20626520617574686f72697a65642e000000000000000007436f6e7465787400000000030000000100000014436f6e747261637420696e766f636174696f6e2e00000008436f6e747261637400000001000007d00000000f436f6e7472616374436f6e7465787400000000010000003d436f6e7472616374207468617420686173206120636f6e7374727563746f722077697468206e6f20617267756d656e747320697320637265617465642e00000000000014437265617465436f6e7472616374486f7374466e00000001000007d00000001b437265617465436f6e7472616374486f7374466e436f6e74657874000000000100000044436f6e7472616374207468617420686173206120636f6e7374727563746f7220776974682031206f72206d6f726520617267756d656e747320697320637265617465642e0000001c437265617465436f6e74726163745769746843746f72486f7374466e00000001000007d00000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e74657874000000000001000000bd417574686f72697a6174696f6e20636f6e74657874206f6620612073696e676c6520636f6e74726163742063616c6c2e0a0a546869732073747275637420636f72726573706f6e647320746f20612060726571756972655f617574685f666f725f61726773602063616c6c20666f7220616e20616464726573730a66726f6d2060636f6e7472616374602066756e6374696f6e20776974682060666e5f6e616d6560206e616d6520616e642060617267736020617267756d656e74732e000000000000000000000f436f6e7472616374436f6e746578740000000003000000000000000461726773000003ea000000000000000000000008636f6e7472616374000000130000000000000007666e5f6e616d650000000011000000020000005f436f6e74726163742065786563757461626c65207573656420666f72206372656174696e672061206e657720636f6e747261637420616e64207573656420696e0a60437265617465436f6e7472616374486f7374466e436f6e74657874602e000000000000000012436f6e747261637445786563757461626c650000000000010000000100000000000000045761736d00000001000003ee00000020000000010000003856616c7565206f6620636f6e7472616374206e6f646520696e20496e766f6b6572436f6e747261637441757468456e74727920747265652e0000000000000015537562436f6e7472616374496e766f636174696f6e000000000000020000000000000007636f6e7465787400000007d00000000f436f6e7472616374436f6e7465787400000000000000000f7375625f696e766f636174696f6e7300000003ea000007d000000018496e766f6b6572436f6e747261637441757468456e747279000000020000012f41206e6f646520696e207468652074726565206f6620617574686f72697a6174696f6e7320706572666f726d6564206f6e20626568616c66206f66207468652063757272656e740a636f6e747261637420617320696e766f6b6572206f662074686520636f6e7472616374732064656570657220696e207468652063616c6c20737461636b2e0a0a54686973206973207573656420617320616e20617267756d656e74206f662060617574686f72697a655f61735f63757272656e745f636f6e74726163746020686f73742066756e6374696f6e2e0a0a54686973207472656520636f72726573706f6e64732060726571756972655f617574685b5f666f725f617267735d602063616c6c73206f6e20626568616c66206f66207468650a63757272656e7420636f6e74726163742e000000000000000018496e766f6b6572436f6e747261637441757468456e747279000000030000000100000012496e766f6b65206120636f6e74726163742e000000000008436f6e747261637400000001000007d000000015537562436f6e7472616374496e766f636174696f6e0000000000000100000035437265617465206120636f6e74726163742070617373696e67203020617267756d656e747320746f20636f6e7374727563746f722e00000000000014437265617465436f6e7472616374486f7374466e00000001000007d00000001b437265617465436f6e7472616374486f7374466e436f6e7465787400000000010000003d437265617465206120636f6e74726163742070617373696e672030206f72206d6f726520617267756d656e747320746f20636f6e7374727563746f722e0000000000001c437265617465436f6e74726163745769746843746f72486f7374466e00000001000007d00000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e7465787400000000000100000076417574686f72697a6174696f6e20636f6e7465787420666f7220606372656174655f636f6e74726163746020686f73742066756e6374696f6e2074686174206372656174657320610a6e657720636f6e7472616374206f6e20626568616c66206f6620617574686f72697a657220616464726573732e0000000000000000001b437265617465436f6e7472616374486f7374466e436f6e746578740000000002000000000000000a65786563757461626c650000000007d000000012436f6e747261637445786563757461626c650000000000000000000473616c74000003ee0000002000000001000000d6417574686f72697a6174696f6e20636f6e7465787420666f7220606372656174655f636f6e74726163746020686f73742066756e6374696f6e2074686174206372656174657320610a6e657720636f6e7472616374206f6e20626568616c66206f6620617574686f72697a657220616464726573732e0a54686973206973207468652073616d652061732060437265617465436f6e7472616374486f7374466e436f6e74657874602c2062757420616c736f206861730a636f6e747261637420636f6e7374727563746f7220617267756d656e74732e0000000000000000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e746578740000000000030000000000000010636f6e7374727563746f725f61726773000003ea00000000000000000000000a65786563757461626c650000000007d000000012436f6e747261637445786563757461626c650000000000000000000473616c74000003ee000000200000000200000000000000000000000a45786563757461626c650000000000030000000100000000000000045761736d00000001000003ee0000002000000000000000000000000c5374656c6c617241737365740000000000000000000000074163636f756e740000ab061c636f6e74726163747370656376302e727373646b2e677261706876305370477256010000b0ef3c66b19868936d8fedf36fe11acad3eba677e1030b95cd42853ca153612100005370477256010000779ea13aed4e8a29ca95d46599fd9594466630772b4eef85876be5385365a36c0000537047725601000094832a3753b5431d4afd4496ff3e6a2e238be3d8d8400756f59331c6e7a1dc4300005370477256010002a34acff744930b425d95ebfe03798365355c16eb944e65e658771f26f7c070540003f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec15e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e73940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af5370477256010002f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec00005370477256010002b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc000053704772560100029e29488ef0017b7bce9f644f0e44c02c0fe8ee278435729feb60d012481796670002f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec554c7144d3fa3a1f0ca5b704e5488b914a9e0f657f9f5bdb4723c76fb0f4cfe65370477256010002554c7144d3fa3a1f0ca5b704e5488b914a9e0f657f9f5bdb4723c76fb0f4cfe600039e29488ef0017b7bce9f644f0e44c02c0fe8ee278435729feb60d0124817966715e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e73940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af537047725601000215e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e0001b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc537047725601000273940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af0001b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc53704772560100024c7c7b0df4f21aa8f69831e24bcb82344ee697eddfc21c636bd6ce579c78101e0000001e11636f6e7472616374656e766d6574617630000000000000001a00000000004f0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e39312e3000000000000000000012727373646b5f737065635f7368616b696e6700000000000132000000" } }, "ext": "v0" diff --git a/tests/tuples/test_snapshots/test/test_wasm_void.1.json b/tests/tuples/test_snapshots/test/test_wasm_void.1.json index 8b912ea12..10a4c5117 100644 --- a/tests/tuples/test_snapshots/test/test_wasm_void.1.json +++ b/tests/tuples/test_snapshots/test/test_wasm_void.1.json @@ -18,7 +18,7 @@ } }, "executable": { - "wasm": "410dc845492e2dda43b2653584a870cd877607a840671eb5b78279747b295a52" + "wasm": "e916030c809a5211907236c6af16ee952f7bd175c5cd70f685b6e8d04e5d0280" }, "constructor_args": [] } @@ -71,7 +71,7 @@ "val": { "contract_instance": { "executable": { - "wasm": "410dc845492e2dda43b2653584a870cd877607a840671eb5b78279747b295a52" + "wasm": "e916030c809a5211907236c6af16ee952f7bd175c5cd70f685b6e8d04e5d0280" }, "storage": null } @@ -105,8 +105,8 @@ } } }, - "hash": "410dc845492e2dda43b2653584a870cd877607a840671eb5b78279747b295a52", - "code": "0061736d01000000011f0560017e017e60027e7e017e60037e7e7e017e60037e7f7f0060027f7f017e021904016901320000016901310000017601670001017601680002030605000304000005030100100621047f01418080c0000b7f00418080c0000b7f00418080c0000b7f00418080c0000b074507066d656d6f72790200067475706c65310004067475706c6532000707766f69645f666e0008015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030ac803057801017f23808080800041106b220124808080800002400240200042ff018342cb00520d00200142023703082000200141086a41011085808080002001290308220042ff01834204510d010b000b2001200042848080807083370308200141086a41011086808080002100200141106a24808080800020000b1d0020002001ad4220864204842002ad4220864204841083808080001a0b1a002000ad4220864204842001ad4220864204841082808080000bff0102027f017e23808080800041106b2201248080808000024002400240200042ff018342cb00520d00410021020240034020024110460d01200120026a4202370300200241086a21020c000b0b2000200141021085808080002001290300220342ff01834204520d0020012903082200a741ff0171220241c100460d0120024107470d00200042088721000c020b000b200010808080800021000b0240024020004280808080808080c0007c42ffffffffffffffff00560d00200042088642078421000c010b200010818080800021000b200120003703082001200342848080807083370300200141021086808080002100200141106a24808080800020000b13000240200042ff01834202510d00000b42020b0b090100418080c0000b0000cb010e636f6e74726163747370656376300000000000000000000000067475706c6531000000000001000000000000000361726700000003ed000000010000000400000001000003ed00000001000000040000000000000000000000067475706c6532000000000001000000000000000361726700000003ed00000002000000040000000700000001000003ed000000020000000400000007000000000000000000000007766f69645f666e00000000010000000000000008766f69645f617267000000020000000100000002001e11636f6e7472616374656e766d6574617630000000000000001a00000000004f0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e39312e3000000000000000000012727373646b5f737065635f7368616b696e6700000000000132000000" + "hash": "e916030c809a5211907236c6af16ee952f7bd175c5cd70f685b6e8d04e5d0280", + "code": "0061736d01000000011f0560017e017e60027e7e017e60037e7e7e017e60037e7f7f0060027f7f017e021904016901320000016901310000017601670001017601680002030605000304000005030100100621047f01418080c0000b7f00418080c0000b7f00418080c0000b7f00418080c0000b074507066d656d6f72790200067475706c65310004067475706c6532000707766f69645f666e0008015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030ac803057801017f23808080800041106b220124808080800002400240200042ff018342cb00520d00200142023703082000200141086a41011085808080002001290308220042ff01834204510d010b000b2001200042848080807083370308200141086a41011086808080002100200141106a24808080800020000b1d0020002001ad4220864204842002ad4220864204841083808080001a0b1a002000ad4220864204842001ad4220864204841082808080000bff0102027f017e23808080800041106b2201248080808000024002400240200042ff018342cb00520d00410021020240034020024110460d01200120026a4202370300200241086a21020c000b0b2000200141021085808080002001290300220342ff01834204520d0020012903082200a741ff0171220241c100460d0120024107470d00200042088721000c020b000b200010808080800021000b0240024020004280808080808080c0007c42ffffffffffffffff00560d00200042088642078421000c010b200010818080800021000b200120003703082001200342848080807083370300200141021086808080002100200141106a24808080800020000b13000240200042ff01834202510d00000b42020b0b090100418080c0000b0000df160e636f6e74726163747370656376300000000000000000000000067475706c6531000000000001000000000000000361726700000003ed000000010000000400000001000003ed00000001000000040000000000000000000000067475706c6532000000000001000000000000000361726700000003ed00000002000000040000000700000001000003ed000000020000000400000007000000000000000000000007766f69645f666e00000000010000000000000008766f69645f61726700000002000000010000000200000002000000e3436f6e74657874206f6620612073696e676c6520617574686f72697a65642063616c6c20706572666f726d656420627920616e20616464726573732e0a0a437573746f6d206163636f756e7420636f6e747261637473207468617420696d706c656d656e7420605f5f636865636b5f6175746860207370656369616c2066756e6374696f6e0a726563656976652061206c697374206f662060436f6e74657874602076616c75657320636f72726573706f6e64696e6720746f20616c6c207468652063616c6c7320746861740a6e65656420746f20626520617574686f72697a65642e000000000000000007436f6e7465787400000000030000000100000014436f6e747261637420696e766f636174696f6e2e00000008436f6e747261637400000001000007d00000000f436f6e7472616374436f6e7465787400000000010000003d436f6e7472616374207468617420686173206120636f6e7374727563746f722077697468206e6f20617267756d656e747320697320637265617465642e00000000000014437265617465436f6e7472616374486f7374466e00000001000007d00000001b437265617465436f6e7472616374486f7374466e436f6e74657874000000000100000044436f6e7472616374207468617420686173206120636f6e7374727563746f7220776974682031206f72206d6f726520617267756d656e747320697320637265617465642e0000001c437265617465436f6e74726163745769746843746f72486f7374466e00000001000007d00000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e74657874000000000001000000bd417574686f72697a6174696f6e20636f6e74657874206f6620612073696e676c6520636f6e74726163742063616c6c2e0a0a546869732073747275637420636f72726573706f6e647320746f20612060726571756972655f617574685f666f725f61726773602063616c6c20666f7220616e20616464726573730a66726f6d2060636f6e7472616374602066756e6374696f6e20776974682060666e5f6e616d6560206e616d6520616e642060617267736020617267756d656e74732e000000000000000000000f436f6e7472616374436f6e746578740000000003000000000000000461726773000003ea000000000000000000000008636f6e7472616374000000130000000000000007666e5f6e616d650000000011000000020000005f436f6e74726163742065786563757461626c65207573656420666f72206372656174696e672061206e657720636f6e747261637420616e64207573656420696e0a60437265617465436f6e7472616374486f7374466e436f6e74657874602e000000000000000012436f6e747261637445786563757461626c650000000000010000000100000000000000045761736d00000001000003ee00000020000000010000003856616c7565206f6620636f6e7472616374206e6f646520696e20496e766f6b6572436f6e747261637441757468456e74727920747265652e0000000000000015537562436f6e7472616374496e766f636174696f6e000000000000020000000000000007636f6e7465787400000007d00000000f436f6e7472616374436f6e7465787400000000000000000f7375625f696e766f636174696f6e7300000003ea000007d000000018496e766f6b6572436f6e747261637441757468456e747279000000020000012f41206e6f646520696e207468652074726565206f6620617574686f72697a6174696f6e7320706572666f726d6564206f6e20626568616c66206f66207468652063757272656e740a636f6e747261637420617320696e766f6b6572206f662074686520636f6e7472616374732064656570657220696e207468652063616c6c20737461636b2e0a0a54686973206973207573656420617320616e20617267756d656e74206f662060617574686f72697a655f61735f63757272656e745f636f6e74726163746020686f73742066756e6374696f6e2e0a0a54686973207472656520636f72726573706f6e64732060726571756972655f617574685b5f666f725f617267735d602063616c6c73206f6e20626568616c66206f66207468650a63757272656e7420636f6e74726163742e000000000000000018496e766f6b6572436f6e747261637441757468456e747279000000030000000100000012496e766f6b65206120636f6e74726163742e000000000008436f6e747261637400000001000007d000000015537562436f6e7472616374496e766f636174696f6e0000000000000100000035437265617465206120636f6e74726163742070617373696e67203020617267756d656e747320746f20636f6e7374727563746f722e00000000000014437265617465436f6e7472616374486f7374466e00000001000007d00000001b437265617465436f6e7472616374486f7374466e436f6e7465787400000000010000003d437265617465206120636f6e74726163742070617373696e672030206f72206d6f726520617267756d656e747320746f20636f6e7374727563746f722e0000000000001c437265617465436f6e74726163745769746843746f72486f7374466e00000001000007d00000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e7465787400000000000100000076417574686f72697a6174696f6e20636f6e7465787420666f7220606372656174655f636f6e74726163746020686f73742066756e6374696f6e2074686174206372656174657320610a6e657720636f6e7472616374206f6e20626568616c66206f6620617574686f72697a657220616464726573732e0000000000000000001b437265617465436f6e7472616374486f7374466e436f6e746578740000000002000000000000000a65786563757461626c650000000007d000000012436f6e747261637445786563757461626c650000000000000000000473616c74000003ee0000002000000001000000d6417574686f72697a6174696f6e20636f6e7465787420666f7220606372656174655f636f6e74726163746020686f73742066756e6374696f6e2074686174206372656174657320610a6e657720636f6e7472616374206f6e20626568616c66206f6620617574686f72697a657220616464726573732e0a54686973206973207468652073616d652061732060437265617465436f6e7472616374486f7374466e436f6e74657874602c2062757420616c736f206861730a636f6e747261637420636f6e7374727563746f7220617267756d656e74732e0000000000000000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e746578740000000000030000000000000010636f6e7374727563746f725f61726773000003ea00000000000000000000000a65786563757461626c650000000007d000000012436f6e747261637445786563757461626c650000000000000000000473616c74000003ee000000200000000200000000000000000000000a45786563757461626c650000000000030000000100000000000000045761736d00000001000003ee0000002000000000000000000000000c5374656c6c617241737365740000000000000000000000074163636f756e740000ab061c636f6e74726163747370656376302e727373646b2e677261706876305370477256010000b0ef3c66b19868936d8fedf36fe11acad3eba677e1030b95cd42853ca153612100005370477256010000779ea13aed4e8a29ca95d46599fd9594466630772b4eef85876be5385365a36c0000537047725601000094832a3753b5431d4afd4496ff3e6a2e238be3d8d8400756f59331c6e7a1dc4300005370477256010002a34acff744930b425d95ebfe03798365355c16eb944e65e658771f26f7c070540003f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec15e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e73940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af5370477256010002f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec00005370477256010002b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc000053704772560100029e29488ef0017b7bce9f644f0e44c02c0fe8ee278435729feb60d012481796670002f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec554c7144d3fa3a1f0ca5b704e5488b914a9e0f657f9f5bdb4723c76fb0f4cfe65370477256010002554c7144d3fa3a1f0ca5b704e5488b914a9e0f657f9f5bdb4723c76fb0f4cfe600039e29488ef0017b7bce9f644f0e44c02c0fe8ee278435729feb60d0124817966715e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e73940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af537047725601000215e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e0001b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc537047725601000273940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af0001b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc53704772560100024c7c7b0df4f21aa8f69831e24bcb82344ee697eddfc21c636bd6ce579c78101e0000001e11636f6e7472616374656e766d6574617630000000000000001a00000000004f0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e39312e3000000000000000000012727373646b5f737065635f7368616b696e6700000000000132000000" } }, "ext": "v0" diff --git a/tests/udt/src/lib.rs b/tests/udt/src/lib.rs index 7ac903344..05d6d4e03 100644 --- a/tests/udt/src/lib.rs +++ b/tests/udt/src/lib.rs @@ -1,5 +1,5 @@ #![no_std] -use soroban_sdk::{contract, contractimpl, contracttype, Vec}; +use soroban_sdk::{contract, contractimpl, contracttype, Error, Map, Symbol, Vec}; #[contracttype] #[derive(Copy, Clone, Debug, Eq, PartialEq)] @@ -29,6 +29,27 @@ pub struct UdtStruct { pub c: Vec, } +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct UdtRecursive { + pub a: Symbol, + pub b: Vec, +} + +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct RecursiveToEnum { + pub a: Symbol, + pub b: Map, +} + +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum RecursiveEnum { + NotRecursive, + Recursive(RecursiveToEnum), +} + #[contract] pub struct Contract; @@ -49,12 +70,27 @@ impl Contract { }; a + b } + + pub fn recursive(a: UdtRecursive) -> Option { + if a.b.is_empty() { + None + } else { + Some(a.b.first_unchecked()) + } + } + + pub fn recursive_enum(a: RecursiveEnum, key: u32) -> Result, Error> { + match a { + RecursiveEnum::NotRecursive => Ok(None), + RecursiveEnum::Recursive(router) => Ok(router.b.get(key)), + } + } } #[cfg(test)] mod test { use super::*; - use soroban_sdk::{vec, xdr::ScVal, Bytes, Env, TryFromVal}; + use soroban_sdk::{symbol_short, vec, xdr::ScVal, Bytes, Env, TryFromVal}; #[test] fn test_serializing() { @@ -108,4 +144,126 @@ mod test { let roundtrip = UdtStruct::try_from_val(&e, &val).unwrap(); assert_eq!(udt, roundtrip); } + + #[test] + fn test_recursive() { + let e = Env::default(); + let contract_id = e.register(Contract, ()); + let client = ContractClient::new(&e, &contract_id); + + let recursive_udt_0 = UdtRecursive { + a: symbol_short!("0"), + b: vec![&e], + }; + let recursive_udt_1 = UdtRecursive { + a: symbol_short!("1"), + b: vec![&e, recursive_udt_0.clone()], + }; + let recursive_udt_2 = UdtRecursive { + a: symbol_short!("2"), + b: vec![&e, recursive_udt_1.clone()], + }; + + let result_0 = client.recursive(&recursive_udt_2); + assert_eq!(result_0, Some(recursive_udt_1)); + + let result_1 = client.recursive(&result_0.unwrap()); + assert_eq!(result_1, Some(recursive_udt_0)); + + let result_2 = client.recursive(&result_1.unwrap()); + assert_eq!(result_2, None); + } + + #[test] + fn test_recursive_enum() { + let e = Env::default(); + let contract_id = e.register(Contract, ()); + let client = ContractClient::new(&e, &contract_id); + + let entry = RecursiveEnum::Recursive(RecursiveToEnum { + a: symbol_short!("test"), + b: Map::from_array(&e, [(42u32, RecursiveEnum::NotRecursive)]), + }); + let result = client.recursive_enum(&entry, &42); + assert_eq!(result, Some(RecursiveEnum::NotRecursive)); + let none_result = client.recursive_enum(&entry, &43); + assert_eq!(none_result, None); + } +} + +#[cfg(test)] +mod test_with_wasm { + use soroban_sdk::{symbol_short, vec, Env, Map}; + + mod contract { + soroban_sdk::contractimport!(file = "../../target/wasm32v1-none/release/test_udt.wasm"); + } + + #[test] + fn test_add() { + let e = Env::default(); + let contract_id = e.register(contract::WASM, ()); + let client = contract::Client::new(&e, &contract_id); + + let udt = contract::UdtStruct { + a: 10, + b: 12, + c: vec![&e, 1], + }; + let z = client.add(&contract::UdtEnum::UdtA, &contract::UdtEnum::UdtB(udt)); + assert_eq!(z, 22); + + let udt1 = contract::UdtEnum2::A; + let udt2 = contract::UdtTuple(1, vec![&e, 2, 3]); + let z = client.add( + &contract::UdtEnum::UdtC(udt1), + &contract::UdtEnum::UdtD(udt2), + ); + assert_eq!(z, 16); + } + + #[test] + fn test_recursive() { + let e = Env::default(); + let contract_id = e.register(contract::WASM, ()); + let client = contract::Client::new(&e, &contract_id); + + let recursive_udt_0 = contract::UdtRecursive { + a: symbol_short!("0"), + b: vec![&e], + }; + let recursive_udt_1 = contract::UdtRecursive { + a: symbol_short!("1"), + b: vec![&e, recursive_udt_0.clone()], + }; + let recursive_udt_2 = contract::UdtRecursive { + a: symbol_short!("2"), + b: vec![&e, recursive_udt_1.clone()], + }; + + let result_0 = client.recursive(&recursive_udt_2); + assert_eq!(result_0, Some(recursive_udt_1)); + + let result_1 = client.recursive(&result_0.unwrap()); + assert_eq!(result_1, Some(recursive_udt_0)); + + let result_2 = client.recursive(&result_1.unwrap()); + assert_eq!(result_2, None); + } + + #[test] + fn test_recursive_enum() { + let e = Env::default(); + let contract_id = e.register(contract::WASM, ()); + let client = contract::Client::new(&e, &contract_id); + + let entry = contract::RecursiveEnum::Recursive(contract::RecursiveToEnum { + a: symbol_short!("test"), + b: Map::from_array(&e, [(42u32, contract::RecursiveEnum::NotRecursive)]), + }); + let result = client.recursive_enum(&entry, &42); + assert_eq!(result, Some(contract::RecursiveEnum::NotRecursive)); + let none_result = client.recursive_enum(&entry, &43); + assert_eq!(none_result, None); + } } diff --git a/tests/udt/test_snapshots/test/test_recursive.1.json b/tests/udt/test_snapshots/test/test_recursive.1.json new file mode 100644 index 000000000..2e8d29d5c --- /dev/null +++ b/tests/udt/test_snapshots/test/test_recursive.1.json @@ -0,0 +1,63 @@ +{ + "generators": { + "address": 1, + "nonce": 0, + "mux_id": 0 + }, + "auth": [ + [], + [], + [], + [] + ], + "ledger": { + "protocol_version": 26, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + { + "entry": { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + "live_until": 4095 + }, + { + "entry": { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + "live_until": 4095 + } + ] + }, + "events": [] +} \ No newline at end of file diff --git a/tests/udt/test_snapshots/test/test_recursive_enum.1.json b/tests/udt/test_snapshots/test/test_recursive_enum.1.json new file mode 100644 index 000000000..b5b2bc44d --- /dev/null +++ b/tests/udt/test_snapshots/test/test_recursive_enum.1.json @@ -0,0 +1,62 @@ +{ + "generators": { + "address": 1, + "nonce": 0, + "mux_id": 0 + }, + "auth": [ + [], + [], + [] + ], + "ledger": { + "protocol_version": 26, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + { + "entry": { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + "live_until": 4095 + }, + { + "entry": { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + "live_until": 4095 + } + ] + }, + "events": [] +} \ No newline at end of file diff --git a/tests/udt/test_snapshots/test_with_wasm/test_add.1.json b/tests/udt/test_snapshots/test_with_wasm/test_add.1.json new file mode 100644 index 000000000..a12691211 --- /dev/null +++ b/tests/udt/test_snapshots/test_with_wasm/test_add.1.json @@ -0,0 +1,120 @@ +{ + "generators": { + "address": 1, + "nonce": 0, + "mux_id": 0 + }, + "auth": [ + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + { + "function": { + "create_contract_v2_host_fn": { + "contract_id_preimage": { + "address": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "salt": "0000000000000000000000000000000000000000000000000000000000000000" + } + }, + "executable": { + "wasm": "0ee9dab6c9f5369bae3f1dbc15dd28bd6726291f3659172c44f5227c9b9fd72a" + }, + "constructor_args": [] + } + }, + "sub_invocations": [] + } + ] + ], + [], + [] + ], + "ledger": { + "protocol_version": 26, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + { + "entry": { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "ledger_key_nonce": { + "nonce": "801925984706572462" + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + "live_until": 6311999 + }, + { + "entry": { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CBKMUZNFQIAL775XBB2W2GP5CNHBM5YGH6C3XB7AY6SUVO2IBU3VYK2V", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "0ee9dab6c9f5369bae3f1dbc15dd28bd6726291f3659172c44f5227c9b9fd72a" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + "live_until": 4095 + }, + { + "entry": { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": { + "v1": { + "ext": "v0", + "cost_inputs": { + "ext": "v0", + "n_instructions": 1524, + "n_functions": 17, + "n_globals": 4, + "n_table_entries": 0, + "n_types": 13, + "n_data_segments": 1, + "n_elem_segments": 0, + "n_imports": 13, + "n_exports": 7, + "n_data_segment_bytes": 132 + } + } + }, + "hash": "0ee9dab6c9f5369bae3f1dbc15dd28bd6726291f3659172c44f5227c9b9fd72a", + "code": "0061736d01000000014e0d60017e017e60037e7e7e017e60027e7e017e60047e7e7e7e017e60027f7e0060027f7f0060037e7f7f017e60027f7f017f60057e7f7f7f7f0060000060017f017e60037f7f7f0060027f7f017e024f0d017601330000017601680001016901320000017601310002016901310000017601380000016d01340002016d013100020176016700020162016a0002016d01390001016d016100030162016d00010312110405060708040404050209000a020b0c0905030100110621047f01418080c0000b7f00418481c0000b7f00418481c0000b7f00419081c0000b074c07066d656d6f727902000361646400160972656375727369766500180e7265637572736976655f656e756d001a015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030aaa1a11b60604017f017e027f017e23808080800041c0006b220224808080800002400240200142ff018342cb00510d00200041043a00000c010b200110808080800021032002410036021020022001370308200220034220883e0214200241186a200241086a108e808080000240024002400240200229031822014202510d002001a74101710d00024020022903202201a741ff0171220441ca00460d002004410e470d010b02400240024002402001419080c080004104108f80808000422088a70e0400010203050b200228021020022802141090808080000d04410021050c050b2002280210200228021410908080800041014b0d03200241186a200241086a108e80808000200229031822014202510d032001a74101710d0320022903202101410021040240034020044118460d01200241186a20046a4202370300200441086a21040c000b0b200142ff018342cc00520d03200141b480c080004103200241186a4103109180808000200241306a200229031810928080800020022802300d0320022903382103200241306a200229032010928080800020022802300d032002290328220642ff018342cb00520d0320022903382101410121050c040b2002280210200228021410908080800041014b0d02200241186a200241086a108e80808000200229031822014202510d022001a74101710d022002290320220142ff01834204520d02410a410f41092001422088a72204410f461b2004410a461b22044109460d02410221050c040b2002280210200228021410908080800041014b0d01200241186a200241086a108e80808000200229031822014202510d012001a74101710d012002290320220142ff018342cb00520d01410021040240034020044110460d01200241306a20046a4202370300200441086a21040c000b0b2001200241306aad4220864204844284808080201081808080001a200241186a200229033010928080800020022802184101460d012002290338220142ff018342cb00520d0120022903202103410321050c020b200041043a00000c030b200041043a00000c020b0b200020063703182000200137031020002003370308200020043a0001200020053a00000b200241c0006a2480808080000b4a02017e017f42022102024020012802082203200128020c4f0d00200020012903002003ad4220864204841083808080003703082001200341016a360208420021020b200020023703000b1c0020002001ad4220864204842002ad422086420484108c808080000b1900024020012000490d00200120006b0f0b109780808000000b3100024020022004460d00000b20002001ad4220864204842003ad4220864204842002ad422086420484108b808080001a0b5d02017f017e024002402001a741ff0171220241c100460d00024020024107460d00420121034283908080800121010c020b20014208872101420021030c010b42002103200110828080800021010b20002003370300200020013703080bb50102027f027e23808080800041106b2202248080808000410021030240034020034110460d01200220036a4202370300200341086a21030c000b0b420121040240200142ff018342cc00520d00200141cc80c08000410220024102109180808000024020022903002201a741ff0171220341ca00460d002003410e470d010b2002290308220542ff018342cb00520d002000200537031020002001370308420021040b20002004370300200241106a2480808080000bb50102027f027e23808080800041106b2202248080808000410021030240034020034110460d01200220036a4202370300200341086a21030c000b0b420121040240200142ff018342cc00520d00200141cc80c08000410220024102109180808000024020022903002201a741ff0171220341ca00460d002003410e470d010b2002290308220542ff018342cc00520d002000200537031020002001370308420021040b20002004370300200241106a2480808080000b7803017f017e017f23808080800041106b220224808080800042022103024020012802082204200128020c4f0d00200220012903002004ad42208642048410838080800010928080800020022903002103200020022903083703082001200441016a3602080b20002003370300200241106a2480808080000bb70404027f027e017f057e23808080800041306b220224808080800020022000108d8080800002400240024020022d000022034104460d0020022903102100200229030821042002310001210520022001108d8080800020022d000022064104460d002002290310210720022903082108200231000121094200210a4200210b024002400240024020030e0405020100050b200010808080800021012002410036022820022000370320200220014220883e022c4200210003402002200241206a109580808000200229030022014202510d032001a74101710d0620022903082201420053200020017c2201200053470d06200121000c000b0b2005210b0c030b2000420053200420007c220b20045373450d020c030b2000420053200420007c220b20045373450d010c020b000b0240024002400240024020060e0404020100040b200710808080800021002002410036022820022007370320200220004220883e022c4200210003402002200241206a109580808000200229030022014202510d032001a74101710d0520022903082201420053200020017c2201200053470d05200121000c000b0b2009210a0c020b2007420053200820077c220a200853730d020c010b2000420053200820007c220a200853730d010b200a420053200b200a7c2200200b53730d000240024020004280808080808080c0007c42ffffffffffffffff00560d00200042088642078421000c010b200010848080800021000b200241306a24808080800020000f0b109780808000000b0900109d80808000000b9f0102017f017e23808080800041206b2201248080808000200141086a2000109380808000024020012802084101460d0042022100024020012903182202108080808000428080808010540d00200141086a200210858080800010938080800020012802084101460d01200129031021002001200129031837031020012000370308200141086a10998080800021000b200141206a24808080800020000f0b000b240041cc80c08000ad4220864204842000ad422086420484428480808020108a808080000bf60503017f017e017f23808080800041c0006b22022480808080000240200042ff018342cb00520d00200010808080800021032002410036021020022000370308200220034220883e0214200241186a200241086a108e80808000200229031822004202510d002000a74101710d00024020022903202200a741ff0171220441ca00460d002004410e470d010b024002400240024002400240200041f480c080004102108f80808000422088a70e020100060b2002280210200228021410908080800041014b0d05200241306a200241086a108e80808000200229033022004202510d052000a74101710d05200241186a200229033810948080800020022802184101460d05200142ff01834204520d052002290328220020014284808080708322011086808080004201520d0120002001108780808000220042ff018342cb00520d05200010808080800021012002410036021020022000370308200220014220883e0214200241186a200241086a108e80808000200229031822004202510d052000a74101710d05024020022903202200a741ff0171220441ca00460d002004410e470d060b200041f480c080004102108f80808000422088a70e020302050b200228021020022802141090808080000d04200142ff01834204520d040b420221000c020b2002280210200228021410908080800041014b0d02200241306a200241086a108e80808000200229033022004202510d022000a74101710d02200241186a200229033810948080800020022802184101460d022002290328210020022903202101200241186a41e880c080004109109b8080800020022802180d022002290320210320022000370320200220013703182002200241186a10998080800037032020022003370318200241186a4102109c8080800021000c010b200228021020022802141090808080000d01200241186a41dc80c08000410c109b8080800020022802180d0120022002290320370318200241186a4101109c8080800021000b200241c0006a24808080800020000f0b000bd60102017e037f02400240200241094b0d0042002103410021040340024020044109470d002003420886420e8421030c030b410121050240200120046a2d0000220641df00460d0002400240200641506a41ff0171410a490d00200641bf7f6a41ff0171411a490d012006419f7f6a41ff0171411a4f0d04200641456a21050c020b200641526a21050c010b2006414b6a21050b20034206862005ad42ff0183842103200441016a21040c000b0b2001ad4220864204842002ad42208642048410898080800021030b20004200370300200020033703080b1a002000ad4220864204842001ad4220864204841088808080000b0300000b0b8e010100418080c0000b8401556474415564744255647443556474440000100004000000040010000400000008001000040000000c0010000400000061626300300010000100000031001000010000003200100001000000300010000100000031001000010000004e6f745265637572736976655265637572736976650000005c0010000c000000680010000900000000db1c0e636f6e74726163747370656376300000000000000000000000036164640000000002000000000000000161000000000007d000000007556474456e756d00000000000000000162000000000007d000000007556474456e756d00000000010000000700000002000000000000000000000007556474456e756d0000000004000000000000000000000004556474410000000100000000000000045564744200000001000007d0000000095564745374727563740000000000000100000000000000045564744300000001000007d000000008556474456e756d320000000100000000000000045564744400000001000007d0000000085564745475706c6500000003000000000000000000000008556474456e756d32000000020000000000000001410000000000000a0000000000000001420000000000000f000000010000000000000000000000085564745475706c650000000200000000000000013000000000000007000000000000000131000000000003ea0000000700000001000000000000000000000009556474537472756374000000000000030000000000000001610000000000000700000000000000016200000000000007000000000000000163000000000003ea0000000700000000000000000000000972656375727369766500000000000001000000000000000161000000000007d00000000c55647452656375727369766500000001000003e8000007d00000000c5564745265637572736976650000000100000000000000000000000c5564745265637572736976650000000200000000000000016100000000000011000000000000000162000000000003ea000007d00000000c5564745265637572736976650000000200000000000000000000000d526563757273697665456e756d0000000000000200000000000000000000000c4e6f7452656375727369766500000001000000000000000952656375727369766500000000000001000007d00000000f526563757273697665546f456e756d000000000100000000000000000000000f526563757273697665546f456e756d000000000200000000000000016100000000000011000000000000000162000000000003ec00000004000007d00000000d526563757273697665456e756d00000000000000000000000000000e7265637572736976655f656e756d000000000002000000000000000161000000000007d00000000d526563757273697665456e756d00000000000000000000036b6579000000000400000001000003e9000003e8000007d00000000d526563757273697665456e756d0000000000000300000002000000e3436f6e74657874206f6620612073696e676c6520617574686f72697a65642063616c6c20706572666f726d656420627920616e20616464726573732e0a0a437573746f6d206163636f756e7420636f6e747261637473207468617420696d706c656d656e7420605f5f636865636b5f6175746860207370656369616c2066756e6374696f6e0a726563656976652061206c697374206f662060436f6e74657874602076616c75657320636f72726573706f6e64696e6720746f20616c6c207468652063616c6c7320746861740a6e65656420746f20626520617574686f72697a65642e000000000000000007436f6e7465787400000000030000000100000014436f6e747261637420696e766f636174696f6e2e00000008436f6e747261637400000001000007d00000000f436f6e7472616374436f6e7465787400000000010000003d436f6e7472616374207468617420686173206120636f6e7374727563746f722077697468206e6f20617267756d656e747320697320637265617465642e00000000000014437265617465436f6e7472616374486f7374466e00000001000007d00000001b437265617465436f6e7472616374486f7374466e436f6e74657874000000000100000044436f6e7472616374207468617420686173206120636f6e7374727563746f7220776974682031206f72206d6f726520617267756d656e747320697320637265617465642e0000001c437265617465436f6e74726163745769746843746f72486f7374466e00000001000007d00000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e74657874000000000001000000bd417574686f72697a6174696f6e20636f6e74657874206f6620612073696e676c6520636f6e74726163742063616c6c2e0a0a546869732073747275637420636f72726573706f6e647320746f20612060726571756972655f617574685f666f725f61726773602063616c6c20666f7220616e20616464726573730a66726f6d2060636f6e7472616374602066756e6374696f6e20776974682060666e5f6e616d6560206e616d6520616e642060617267736020617267756d656e74732e000000000000000000000f436f6e7472616374436f6e746578740000000003000000000000000461726773000003ea000000000000000000000008636f6e7472616374000000130000000000000007666e5f6e616d650000000011000000020000005f436f6e74726163742065786563757461626c65207573656420666f72206372656174696e672061206e657720636f6e747261637420616e64207573656420696e0a60437265617465436f6e7472616374486f7374466e436f6e74657874602e000000000000000012436f6e747261637445786563757461626c650000000000010000000100000000000000045761736d00000001000003ee00000020000000010000003856616c7565206f6620636f6e7472616374206e6f646520696e20496e766f6b6572436f6e747261637441757468456e74727920747265652e0000000000000015537562436f6e7472616374496e766f636174696f6e000000000000020000000000000007636f6e7465787400000007d00000000f436f6e7472616374436f6e7465787400000000000000000f7375625f696e766f636174696f6e7300000003ea000007d000000018496e766f6b6572436f6e747261637441757468456e747279000000020000012f41206e6f646520696e207468652074726565206f6620617574686f72697a6174696f6e7320706572666f726d6564206f6e20626568616c66206f66207468652063757272656e740a636f6e747261637420617320696e766f6b6572206f662074686520636f6e7472616374732064656570657220696e207468652063616c6c20737461636b2e0a0a54686973206973207573656420617320616e20617267756d656e74206f662060617574686f72697a655f61735f63757272656e745f636f6e74726163746020686f73742066756e6374696f6e2e0a0a54686973207472656520636f72726573706f6e64732060726571756972655f617574685b5f666f725f617267735d602063616c6c73206f6e20626568616c66206f66207468650a63757272656e7420636f6e74726163742e000000000000000018496e766f6b6572436f6e747261637441757468456e747279000000030000000100000012496e766f6b65206120636f6e74726163742e000000000008436f6e747261637400000001000007d000000015537562436f6e7472616374496e766f636174696f6e0000000000000100000035437265617465206120636f6e74726163742070617373696e67203020617267756d656e747320746f20636f6e7374727563746f722e00000000000014437265617465436f6e7472616374486f7374466e00000001000007d00000001b437265617465436f6e7472616374486f7374466e436f6e7465787400000000010000003d437265617465206120636f6e74726163742070617373696e672030206f72206d6f726520617267756d656e747320746f20636f6e7374727563746f722e0000000000001c437265617465436f6e74726163745769746843746f72486f7374466e00000001000007d00000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e7465787400000000000100000076417574686f72697a6174696f6e20636f6e7465787420666f7220606372656174655f636f6e74726163746020686f73742066756e6374696f6e2074686174206372656174657320610a6e657720636f6e7472616374206f6e20626568616c66206f6620617574686f72697a657220616464726573732e0000000000000000001b437265617465436f6e7472616374486f7374466e436f6e746578740000000002000000000000000a65786563757461626c650000000007d000000012436f6e747261637445786563757461626c650000000000000000000473616c74000003ee0000002000000001000000d6417574686f72697a6174696f6e20636f6e7465787420666f7220606372656174655f636f6e74726163746020686f73742066756e6374696f6e2074686174206372656174657320610a6e657720636f6e7472616374206f6e20626568616c66206f6620617574686f72697a657220616464726573732e0a54686973206973207468652073616d652061732060437265617465436f6e7472616374486f7374466e436f6e74657874602c2062757420616c736f206861730a636f6e747261637420636f6e7374727563746f7220617267756d656e74732e0000000000000000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e746578740000000000030000000000000010636f6e7374727563746f725f61726773000003ea00000000000000000000000a65786563757461626c650000000007d000000012436f6e747261637445786563757461626c650000000000000000000473616c74000003ee000000200000000200000000000000000000000a45786563757461626c650000000000030000000100000000000000045761736d00000001000003ee0000002000000000000000000000000c5374656c6c617241737365740000000000000000000000074163636f756e740000d10b1c636f6e74726163747370656376302e727373646b2e677261706876305370477256010002f3b0ab40690d48b4819c947c3f41efcff32551d58b90b24218fb8c3eaa8c5e32000316276438ffc9b1f81c66b084b1b8fa798460e4dd703bc52a0eba483a94bbb287aff793ba9e4dde9a3f27a8b9cb949f88f64cc0b918d1c91a35f899a539c2cf9eeb9f12269a76282a7f31372e3391cc63fcecee330f96f2501b39e8c68ff0e0eb5370477256010002aff793ba9e4dde9a3f27a8b9cb949f88f64cc0b918d1c91a35f899a539c2cf9e00005370477256010002eb9f12269a76282a7f31372e3391cc63fcecee330f96f2501b39e8c68ff0e0eb0000537047725601000216276438ffc9b1f81c66b084b1b8fa798460e4dd703bc52a0eba483a94bbb28700005370477256010000ebb96de3341d5b5be44be7e3f42e999bf21ae135a1442ba81b1c560aedc1a4890002f3b0ab40690d48b4819c947c3f41efcff32551d58b90b24218fb8c3eaa8c5e32f3b0ab40690d48b4819c947c3f41efcff32551d58b90b24218fb8c3eaa8c5e325370477256010002c81291fed713f59ce4c703dc402324460d04e26a5fb0ac43fd0bc04a7e3cfc050001c81291fed713f59ce4c703dc402324460d04e26a5fb0ac43fd0bc04a7e3cfc055370477256010002ff7b5620ab0ddc64e77e19833cc23774c69d3d9f8f120e183e2508892e26004d0001e16f55dbd43798147ab22bbbdfdb6e142492bbf14df21026500cd1134a9743695370477256010002e16f55dbd43798147ab22bbbdfdb6e142492bbf14df21026500cd1134a9743690001ff7b5620ab0ddc64e77e19833cc23774c69d3d9f8f120e183e2508892e26004d53704772560100002860835a3b9730d8da5a70cf9ebf82867c30b690104d6613cfd7360c446edbb20002c81291fed713f59ce4c703dc402324460d04e26a5fb0ac43fd0bc04a7e3cfc05c81291fed713f59ce4c703dc402324460d04e26a5fb0ac43fd0bc04a7e3cfc0553704772560100008448210efcdb4d3602aa4ee4ee994a089408a9c044884369c9077eb9a6c5ecaa0002ff7b5620ab0ddc64e77e19833cc23774c69d3d9f8f120e183e2508892e26004dff7b5620ab0ddc64e77e19833cc23774c69d3d9f8f120e183e2508892e26004d5370477256010002a34acff744930b425d95ebfe03798365355c16eb944e65e658771f26f7c070540003f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec15e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e73940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af5370477256010002f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec00005370477256010002b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc000053704772560100029e29488ef0017b7bce9f644f0e44c02c0fe8ee278435729feb60d012481796670002f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec554c7144d3fa3a1f0ca5b704e5488b914a9e0f657f9f5bdb4723c76fb0f4cfe65370477256010002554c7144d3fa3a1f0ca5b704e5488b914a9e0f657f9f5bdb4723c76fb0f4cfe600039e29488ef0017b7bce9f644f0e44c02c0fe8ee278435729feb60d0124817966715e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e73940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af537047725601000215e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e0001b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc537047725601000273940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af0001b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc53704772560100024c7c7b0df4f21aa8f69831e24bcb82344ee697eddfc21c636bd6ce579c78101e0000001e11636f6e7472616374656e766d6574617630000000000000001a00000000004f0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e39312e3000000000000000000012727373646b5f737065635f7368616b696e6700000000000132000000" + } + }, + "ext": "v0" + }, + "live_until": 4095 + } + ] + }, + "events": [] +} \ No newline at end of file diff --git a/tests/udt/test_snapshots/test_with_wasm/test_recursive.1.json b/tests/udt/test_snapshots/test_with_wasm/test_recursive.1.json new file mode 100644 index 000000000..0f7ac35bc --- /dev/null +++ b/tests/udt/test_snapshots/test_with_wasm/test_recursive.1.json @@ -0,0 +1,121 @@ +{ + "generators": { + "address": 1, + "nonce": 0, + "mux_id": 0 + }, + "auth": [ + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + { + "function": { + "create_contract_v2_host_fn": { + "contract_id_preimage": { + "address": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "salt": "0000000000000000000000000000000000000000000000000000000000000000" + } + }, + "executable": { + "wasm": "0ee9dab6c9f5369bae3f1dbc15dd28bd6726291f3659172c44f5227c9b9fd72a" + }, + "constructor_args": [] + } + }, + "sub_invocations": [] + } + ] + ], + [], + [], + [] + ], + "ledger": { + "protocol_version": 26, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + { + "entry": { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "ledger_key_nonce": { + "nonce": "801925984706572462" + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + "live_until": 6311999 + }, + { + "entry": { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CBKMUZNFQIAL775XBB2W2GP5CNHBM5YGH6C3XB7AY6SUVO2IBU3VYK2V", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "0ee9dab6c9f5369bae3f1dbc15dd28bd6726291f3659172c44f5227c9b9fd72a" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + "live_until": 4095 + }, + { + "entry": { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": { + "v1": { + "ext": "v0", + "cost_inputs": { + "ext": "v0", + "n_instructions": 1524, + "n_functions": 17, + "n_globals": 4, + "n_table_entries": 0, + "n_types": 13, + "n_data_segments": 1, + "n_elem_segments": 0, + "n_imports": 13, + "n_exports": 7, + "n_data_segment_bytes": 132 + } + } + }, + "hash": "0ee9dab6c9f5369bae3f1dbc15dd28bd6726291f3659172c44f5227c9b9fd72a", + "code": "0061736d01000000014e0d60017e017e60037e7e7e017e60027e7e017e60047e7e7e7e017e60027f7e0060027f7f0060037e7f7f017e60027f7f017f60057e7f7f7f7f0060000060017f017e60037f7f7f0060027f7f017e024f0d017601330000017601680001016901320000017601310002016901310000017601380000016d01340002016d013100020176016700020162016a0002016d01390001016d016100030162016d00010312110405060708040404050209000a020b0c0905030100110621047f01418080c0000b7f00418481c0000b7f00418481c0000b7f00419081c0000b074c07066d656d6f727902000361646400160972656375727369766500180e7265637572736976655f656e756d001a015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030aaa1a11b60604017f017e027f017e23808080800041c0006b220224808080800002400240200142ff018342cb00510d00200041043a00000c010b200110808080800021032002410036021020022001370308200220034220883e0214200241186a200241086a108e808080000240024002400240200229031822014202510d002001a74101710d00024020022903202201a741ff0171220441ca00460d002004410e470d010b02400240024002402001419080c080004104108f80808000422088a70e0400010203050b200228021020022802141090808080000d04410021050c050b2002280210200228021410908080800041014b0d03200241186a200241086a108e80808000200229031822014202510d032001a74101710d0320022903202101410021040240034020044118460d01200241186a20046a4202370300200441086a21040c000b0b200142ff018342cc00520d03200141b480c080004103200241186a4103109180808000200241306a200229031810928080800020022802300d0320022903382103200241306a200229032010928080800020022802300d032002290328220642ff018342cb00520d0320022903382101410121050c040b2002280210200228021410908080800041014b0d02200241186a200241086a108e80808000200229031822014202510d022001a74101710d022002290320220142ff01834204520d02410a410f41092001422088a72204410f461b2004410a461b22044109460d02410221050c040b2002280210200228021410908080800041014b0d01200241186a200241086a108e80808000200229031822014202510d012001a74101710d012002290320220142ff018342cb00520d01410021040240034020044110460d01200241306a20046a4202370300200441086a21040c000b0b2001200241306aad4220864204844284808080201081808080001a200241186a200229033010928080800020022802184101460d012002290338220142ff018342cb00520d0120022903202103410321050c020b200041043a00000c030b200041043a00000c020b0b200020063703182000200137031020002003370308200020043a0001200020053a00000b200241c0006a2480808080000b4a02017e017f42022102024020012802082203200128020c4f0d00200020012903002003ad4220864204841083808080003703082001200341016a360208420021020b200020023703000b1c0020002001ad4220864204842002ad422086420484108c808080000b1900024020012000490d00200120006b0f0b109780808000000b3100024020022004460d00000b20002001ad4220864204842003ad4220864204842002ad422086420484108b808080001a0b5d02017f017e024002402001a741ff0171220241c100460d00024020024107460d00420121034283908080800121010c020b20014208872101420021030c010b42002103200110828080800021010b20002003370300200020013703080bb50102027f027e23808080800041106b2202248080808000410021030240034020034110460d01200220036a4202370300200341086a21030c000b0b420121040240200142ff018342cc00520d00200141cc80c08000410220024102109180808000024020022903002201a741ff0171220341ca00460d002003410e470d010b2002290308220542ff018342cb00520d002000200537031020002001370308420021040b20002004370300200241106a2480808080000bb50102027f027e23808080800041106b2202248080808000410021030240034020034110460d01200220036a4202370300200341086a21030c000b0b420121040240200142ff018342cc00520d00200141cc80c08000410220024102109180808000024020022903002201a741ff0171220341ca00460d002003410e470d010b2002290308220542ff018342cc00520d002000200537031020002001370308420021040b20002004370300200241106a2480808080000b7803017f017e017f23808080800041106b220224808080800042022103024020012802082204200128020c4f0d00200220012903002004ad42208642048410838080800010928080800020022903002103200020022903083703082001200441016a3602080b20002003370300200241106a2480808080000bb70404027f027e017f057e23808080800041306b220224808080800020022000108d8080800002400240024020022d000022034104460d0020022903102100200229030821042002310001210520022001108d8080800020022d000022064104460d002002290310210720022903082108200231000121094200210a4200210b024002400240024020030e0405020100050b200010808080800021012002410036022820022000370320200220014220883e022c4200210003402002200241206a109580808000200229030022014202510d032001a74101710d0620022903082201420053200020017c2201200053470d06200121000c000b0b2005210b0c030b2000420053200420007c220b20045373450d020c030b2000420053200420007c220b20045373450d010c020b000b0240024002400240024020060e0404020100040b200710808080800021002002410036022820022007370320200220004220883e022c4200210003402002200241206a109580808000200229030022014202510d032001a74101710d0520022903082201420053200020017c2201200053470d05200121000c000b0b2009210a0c020b2007420053200820077c220a200853730d020c010b2000420053200820007c220a200853730d010b200a420053200b200a7c2200200b53730d000240024020004280808080808080c0007c42ffffffffffffffff00560d00200042088642078421000c010b200010848080800021000b200241306a24808080800020000f0b109780808000000b0900109d80808000000b9f0102017f017e23808080800041206b2201248080808000200141086a2000109380808000024020012802084101460d0042022100024020012903182202108080808000428080808010540d00200141086a200210858080800010938080800020012802084101460d01200129031021002001200129031837031020012000370308200141086a10998080800021000b200141206a24808080800020000f0b000b240041cc80c08000ad4220864204842000ad422086420484428480808020108a808080000bf60503017f017e017f23808080800041c0006b22022480808080000240200042ff018342cb00520d00200010808080800021032002410036021020022000370308200220034220883e0214200241186a200241086a108e80808000200229031822004202510d002000a74101710d00024020022903202200a741ff0171220441ca00460d002004410e470d010b024002400240024002400240200041f480c080004102108f80808000422088a70e020100060b2002280210200228021410908080800041014b0d05200241306a200241086a108e80808000200229033022004202510d052000a74101710d05200241186a200229033810948080800020022802184101460d05200142ff01834204520d052002290328220020014284808080708322011086808080004201520d0120002001108780808000220042ff018342cb00520d05200010808080800021012002410036021020022000370308200220014220883e0214200241186a200241086a108e80808000200229031822004202510d052000a74101710d05024020022903202200a741ff0171220441ca00460d002004410e470d060b200041f480c080004102108f80808000422088a70e020302050b200228021020022802141090808080000d04200142ff01834204520d040b420221000c020b2002280210200228021410908080800041014b0d02200241306a200241086a108e80808000200229033022004202510d022000a74101710d02200241186a200229033810948080800020022802184101460d022002290328210020022903202101200241186a41e880c080004109109b8080800020022802180d022002290320210320022000370320200220013703182002200241186a10998080800037032020022003370318200241186a4102109c8080800021000c010b200228021020022802141090808080000d01200241186a41dc80c08000410c109b8080800020022802180d0120022002290320370318200241186a4101109c8080800021000b200241c0006a24808080800020000f0b000bd60102017e037f02400240200241094b0d0042002103410021040340024020044109470d002003420886420e8421030c030b410121050240200120046a2d0000220641df00460d0002400240200641506a41ff0171410a490d00200641bf7f6a41ff0171411a490d012006419f7f6a41ff0171411a4f0d04200641456a21050c020b200641526a21050c010b2006414b6a21050b20034206862005ad42ff0183842103200441016a21040c000b0b2001ad4220864204842002ad42208642048410898080800021030b20004200370300200020033703080b1a002000ad4220864204842001ad4220864204841088808080000b0300000b0b8e010100418080c0000b8401556474415564744255647443556474440000100004000000040010000400000008001000040000000c0010000400000061626300300010000100000031001000010000003200100001000000300010000100000031001000010000004e6f745265637572736976655265637572736976650000005c0010000c000000680010000900000000db1c0e636f6e74726163747370656376300000000000000000000000036164640000000002000000000000000161000000000007d000000007556474456e756d00000000000000000162000000000007d000000007556474456e756d00000000010000000700000002000000000000000000000007556474456e756d0000000004000000000000000000000004556474410000000100000000000000045564744200000001000007d0000000095564745374727563740000000000000100000000000000045564744300000001000007d000000008556474456e756d320000000100000000000000045564744400000001000007d0000000085564745475706c6500000003000000000000000000000008556474456e756d32000000020000000000000001410000000000000a0000000000000001420000000000000f000000010000000000000000000000085564745475706c650000000200000000000000013000000000000007000000000000000131000000000003ea0000000700000001000000000000000000000009556474537472756374000000000000030000000000000001610000000000000700000000000000016200000000000007000000000000000163000000000003ea0000000700000000000000000000000972656375727369766500000000000001000000000000000161000000000007d00000000c55647452656375727369766500000001000003e8000007d00000000c5564745265637572736976650000000100000000000000000000000c5564745265637572736976650000000200000000000000016100000000000011000000000000000162000000000003ea000007d00000000c5564745265637572736976650000000200000000000000000000000d526563757273697665456e756d0000000000000200000000000000000000000c4e6f7452656375727369766500000001000000000000000952656375727369766500000000000001000007d00000000f526563757273697665546f456e756d000000000100000000000000000000000f526563757273697665546f456e756d000000000200000000000000016100000000000011000000000000000162000000000003ec00000004000007d00000000d526563757273697665456e756d00000000000000000000000000000e7265637572736976655f656e756d000000000002000000000000000161000000000007d00000000d526563757273697665456e756d00000000000000000000036b6579000000000400000001000003e9000003e8000007d00000000d526563757273697665456e756d0000000000000300000002000000e3436f6e74657874206f6620612073696e676c6520617574686f72697a65642063616c6c20706572666f726d656420627920616e20616464726573732e0a0a437573746f6d206163636f756e7420636f6e747261637473207468617420696d706c656d656e7420605f5f636865636b5f6175746860207370656369616c2066756e6374696f6e0a726563656976652061206c697374206f662060436f6e74657874602076616c75657320636f72726573706f6e64696e6720746f20616c6c207468652063616c6c7320746861740a6e65656420746f20626520617574686f72697a65642e000000000000000007436f6e7465787400000000030000000100000014436f6e747261637420696e766f636174696f6e2e00000008436f6e747261637400000001000007d00000000f436f6e7472616374436f6e7465787400000000010000003d436f6e7472616374207468617420686173206120636f6e7374727563746f722077697468206e6f20617267756d656e747320697320637265617465642e00000000000014437265617465436f6e7472616374486f7374466e00000001000007d00000001b437265617465436f6e7472616374486f7374466e436f6e74657874000000000100000044436f6e7472616374207468617420686173206120636f6e7374727563746f7220776974682031206f72206d6f726520617267756d656e747320697320637265617465642e0000001c437265617465436f6e74726163745769746843746f72486f7374466e00000001000007d00000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e74657874000000000001000000bd417574686f72697a6174696f6e20636f6e74657874206f6620612073696e676c6520636f6e74726163742063616c6c2e0a0a546869732073747275637420636f72726573706f6e647320746f20612060726571756972655f617574685f666f725f61726773602063616c6c20666f7220616e20616464726573730a66726f6d2060636f6e7472616374602066756e6374696f6e20776974682060666e5f6e616d6560206e616d6520616e642060617267736020617267756d656e74732e000000000000000000000f436f6e7472616374436f6e746578740000000003000000000000000461726773000003ea000000000000000000000008636f6e7472616374000000130000000000000007666e5f6e616d650000000011000000020000005f436f6e74726163742065786563757461626c65207573656420666f72206372656174696e672061206e657720636f6e747261637420616e64207573656420696e0a60437265617465436f6e7472616374486f7374466e436f6e74657874602e000000000000000012436f6e747261637445786563757461626c650000000000010000000100000000000000045761736d00000001000003ee00000020000000010000003856616c7565206f6620636f6e7472616374206e6f646520696e20496e766f6b6572436f6e747261637441757468456e74727920747265652e0000000000000015537562436f6e7472616374496e766f636174696f6e000000000000020000000000000007636f6e7465787400000007d00000000f436f6e7472616374436f6e7465787400000000000000000f7375625f696e766f636174696f6e7300000003ea000007d000000018496e766f6b6572436f6e747261637441757468456e747279000000020000012f41206e6f646520696e207468652074726565206f6620617574686f72697a6174696f6e7320706572666f726d6564206f6e20626568616c66206f66207468652063757272656e740a636f6e747261637420617320696e766f6b6572206f662074686520636f6e7472616374732064656570657220696e207468652063616c6c20737461636b2e0a0a54686973206973207573656420617320616e20617267756d656e74206f662060617574686f72697a655f61735f63757272656e745f636f6e74726163746020686f73742066756e6374696f6e2e0a0a54686973207472656520636f72726573706f6e64732060726571756972655f617574685b5f666f725f617267735d602063616c6c73206f6e20626568616c66206f66207468650a63757272656e7420636f6e74726163742e000000000000000018496e766f6b6572436f6e747261637441757468456e747279000000030000000100000012496e766f6b65206120636f6e74726163742e000000000008436f6e747261637400000001000007d000000015537562436f6e7472616374496e766f636174696f6e0000000000000100000035437265617465206120636f6e74726163742070617373696e67203020617267756d656e747320746f20636f6e7374727563746f722e00000000000014437265617465436f6e7472616374486f7374466e00000001000007d00000001b437265617465436f6e7472616374486f7374466e436f6e7465787400000000010000003d437265617465206120636f6e74726163742070617373696e672030206f72206d6f726520617267756d656e747320746f20636f6e7374727563746f722e0000000000001c437265617465436f6e74726163745769746843746f72486f7374466e00000001000007d00000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e7465787400000000000100000076417574686f72697a6174696f6e20636f6e7465787420666f7220606372656174655f636f6e74726163746020686f73742066756e6374696f6e2074686174206372656174657320610a6e657720636f6e7472616374206f6e20626568616c66206f6620617574686f72697a657220616464726573732e0000000000000000001b437265617465436f6e7472616374486f7374466e436f6e746578740000000002000000000000000a65786563757461626c650000000007d000000012436f6e747261637445786563757461626c650000000000000000000473616c74000003ee0000002000000001000000d6417574686f72697a6174696f6e20636f6e7465787420666f7220606372656174655f636f6e74726163746020686f73742066756e6374696f6e2074686174206372656174657320610a6e657720636f6e7472616374206f6e20626568616c66206f6620617574686f72697a657220616464726573732e0a54686973206973207468652073616d652061732060437265617465436f6e7472616374486f7374466e436f6e74657874602c2062757420616c736f206861730a636f6e747261637420636f6e7374727563746f7220617267756d656e74732e0000000000000000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e746578740000000000030000000000000010636f6e7374727563746f725f61726773000003ea00000000000000000000000a65786563757461626c650000000007d000000012436f6e747261637445786563757461626c650000000000000000000473616c74000003ee000000200000000200000000000000000000000a45786563757461626c650000000000030000000100000000000000045761736d00000001000003ee0000002000000000000000000000000c5374656c6c617241737365740000000000000000000000074163636f756e740000d10b1c636f6e74726163747370656376302e727373646b2e677261706876305370477256010002f3b0ab40690d48b4819c947c3f41efcff32551d58b90b24218fb8c3eaa8c5e32000316276438ffc9b1f81c66b084b1b8fa798460e4dd703bc52a0eba483a94bbb287aff793ba9e4dde9a3f27a8b9cb949f88f64cc0b918d1c91a35f899a539c2cf9eeb9f12269a76282a7f31372e3391cc63fcecee330f96f2501b39e8c68ff0e0eb5370477256010002aff793ba9e4dde9a3f27a8b9cb949f88f64cc0b918d1c91a35f899a539c2cf9e00005370477256010002eb9f12269a76282a7f31372e3391cc63fcecee330f96f2501b39e8c68ff0e0eb0000537047725601000216276438ffc9b1f81c66b084b1b8fa798460e4dd703bc52a0eba483a94bbb28700005370477256010000ebb96de3341d5b5be44be7e3f42e999bf21ae135a1442ba81b1c560aedc1a4890002f3b0ab40690d48b4819c947c3f41efcff32551d58b90b24218fb8c3eaa8c5e32f3b0ab40690d48b4819c947c3f41efcff32551d58b90b24218fb8c3eaa8c5e325370477256010002c81291fed713f59ce4c703dc402324460d04e26a5fb0ac43fd0bc04a7e3cfc050001c81291fed713f59ce4c703dc402324460d04e26a5fb0ac43fd0bc04a7e3cfc055370477256010002ff7b5620ab0ddc64e77e19833cc23774c69d3d9f8f120e183e2508892e26004d0001e16f55dbd43798147ab22bbbdfdb6e142492bbf14df21026500cd1134a9743695370477256010002e16f55dbd43798147ab22bbbdfdb6e142492bbf14df21026500cd1134a9743690001ff7b5620ab0ddc64e77e19833cc23774c69d3d9f8f120e183e2508892e26004d53704772560100002860835a3b9730d8da5a70cf9ebf82867c30b690104d6613cfd7360c446edbb20002c81291fed713f59ce4c703dc402324460d04e26a5fb0ac43fd0bc04a7e3cfc05c81291fed713f59ce4c703dc402324460d04e26a5fb0ac43fd0bc04a7e3cfc0553704772560100008448210efcdb4d3602aa4ee4ee994a089408a9c044884369c9077eb9a6c5ecaa0002ff7b5620ab0ddc64e77e19833cc23774c69d3d9f8f120e183e2508892e26004dff7b5620ab0ddc64e77e19833cc23774c69d3d9f8f120e183e2508892e26004d5370477256010002a34acff744930b425d95ebfe03798365355c16eb944e65e658771f26f7c070540003f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec15e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e73940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af5370477256010002f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec00005370477256010002b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc000053704772560100029e29488ef0017b7bce9f644f0e44c02c0fe8ee278435729feb60d012481796670002f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec554c7144d3fa3a1f0ca5b704e5488b914a9e0f657f9f5bdb4723c76fb0f4cfe65370477256010002554c7144d3fa3a1f0ca5b704e5488b914a9e0f657f9f5bdb4723c76fb0f4cfe600039e29488ef0017b7bce9f644f0e44c02c0fe8ee278435729feb60d0124817966715e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e73940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af537047725601000215e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e0001b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc537047725601000273940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af0001b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc53704772560100024c7c7b0df4f21aa8f69831e24bcb82344ee697eddfc21c636bd6ce579c78101e0000001e11636f6e7472616374656e766d6574617630000000000000001a00000000004f0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e39312e3000000000000000000012727373646b5f737065635f7368616b696e6700000000000132000000" + } + }, + "ext": "v0" + }, + "live_until": 4095 + } + ] + }, + "events": [] +} \ No newline at end of file diff --git a/tests/udt/test_snapshots/test_with_wasm/test_recursive_enum.1.json b/tests/udt/test_snapshots/test_with_wasm/test_recursive_enum.1.json new file mode 100644 index 000000000..a12691211 --- /dev/null +++ b/tests/udt/test_snapshots/test_with_wasm/test_recursive_enum.1.json @@ -0,0 +1,120 @@ +{ + "generators": { + "address": 1, + "nonce": 0, + "mux_id": 0 + }, + "auth": [ + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + { + "function": { + "create_contract_v2_host_fn": { + "contract_id_preimage": { + "address": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "salt": "0000000000000000000000000000000000000000000000000000000000000000" + } + }, + "executable": { + "wasm": "0ee9dab6c9f5369bae3f1dbc15dd28bd6726291f3659172c44f5227c9b9fd72a" + }, + "constructor_args": [] + } + }, + "sub_invocations": [] + } + ] + ], + [], + [] + ], + "ledger": { + "protocol_version": 26, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + { + "entry": { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "ledger_key_nonce": { + "nonce": "801925984706572462" + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + "live_until": 6311999 + }, + { + "entry": { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CBKMUZNFQIAL775XBB2W2GP5CNHBM5YGH6C3XB7AY6SUVO2IBU3VYK2V", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "0ee9dab6c9f5369bae3f1dbc15dd28bd6726291f3659172c44f5227c9b9fd72a" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + "live_until": 4095 + }, + { + "entry": { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": { + "v1": { + "ext": "v0", + "cost_inputs": { + "ext": "v0", + "n_instructions": 1524, + "n_functions": 17, + "n_globals": 4, + "n_table_entries": 0, + "n_types": 13, + "n_data_segments": 1, + "n_elem_segments": 0, + "n_imports": 13, + "n_exports": 7, + "n_data_segment_bytes": 132 + } + } + }, + "hash": "0ee9dab6c9f5369bae3f1dbc15dd28bd6726291f3659172c44f5227c9b9fd72a", + "code": "0061736d01000000014e0d60017e017e60037e7e7e017e60027e7e017e60047e7e7e7e017e60027f7e0060027f7f0060037e7f7f017e60027f7f017f60057e7f7f7f7f0060000060017f017e60037f7f7f0060027f7f017e024f0d017601330000017601680001016901320000017601310002016901310000017601380000016d01340002016d013100020176016700020162016a0002016d01390001016d016100030162016d00010312110405060708040404050209000a020b0c0905030100110621047f01418080c0000b7f00418481c0000b7f00418481c0000b7f00419081c0000b074c07066d656d6f727902000361646400160972656375727369766500180e7265637572736976655f656e756d001a015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030aaa1a11b60604017f017e027f017e23808080800041c0006b220224808080800002400240200142ff018342cb00510d00200041043a00000c010b200110808080800021032002410036021020022001370308200220034220883e0214200241186a200241086a108e808080000240024002400240200229031822014202510d002001a74101710d00024020022903202201a741ff0171220441ca00460d002004410e470d010b02400240024002402001419080c080004104108f80808000422088a70e0400010203050b200228021020022802141090808080000d04410021050c050b2002280210200228021410908080800041014b0d03200241186a200241086a108e80808000200229031822014202510d032001a74101710d0320022903202101410021040240034020044118460d01200241186a20046a4202370300200441086a21040c000b0b200142ff018342cc00520d03200141b480c080004103200241186a4103109180808000200241306a200229031810928080800020022802300d0320022903382103200241306a200229032010928080800020022802300d032002290328220642ff018342cb00520d0320022903382101410121050c040b2002280210200228021410908080800041014b0d02200241186a200241086a108e80808000200229031822014202510d022001a74101710d022002290320220142ff01834204520d02410a410f41092001422088a72204410f461b2004410a461b22044109460d02410221050c040b2002280210200228021410908080800041014b0d01200241186a200241086a108e80808000200229031822014202510d012001a74101710d012002290320220142ff018342cb00520d01410021040240034020044110460d01200241306a20046a4202370300200441086a21040c000b0b2001200241306aad4220864204844284808080201081808080001a200241186a200229033010928080800020022802184101460d012002290338220142ff018342cb00520d0120022903202103410321050c020b200041043a00000c030b200041043a00000c020b0b200020063703182000200137031020002003370308200020043a0001200020053a00000b200241c0006a2480808080000b4a02017e017f42022102024020012802082203200128020c4f0d00200020012903002003ad4220864204841083808080003703082001200341016a360208420021020b200020023703000b1c0020002001ad4220864204842002ad422086420484108c808080000b1900024020012000490d00200120006b0f0b109780808000000b3100024020022004460d00000b20002001ad4220864204842003ad4220864204842002ad422086420484108b808080001a0b5d02017f017e024002402001a741ff0171220241c100460d00024020024107460d00420121034283908080800121010c020b20014208872101420021030c010b42002103200110828080800021010b20002003370300200020013703080bb50102027f027e23808080800041106b2202248080808000410021030240034020034110460d01200220036a4202370300200341086a21030c000b0b420121040240200142ff018342cc00520d00200141cc80c08000410220024102109180808000024020022903002201a741ff0171220341ca00460d002003410e470d010b2002290308220542ff018342cb00520d002000200537031020002001370308420021040b20002004370300200241106a2480808080000bb50102027f027e23808080800041106b2202248080808000410021030240034020034110460d01200220036a4202370300200341086a21030c000b0b420121040240200142ff018342cc00520d00200141cc80c08000410220024102109180808000024020022903002201a741ff0171220341ca00460d002003410e470d010b2002290308220542ff018342cc00520d002000200537031020002001370308420021040b20002004370300200241106a2480808080000b7803017f017e017f23808080800041106b220224808080800042022103024020012802082204200128020c4f0d00200220012903002004ad42208642048410838080800010928080800020022903002103200020022903083703082001200441016a3602080b20002003370300200241106a2480808080000bb70404027f027e017f057e23808080800041306b220224808080800020022000108d8080800002400240024020022d000022034104460d0020022903102100200229030821042002310001210520022001108d8080800020022d000022064104460d002002290310210720022903082108200231000121094200210a4200210b024002400240024020030e0405020100050b200010808080800021012002410036022820022000370320200220014220883e022c4200210003402002200241206a109580808000200229030022014202510d032001a74101710d0620022903082201420053200020017c2201200053470d06200121000c000b0b2005210b0c030b2000420053200420007c220b20045373450d020c030b2000420053200420007c220b20045373450d010c020b000b0240024002400240024020060e0404020100040b200710808080800021002002410036022820022007370320200220004220883e022c4200210003402002200241206a109580808000200229030022014202510d032001a74101710d0520022903082201420053200020017c2201200053470d05200121000c000b0b2009210a0c020b2007420053200820077c220a200853730d020c010b2000420053200820007c220a200853730d010b200a420053200b200a7c2200200b53730d000240024020004280808080808080c0007c42ffffffffffffffff00560d00200042088642078421000c010b200010848080800021000b200241306a24808080800020000f0b109780808000000b0900109d80808000000b9f0102017f017e23808080800041206b2201248080808000200141086a2000109380808000024020012802084101460d0042022100024020012903182202108080808000428080808010540d00200141086a200210858080800010938080800020012802084101460d01200129031021002001200129031837031020012000370308200141086a10998080800021000b200141206a24808080800020000f0b000b240041cc80c08000ad4220864204842000ad422086420484428480808020108a808080000bf60503017f017e017f23808080800041c0006b22022480808080000240200042ff018342cb00520d00200010808080800021032002410036021020022000370308200220034220883e0214200241186a200241086a108e80808000200229031822004202510d002000a74101710d00024020022903202200a741ff0171220441ca00460d002004410e470d010b024002400240024002400240200041f480c080004102108f80808000422088a70e020100060b2002280210200228021410908080800041014b0d05200241306a200241086a108e80808000200229033022004202510d052000a74101710d05200241186a200229033810948080800020022802184101460d05200142ff01834204520d052002290328220020014284808080708322011086808080004201520d0120002001108780808000220042ff018342cb00520d05200010808080800021012002410036021020022000370308200220014220883e0214200241186a200241086a108e80808000200229031822004202510d052000a74101710d05024020022903202200a741ff0171220441ca00460d002004410e470d060b200041f480c080004102108f80808000422088a70e020302050b200228021020022802141090808080000d04200142ff01834204520d040b420221000c020b2002280210200228021410908080800041014b0d02200241306a200241086a108e80808000200229033022004202510d022000a74101710d02200241186a200229033810948080800020022802184101460d022002290328210020022903202101200241186a41e880c080004109109b8080800020022802180d022002290320210320022000370320200220013703182002200241186a10998080800037032020022003370318200241186a4102109c8080800021000c010b200228021020022802141090808080000d01200241186a41dc80c08000410c109b8080800020022802180d0120022002290320370318200241186a4101109c8080800021000b200241c0006a24808080800020000f0b000bd60102017e037f02400240200241094b0d0042002103410021040340024020044109470d002003420886420e8421030c030b410121050240200120046a2d0000220641df00460d0002400240200641506a41ff0171410a490d00200641bf7f6a41ff0171411a490d012006419f7f6a41ff0171411a4f0d04200641456a21050c020b200641526a21050c010b2006414b6a21050b20034206862005ad42ff0183842103200441016a21040c000b0b2001ad4220864204842002ad42208642048410898080800021030b20004200370300200020033703080b1a002000ad4220864204842001ad4220864204841088808080000b0300000b0b8e010100418080c0000b8401556474415564744255647443556474440000100004000000040010000400000008001000040000000c0010000400000061626300300010000100000031001000010000003200100001000000300010000100000031001000010000004e6f745265637572736976655265637572736976650000005c0010000c000000680010000900000000db1c0e636f6e74726163747370656376300000000000000000000000036164640000000002000000000000000161000000000007d000000007556474456e756d00000000000000000162000000000007d000000007556474456e756d00000000010000000700000002000000000000000000000007556474456e756d0000000004000000000000000000000004556474410000000100000000000000045564744200000001000007d0000000095564745374727563740000000000000100000000000000045564744300000001000007d000000008556474456e756d320000000100000000000000045564744400000001000007d0000000085564745475706c6500000003000000000000000000000008556474456e756d32000000020000000000000001410000000000000a0000000000000001420000000000000f000000010000000000000000000000085564745475706c650000000200000000000000013000000000000007000000000000000131000000000003ea0000000700000001000000000000000000000009556474537472756374000000000000030000000000000001610000000000000700000000000000016200000000000007000000000000000163000000000003ea0000000700000000000000000000000972656375727369766500000000000001000000000000000161000000000007d00000000c55647452656375727369766500000001000003e8000007d00000000c5564745265637572736976650000000100000000000000000000000c5564745265637572736976650000000200000000000000016100000000000011000000000000000162000000000003ea000007d00000000c5564745265637572736976650000000200000000000000000000000d526563757273697665456e756d0000000000000200000000000000000000000c4e6f7452656375727369766500000001000000000000000952656375727369766500000000000001000007d00000000f526563757273697665546f456e756d000000000100000000000000000000000f526563757273697665546f456e756d000000000200000000000000016100000000000011000000000000000162000000000003ec00000004000007d00000000d526563757273697665456e756d00000000000000000000000000000e7265637572736976655f656e756d000000000002000000000000000161000000000007d00000000d526563757273697665456e756d00000000000000000000036b6579000000000400000001000003e9000003e8000007d00000000d526563757273697665456e756d0000000000000300000002000000e3436f6e74657874206f6620612073696e676c6520617574686f72697a65642063616c6c20706572666f726d656420627920616e20616464726573732e0a0a437573746f6d206163636f756e7420636f6e747261637473207468617420696d706c656d656e7420605f5f636865636b5f6175746860207370656369616c2066756e6374696f6e0a726563656976652061206c697374206f662060436f6e74657874602076616c75657320636f72726573706f6e64696e6720746f20616c6c207468652063616c6c7320746861740a6e65656420746f20626520617574686f72697a65642e000000000000000007436f6e7465787400000000030000000100000014436f6e747261637420696e766f636174696f6e2e00000008436f6e747261637400000001000007d00000000f436f6e7472616374436f6e7465787400000000010000003d436f6e7472616374207468617420686173206120636f6e7374727563746f722077697468206e6f20617267756d656e747320697320637265617465642e00000000000014437265617465436f6e7472616374486f7374466e00000001000007d00000001b437265617465436f6e7472616374486f7374466e436f6e74657874000000000100000044436f6e7472616374207468617420686173206120636f6e7374727563746f7220776974682031206f72206d6f726520617267756d656e747320697320637265617465642e0000001c437265617465436f6e74726163745769746843746f72486f7374466e00000001000007d00000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e74657874000000000001000000bd417574686f72697a6174696f6e20636f6e74657874206f6620612073696e676c6520636f6e74726163742063616c6c2e0a0a546869732073747275637420636f72726573706f6e647320746f20612060726571756972655f617574685f666f725f61726773602063616c6c20666f7220616e20616464726573730a66726f6d2060636f6e7472616374602066756e6374696f6e20776974682060666e5f6e616d6560206e616d6520616e642060617267736020617267756d656e74732e000000000000000000000f436f6e7472616374436f6e746578740000000003000000000000000461726773000003ea000000000000000000000008636f6e7472616374000000130000000000000007666e5f6e616d650000000011000000020000005f436f6e74726163742065786563757461626c65207573656420666f72206372656174696e672061206e657720636f6e747261637420616e64207573656420696e0a60437265617465436f6e7472616374486f7374466e436f6e74657874602e000000000000000012436f6e747261637445786563757461626c650000000000010000000100000000000000045761736d00000001000003ee00000020000000010000003856616c7565206f6620636f6e7472616374206e6f646520696e20496e766f6b6572436f6e747261637441757468456e74727920747265652e0000000000000015537562436f6e7472616374496e766f636174696f6e000000000000020000000000000007636f6e7465787400000007d00000000f436f6e7472616374436f6e7465787400000000000000000f7375625f696e766f636174696f6e7300000003ea000007d000000018496e766f6b6572436f6e747261637441757468456e747279000000020000012f41206e6f646520696e207468652074726565206f6620617574686f72697a6174696f6e7320706572666f726d6564206f6e20626568616c66206f66207468652063757272656e740a636f6e747261637420617320696e766f6b6572206f662074686520636f6e7472616374732064656570657220696e207468652063616c6c20737461636b2e0a0a54686973206973207573656420617320616e20617267756d656e74206f662060617574686f72697a655f61735f63757272656e745f636f6e74726163746020686f73742066756e6374696f6e2e0a0a54686973207472656520636f72726573706f6e64732060726571756972655f617574685b5f666f725f617267735d602063616c6c73206f6e20626568616c66206f66207468650a63757272656e7420636f6e74726163742e000000000000000018496e766f6b6572436f6e747261637441757468456e747279000000030000000100000012496e766f6b65206120636f6e74726163742e000000000008436f6e747261637400000001000007d000000015537562436f6e7472616374496e766f636174696f6e0000000000000100000035437265617465206120636f6e74726163742070617373696e67203020617267756d656e747320746f20636f6e7374727563746f722e00000000000014437265617465436f6e7472616374486f7374466e00000001000007d00000001b437265617465436f6e7472616374486f7374466e436f6e7465787400000000010000003d437265617465206120636f6e74726163742070617373696e672030206f72206d6f726520617267756d656e747320746f20636f6e7374727563746f722e0000000000001c437265617465436f6e74726163745769746843746f72486f7374466e00000001000007d00000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e7465787400000000000100000076417574686f72697a6174696f6e20636f6e7465787420666f7220606372656174655f636f6e74726163746020686f73742066756e6374696f6e2074686174206372656174657320610a6e657720636f6e7472616374206f6e20626568616c66206f6620617574686f72697a657220616464726573732e0000000000000000001b437265617465436f6e7472616374486f7374466e436f6e746578740000000002000000000000000a65786563757461626c650000000007d000000012436f6e747261637445786563757461626c650000000000000000000473616c74000003ee0000002000000001000000d6417574686f72697a6174696f6e20636f6e7465787420666f7220606372656174655f636f6e74726163746020686f73742066756e6374696f6e2074686174206372656174657320610a6e657720636f6e7472616374206f6e20626568616c66206f6620617574686f72697a657220616464726573732e0a54686973206973207468652073616d652061732060437265617465436f6e7472616374486f7374466e436f6e74657874602c2062757420616c736f206861730a636f6e747261637420636f6e7374727563746f7220617267756d656e74732e0000000000000000002a437265617465436f6e747261637457697468436f6e7374727563746f72486f7374466e436f6e746578740000000000030000000000000010636f6e7374727563746f725f61726773000003ea00000000000000000000000a65786563757461626c650000000007d000000012436f6e747261637445786563757461626c650000000000000000000473616c74000003ee000000200000000200000000000000000000000a45786563757461626c650000000000030000000100000000000000045761736d00000001000003ee0000002000000000000000000000000c5374656c6c617241737365740000000000000000000000074163636f756e740000d10b1c636f6e74726163747370656376302e727373646b2e677261706876305370477256010002f3b0ab40690d48b4819c947c3f41efcff32551d58b90b24218fb8c3eaa8c5e32000316276438ffc9b1f81c66b084b1b8fa798460e4dd703bc52a0eba483a94bbb287aff793ba9e4dde9a3f27a8b9cb949f88f64cc0b918d1c91a35f899a539c2cf9eeb9f12269a76282a7f31372e3391cc63fcecee330f96f2501b39e8c68ff0e0eb5370477256010002aff793ba9e4dde9a3f27a8b9cb949f88f64cc0b918d1c91a35f899a539c2cf9e00005370477256010002eb9f12269a76282a7f31372e3391cc63fcecee330f96f2501b39e8c68ff0e0eb0000537047725601000216276438ffc9b1f81c66b084b1b8fa798460e4dd703bc52a0eba483a94bbb28700005370477256010000ebb96de3341d5b5be44be7e3f42e999bf21ae135a1442ba81b1c560aedc1a4890002f3b0ab40690d48b4819c947c3f41efcff32551d58b90b24218fb8c3eaa8c5e32f3b0ab40690d48b4819c947c3f41efcff32551d58b90b24218fb8c3eaa8c5e325370477256010002c81291fed713f59ce4c703dc402324460d04e26a5fb0ac43fd0bc04a7e3cfc050001c81291fed713f59ce4c703dc402324460d04e26a5fb0ac43fd0bc04a7e3cfc055370477256010002ff7b5620ab0ddc64e77e19833cc23774c69d3d9f8f120e183e2508892e26004d0001e16f55dbd43798147ab22bbbdfdb6e142492bbf14df21026500cd1134a9743695370477256010002e16f55dbd43798147ab22bbbdfdb6e142492bbf14df21026500cd1134a9743690001ff7b5620ab0ddc64e77e19833cc23774c69d3d9f8f120e183e2508892e26004d53704772560100002860835a3b9730d8da5a70cf9ebf82867c30b690104d6613cfd7360c446edbb20002c81291fed713f59ce4c703dc402324460d04e26a5fb0ac43fd0bc04a7e3cfc05c81291fed713f59ce4c703dc402324460d04e26a5fb0ac43fd0bc04a7e3cfc0553704772560100008448210efcdb4d3602aa4ee4ee994a089408a9c044884369c9077eb9a6c5ecaa0002ff7b5620ab0ddc64e77e19833cc23774c69d3d9f8f120e183e2508892e26004dff7b5620ab0ddc64e77e19833cc23774c69d3d9f8f120e183e2508892e26004d5370477256010002a34acff744930b425d95ebfe03798365355c16eb944e65e658771f26f7c070540003f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec15e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e73940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af5370477256010002f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec00005370477256010002b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc000053704772560100029e29488ef0017b7bce9f644f0e44c02c0fe8ee278435729feb60d012481796670002f1f99007452a65fd088cc2b110fdcaae36549e295bdbee5ffaedca459b7698ec554c7144d3fa3a1f0ca5b704e5488b914a9e0f657f9f5bdb4723c76fb0f4cfe65370477256010002554c7144d3fa3a1f0ca5b704e5488b914a9e0f657f9f5bdb4723c76fb0f4cfe600039e29488ef0017b7bce9f644f0e44c02c0fe8ee278435729feb60d0124817966715e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e73940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af537047725601000215e51a2cc0c7efd4e0da0e16871aaee733581d328a8a50ab81ef188e3aa2a96e0001b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc537047725601000273940c1932361d9019c88b3dbeafd76ecd3d7a09b237a52ede3a3e03cd3712af0001b6b14879dacaafcc1f0107799a23677d321c2e51305666c77a65ac6d01f559cc53704772560100024c7c7b0df4f21aa8f69831e24bcb82344ee697eddfc21c636bd6ce579c78101e0000001e11636f6e7472616374656e766d6574617630000000000000001a00000000004f0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e39312e3000000000000000000012727373646b5f737065635f7368616b696e6700000000000132000000" + } + }, + "ext": "v0" + }, + "live_until": 4095 + } + ] + }, + "events": [] +} \ No newline at end of file