From 6809d47446ddda33bfb08f629f1c76d037c2baba Mon Sep 17 00:00:00 2001 From: Moritz Date: Wed, 26 Oct 2022 10:09:15 +0200 Subject: [PATCH 1/4] feat: blacklist attrs passed to Ext methods --- near-sdk-macros/Cargo.toml | 1 + .../src/core_impl/code_generator/ext.rs | 34 ++++++++++++++++--- .../code_generator/item_impl_info.rs | 5 +-- .../code_generator/item_trait_info.rs | 8 +++-- near-sdk-macros/src/core_impl/config/mod.rs | 30 ++++++++++++++++ near-sdk-macros/src/core_impl/mod.rs | 2 ++ near-sdk-macros/src/lib.rs | 22 +++++++++--- 7 files changed, 88 insertions(+), 14 deletions(-) create mode 100644 near-sdk-macros/src/core_impl/config/mod.rs diff --git a/near-sdk-macros/Cargo.toml b/near-sdk-macros/Cargo.toml index 80971480f..a30b9da62 100644 --- a/near-sdk-macros/Cargo.toml +++ b/near-sdk-macros/Cargo.toml @@ -15,6 +15,7 @@ Main macro of the library for writing NEAR smart contracts. proc-macro = true [dependencies] +darling = "0.14.1" proc-macro2 = "1.0" syn = {version = "1", features = ["full", "fold", "extra-traits", "visit"] } quote = "1.0" diff --git a/near-sdk-macros/src/core_impl/code_generator/ext.rs b/near-sdk-macros/src/core_impl/code_generator/ext.rs index 1f66077f0..b7451931e 100644 --- a/near-sdk-macros/src/core_impl/code_generator/ext.rs +++ b/near-sdk-macros/src/core_impl/code_generator/ext.rs @@ -1,7 +1,8 @@ +use crate::core_impl::config::MacroConfig; use crate::core_impl::{serializer, AttrSigInfo}; use proc_macro2::{Ident, TokenStream as TokenStream2}; use quote::{format_ident, quote, ToTokens}; -use syn::{Generics, Signature}; +use syn::{Attribute, Generics, Signature}; /// Generates inner ext code for structs and modules. If intended for a struct, generic details /// for the struct should be passed in through `generic_details` and the `ext` method will be @@ -63,11 +64,12 @@ pub(crate) fn generate_ext_structs( pub(crate) fn generate_ext_function_wrappers<'a>( ident: &Ident, methods: impl IntoIterator, + config: &MacroConfig, ) -> TokenStream2 { let ext_ident = format_ident!("{}Ext", ident); let mut res = TokenStream2::new(); for method in methods { - res.extend(generate_ext_function(method)); + res.extend(generate_ext_function(method, config)); } quote! { impl #ext_ident { @@ -76,13 +78,14 @@ pub(crate) fn generate_ext_function_wrappers<'a>( } } -fn generate_ext_function(attr_signature_info: &AttrSigInfo) -> TokenStream2 { +fn generate_ext_function(attr_signature_info: &AttrSigInfo, config: &MacroConfig) -> TokenStream2 { let pat_type_list = attr_signature_info.pat_type_list(); let serialize = serializer::generate_serializer(attr_signature_info, &attr_signature_info.input_serializer); let AttrSigInfo { non_bindgen_attrs, ident, original_sig, .. } = attr_signature_info; let ident_str = ident.to_string(); + let non_bindgen_attrs = filter_ext_function_non_bindgen_attrs(non_bindgen_attrs, config); let mut new_non_bindgen_attrs = TokenStream2::new(); for attribute in non_bindgen_attrs.iter() { attribute.to_tokens(&mut new_non_bindgen_attrs); @@ -104,6 +107,25 @@ fn generate_ext_function(attr_signature_info: &AttrSigInfo) -> TokenStream2 { } } +/// Filters non-bindgen attributes to be passed on to an ext function. +fn filter_ext_function_non_bindgen_attrs( + input_attrs: &Vec, + config: &MacroConfig, +) -> Vec { + let mut filtered_attrs = vec![]; + let blacklisted_attrs = match &config.blacklist_ext_fn_attrs { + Some(paths) => paths, + None => return input_attrs.clone(), + }; + for attribute in input_attrs.iter() { + let is_blacklisted = blacklisted_attrs.iter().any(|bl_path| bl_path == &attribute.path); + if !is_blacklisted { + filtered_attrs.push(attribute.clone()); + } + } + filtered_attrs +} + #[rustfmt::skip] #[cfg(test)] mod tests { @@ -200,7 +222,7 @@ mod tests { pub fn method(&self, k: &String) { } }; let method_info = ImplItemMethodInfo::new(&mut method, impl_type).unwrap(); - let actual = generate_ext_function(&method_info.attr_signature_info); + let actual = generate_ext_function(&method_info.attr_signature_info, &Default::default()); let expected = quote!( pub fn method(self, k: &String,) -> near_sdk::Promise { let __args = {#[derive(near_sdk :: serde :: Serialize)] @@ -231,7 +253,7 @@ mod tests { pub fn borsh_test(&mut self, #[serializer(borsh)] a: String) {} }; let method_info = ImplItemMethodInfo::new(&mut method, impl_type).unwrap(); - let actual = generate_ext_function(&method_info.attr_signature_info); + let actual = generate_ext_function(&method_info.attr_signature_info, &Default::default()); let expected = quote!( pub fn borsh_test(self, a: String,) -> near_sdk::Promise { let __args = { @@ -255,4 +277,6 @@ mod tests { ); assert_eq!(expected.to_string(), actual.to_string()); } + + // TODO(blacklist) add a test here } diff --git a/near-sdk-macros/src/core_impl/code_generator/item_impl_info.rs b/near-sdk-macros/src/core_impl/code_generator/item_impl_info.rs index 096f73c30..501be0434 100644 --- a/near-sdk-macros/src/core_impl/code_generator/item_impl_info.rs +++ b/near-sdk-macros/src/core_impl/code_generator/item_impl_info.rs @@ -1,5 +1,5 @@ use crate::core_impl::ext::generate_ext_function_wrappers; -use crate::ItemImplInfo; +use crate::{ItemImplInfo, MacroConfig}; use proc_macro2::TokenStream as TokenStream2; use quote::ToTokens; use syn::{spanned::Spanned, Ident}; @@ -16,7 +16,7 @@ impl ItemImplInfo { res } - pub fn generate_ext_wrapper_code(&self) -> TokenStream2 { + pub fn generate_ext_wrapper_code(&self, config: &MacroConfig) -> TokenStream2 { match syn::parse::(self.ty.to_token_stream().into()) { Ok(n) => generate_ext_function_wrappers( &n, @@ -24,6 +24,7 @@ impl ItemImplInfo { .iter() .filter(|m| m.is_public || self.is_trait_impl) .map(|m| &m.attr_signature_info), + config, ), Err(e) => syn::Error::new(self.ty.span(), e).to_compile_error(), } diff --git a/near-sdk-macros/src/core_impl/code_generator/item_trait_info.rs b/near-sdk-macros/src/core_impl/code_generator/item_trait_info.rs index 5ab5a0d4b..231c6886a 100644 --- a/near-sdk-macros/src/core_impl/code_generator/item_trait_info.rs +++ b/near-sdk-macros/src/core_impl/code_generator/item_trait_info.rs @@ -1,17 +1,19 @@ use crate::core_impl::ext::{generate_ext_function_wrappers, generate_ext_structs}; use crate::core_impl::info_extractor::ItemTraitInfo; +use crate::core_impl::MacroConfig; use proc_macro2::TokenStream as TokenStream2; use quote::quote; impl ItemTraitInfo { /// Generate code that wrapps external calls. - pub fn wrap_trait_ext(&self) -> TokenStream2 { + pub fn wrap_trait_ext(&self, config: &MacroConfig) -> TokenStream2 { let mod_name = &self.mod_name; let ext_structs = generate_ext_structs(&self.original.ident, None); let ext_methods = generate_ext_function_wrappers( &self.original.ident, self.methods.iter().map(|m| &m.attr_sig_info), + config, ); quote! { @@ -51,7 +53,7 @@ mod tests { } ).unwrap(); let info = ItemTraitInfo::new(&mut t, None).unwrap(); - let actual = info.wrap_trait_ext(); + let actual = info.wrap_trait_ext(&Default::default()); let expected = quote! { pub mod external_cross_contract { @@ -138,7 +140,7 @@ mod tests { } ).unwrap(); let info = ItemTraitInfo::new(&mut t, None).unwrap(); - let actual = info.wrap_trait_ext(); + let actual = info.wrap_trait_ext(&Default::default()); let expected = quote! { pub mod test { diff --git a/near-sdk-macros/src/core_impl/config/mod.rs b/near-sdk-macros/src/core_impl/config/mod.rs new file mode 100644 index 000000000..a940201a6 --- /dev/null +++ b/near-sdk-macros/src/core_impl/config/mod.rs @@ -0,0 +1,30 @@ +use darling::util::PathList; +use darling::FromMeta; + +/// Holds configuration of macros. +#[derive(Default, FromMeta, Clone, Debug)] +pub struct MacroConfig { + /// Prevents attributes on methods of a `Contract` to be forwarded to + /// automatically generated methods of `ContractExt`. + /// + /// To be used with `#[near_bindgen]` on implementation blocks that contain + /// methods whose attributes should not be forwarded. + /// + /// # Macros supporting this parameter + /// + /// - near_bindgen + /// + /// # Examples + /// + /// ```ignore + /// // Attributes `attr_1` and `attr_2` will not be forwarded to + /// // `ContractExt::foo`. + /// #[near_bindgen(blacklist_ext_fn_attrs(attr1, attr2))] + /// impl Contract { + /// #[attr_1] + /// #[attr_2] + /// pub fn foo(&self) {} + /// } + /// ``` + pub blacklist_ext_fn_attrs: Option, +} diff --git a/near-sdk-macros/src/core_impl/mod.rs b/near-sdk-macros/src/core_impl/mod.rs index 47a0b33a9..0d5715984 100644 --- a/near-sdk-macros/src/core_impl/mod.rs +++ b/near-sdk-macros/src/core_impl/mod.rs @@ -1,9 +1,11 @@ #[cfg(any(feature = "__abi-embed", feature = "__abi-generate"))] pub(crate) mod abi; mod code_generator; +mod config; mod info_extractor; mod metadata; mod utils; pub(crate) use code_generator::*; +pub(crate) use config::MacroConfig; pub(crate) use info_extractor::*; pub(crate) use metadata::metadata_visitor::MetadataVisitor; diff --git a/near-sdk-macros/src/lib.rs b/near-sdk-macros/src/lib.rs index 420cf6b2d..f99ada2c0 100644 --- a/near-sdk-macros/src/lib.rs +++ b/near-sdk-macros/src/lib.rs @@ -4,13 +4,18 @@ extern crate proc_macro; mod core_impl; use core_impl::ext::generate_ext_structs; +use core_impl::MacroConfig; use proc_macro::TokenStream; use self::core_impl::*; +use darling::FromMeta; use proc_macro2::Span; use quote::{quote, ToTokens}; use syn::visit::Visit; -use syn::{parse_quote, File, ItemEnum, ItemImpl, ItemStruct, ItemTrait, WhereClause}; +use syn::{ + parse_macro_input, parse_quote, AttributeArgs, File, ItemEnum, ItemImpl, ItemStruct, ItemTrait, + WhereClause, +}; /// This attribute macro is used on a struct and its implementations /// to generate the necessary code to expose `pub` methods from the contract as well @@ -44,7 +49,15 @@ use syn::{parse_quote, File, ItemEnum, ItemImpl, ItemStruct, ItemTrait, WhereCla /// } /// ``` #[proc_macro_attribute] -pub fn near_bindgen(_attr: TokenStream, item: TokenStream) -> TokenStream { +pub fn near_bindgen(attrs: TokenStream, item: TokenStream) -> TokenStream { + let attr_args = parse_macro_input!(attrs as AttributeArgs); + let config = match MacroConfig::from_list(&attr_args) { + Ok(args) => args, + Err(e) => { + return TokenStream::from(e.write_errors()); + } + }; + if let Ok(input) = syn::parse::(item.clone()) { let ext_gen = generate_ext_structs(&input.ident, Some(&input.generics)); #[cfg(feature = "__abi-embed")] @@ -95,7 +108,7 @@ pub fn near_bindgen(_attr: TokenStream, item: TokenStream) -> TokenStream { let generated_code = item_impl_info.wrapper_code(); // Add wrapper methods for ext call API - let ext_generated_code = item_impl_info.generate_ext_wrapper_code(); + let ext_generated_code = item_impl_info.generate_ext_wrapper_code(&config); TokenStream::from(quote! { #ext_generated_code #input @@ -151,7 +164,8 @@ pub fn ext_contract(attr: TokenStream, item: TokenStream) -> TokenStream { Ok(x) => x, Err(err) => return TokenStream::from(err.to_compile_error()), }; - let ext_api = item_trait_info.wrap_trait_ext(); + + let ext_api = item_trait_info.wrap_trait_ext(&MacroConfig::default()); TokenStream::from(quote! { #input From 9c06357fd7238730eb2b166eda32303004071532 Mon Sep 17 00:00:00 2001 From: Moritz Date: Thu, 27 Oct 2022 16:03:00 +0200 Subject: [PATCH 2/4] test: add compilation test --- near-sdk/compilation_tests/all.rs | 1 + .../macro_config_blacklist_ext_fn_attrs.rs | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 near-sdk/compilation_tests/macro_config_blacklist_ext_fn_attrs.rs diff --git a/near-sdk/compilation_tests/all.rs b/near-sdk/compilation_tests/all.rs index 6e727d8ae..6c0e10e70 100644 --- a/near-sdk/compilation_tests/all.rs +++ b/near-sdk/compilation_tests/all.rs @@ -20,4 +20,5 @@ fn compilation_tests() { t.pass("compilation_tests/borsh_storage_key_generics.rs"); t.pass("compilation_tests/function_error.rs"); t.pass("compilation_tests/enum_near_bindgen.rs"); + t.pass("compilation_tests/macro_config_blacklist_ext_fn_attrs.rs"); } diff --git a/near-sdk/compilation_tests/macro_config_blacklist_ext_fn_attrs.rs b/near-sdk/compilation_tests/macro_config_blacklist_ext_fn_attrs.rs new file mode 100644 index 000000000..2c8cf083d --- /dev/null +++ b/near-sdk/compilation_tests/macro_config_blacklist_ext_fn_attrs.rs @@ -0,0 +1,21 @@ +//! A smart contract setting configuration parameter `blacklist_ext_fn_attrs`. + +use borsh::{BorshDeserialize, BorshSerialize}; +use near_sdk::near_bindgen; + +#[near_bindgen] +#[derive(Default, BorshDeserialize, BorshSerialize)] +struct Incrementer { + value: u32, +} + +#[near_bindgen(blacklist_ext_fn_attrs(inline, forbid))] +impl Incrementer { + #[inline] // a bare attribute + #[allow(missing_docs)] // an attribute with additional input + pub fn inc(&mut self, by: u32) { + self.value += by; + } +} + +fn main() {} From c832b36b25b656bb63716aa0a305e45d66acb794 Mon Sep 17 00:00:00 2001 From: Moritz Date: Thu, 27 Oct 2022 17:46:19 +0200 Subject: [PATCH 3/4] test: add unit test `blacklisted_ext_fn_attrs` --- .../src/core_impl/code_generator/ext.rs | 43 +++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/near-sdk-macros/src/core_impl/code_generator/ext.rs b/near-sdk-macros/src/core_impl/code_generator/ext.rs index b7451931e..fb4ea18cd 100644 --- a/near-sdk-macros/src/core_impl/code_generator/ext.rs +++ b/near-sdk-macros/src/core_impl/code_generator/ext.rs @@ -109,13 +109,13 @@ fn generate_ext_function(attr_signature_info: &AttrSigInfo, config: &MacroConfig /// Filters non-bindgen attributes to be passed on to an ext function. fn filter_ext_function_non_bindgen_attrs( - input_attrs: &Vec, + input_attrs: &[Attribute], config: &MacroConfig, ) -> Vec { let mut filtered_attrs = vec![]; let blacklisted_attrs = match &config.blacklist_ext_fn_attrs { Some(paths) => paths, - None => return input_attrs.clone(), + None => return input_attrs.to_vec(), }; for attribute in input_attrs.iter() { let is_blacklisted = blacklisted_attrs.iter().any(|bl_path| bl_path == &attribute.path); @@ -129,6 +129,7 @@ fn filter_ext_function_non_bindgen_attrs( #[rustfmt::skip] #[cfg(test)] mod tests { + use crate::core_impl::config::MacroConfig; use crate::core_impl::ImplItemMethodInfo; use super::*; @@ -278,5 +279,41 @@ mod tests { assert_eq!(expected.to_string(), actual.to_string()); } - // TODO(blacklist) add a test here + /// Tests handling of MacroConfig.blacklist_ext_fn_attrs. + #[test] + fn blacklisted_ext_fn_attrs() { + let impl_type: Type = parse_quote! { Hello }; + let mut method: ImplItemMethod = parse_quote! { + #[inline] + #[allow(missing_docs)] + #[warn(unused)] + #[warn(unused_must_use)] + pub fn method(&self) { } + }; + let method_info = ImplItemMethodInfo::new(&mut method, impl_type).unwrap(); + + let config = MacroConfig { + blacklist_ext_fn_attrs: Some(darling::util::PathList::new::(vec![ + parse_quote! { inline }, + parse_quote! { warn }, + ])), + }; + + let actual = generate_ext_function(&method_info.attr_signature_info, &config); + // Note: blacklisted attributes are not present. + let expected = quote! { + #[allow(missing_docs)] + pub fn method (self,) -> near_sdk::Promise { + let __args = vec![]; + near_sdk::Promise::new(self.account_id).function_call_weight( + "method".to_string(), + __args, + self.deposit, + self.static_gas, + self.gas_weight, + ) + } + }; + assert_eq!(expected.to_string(), actual.to_string()); + } } From 5bd76538705a744892fe85c4b9d26ab89a99af30 Mon Sep 17 00:00:00 2001 From: Moritz Date: Fri, 28 Oct 2022 20:01:50 +0200 Subject: [PATCH 4/4] Update Cargo.lock files in examples/ --- examples/adder/Cargo.lock | 48 +++++++++++++ examples/callback-results/Cargo.lock | 48 +++++++++++++ examples/cross-contract-calls/Cargo.lock | 70 ++++++++++++++++--- examples/factory-contract/Cargo.lock | 70 ++++++++++++++++--- examples/fungible-token/Cargo.lock | 48 +++++++++++++ examples/lockable-fungible-token/Cargo.lock | 48 +++++++++++++ examples/mission-control/Cargo.lock | 56 ++++++++++++++- examples/non-fungible-token/Cargo.lock | 48 +++++++++++++ .../status-message-collections/Cargo.lock | 56 ++++++++++++++- examples/status-message/Cargo.lock | 56 ++++++++++++++- examples/test-contract/Cargo.lock | 56 ++++++++++++++- examples/versioned/Cargo.lock | 56 ++++++++++++++- 12 files changed, 639 insertions(+), 21 deletions(-) diff --git a/examples/adder/Cargo.lock b/examples/adder/Cargo.lock index dbd828ef2..485b75b5b 100644 --- a/examples/adder/Cargo.lock +++ b/examples/adder/Cargo.lock @@ -618,6 +618,41 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -1072,6 +1107,12 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.2.3" @@ -1561,6 +1602,7 @@ name = "near-sdk-macros" version = "4.1.0-pre.3" dependencies = [ "Inflector", + "darling", "proc-macro2", "quote", "syn", @@ -2370,6 +2412,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strum" version = "0.24.0" diff --git a/examples/callback-results/Cargo.lock b/examples/callback-results/Cargo.lock index 38373e3a1..f4a4afb28 100644 --- a/examples/callback-results/Cargo.lock +++ b/examples/callback-results/Cargo.lock @@ -609,6 +609,41 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -1053,6 +1088,12 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.2.3" @@ -1507,6 +1548,7 @@ name = "near-sdk-macros" version = "4.1.0-pre.3" dependencies = [ "Inflector", + "darling", "proc-macro2", "quote", "syn", @@ -2276,6 +2318,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strum" version = "0.24.0" diff --git a/examples/cross-contract-calls/Cargo.lock b/examples/cross-contract-calls/Cargo.lock index 044d4067b..f52f57b0f 100644 --- a/examples/cross-contract-calls/Cargo.lock +++ b/examples/cross-contract-calls/Cargo.lock @@ -652,6 +652,41 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -1096,6 +1131,12 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.2.3" @@ -1556,6 +1597,7 @@ name = "near-sdk-macros" version = "4.1.0-pre.3" dependencies = [ "Inflector", + "darling", "proc-macro2", "quote", "syn", @@ -1949,18 +1991,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.36" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "quote" -version = "1.0.17" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632d02bff7f874a36f33ea8bb416cd484b90cc66c1194b1a1110d067a7013f58" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ "proc-macro2", ] @@ -2404,6 +2446,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strum" version = "0.24.0" @@ -2434,13 +2482,13 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.90" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704df27628939572cd88d33f171cd6f896f4eaca85252c6e0a72d8d8287ee86f" +checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -2703,6 +2751,12 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +[[package]] +name = "unicode-ident" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" + [[package]] name = "unicode-normalization" version = "0.1.19" diff --git a/examples/factory-contract/Cargo.lock b/examples/factory-contract/Cargo.lock index ea526134b..57a204b6f 100644 --- a/examples/factory-contract/Cargo.lock +++ b/examples/factory-contract/Cargo.lock @@ -623,6 +623,41 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -1096,6 +1131,12 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.2.3" @@ -1556,6 +1597,7 @@ name = "near-sdk-macros" version = "4.1.0-pre.3" dependencies = [ "Inflector", + "darling", "proc-macro2", "quote", "syn", @@ -1949,18 +1991,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.36" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "quote" -version = "1.0.17" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632d02bff7f874a36f33ea8bb416cd484b90cc66c1194b1a1110d067a7013f58" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ "proc-macro2", ] @@ -2404,6 +2446,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strum" version = "0.24.0" @@ -2434,13 +2482,13 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.89" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea297be220d52398dcc07ce15a209fce436d361735ac1db700cab3b6cdfb9f54" +checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -2703,6 +2751,12 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +[[package]] +name = "unicode-ident" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" + [[package]] name = "unicode-normalization" version = "0.1.19" diff --git a/examples/fungible-token/Cargo.lock b/examples/fungible-token/Cargo.lock index d88ec0ac2..84e827e5c 100644 --- a/examples/fungible-token/Cargo.lock +++ b/examples/fungible-token/Cargo.lock @@ -616,6 +616,41 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "defi" version = "0.0.1" @@ -1100,6 +1135,12 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.2.3" @@ -1697,6 +1738,7 @@ name = "near-sdk-macros" version = "4.1.0-pre.3" dependencies = [ "Inflector", + "darling", "proc-macro2", "quote", "syn", @@ -2580,6 +2622,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strum" version = "0.24.0" diff --git a/examples/lockable-fungible-token/Cargo.lock b/examples/lockable-fungible-token/Cargo.lock index fab1f9a94..359eb501d 100644 --- a/examples/lockable-fungible-token/Cargo.lock +++ b/examples/lockable-fungible-token/Cargo.lock @@ -616,6 +616,41 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -1060,6 +1095,12 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.2.3" @@ -1646,6 +1687,7 @@ name = "near-sdk-macros" version = "4.1.0-pre.3" dependencies = [ "Inflector", + "darling", "proc-macro2", "quote", "syn", @@ -2494,6 +2536,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strum" version = "0.24.0" diff --git a/examples/mission-control/Cargo.lock b/examples/mission-control/Cargo.lock index 8eee69f87..4d47cc4c5 100644 --- a/examples/mission-control/Cargo.lock +++ b/examples/mission-control/Cargo.lock @@ -270,6 +270,41 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -343,6 +378,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "funty" version = "1.1.0" @@ -402,6 +443,12 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "impl-codec" version = "0.5.1" @@ -590,6 +637,7 @@ name = "near-sdk-macros" version = "4.1.0-pre.3" dependencies = [ "Inflector", + "darling", "proc-macro2", "quote", "syn", @@ -628,7 +676,7 @@ dependencies = [ "near-vm-errors", "ripemd", "serde", - "sha2 0.9.9", + "sha2 0.10.2", "sha3", "zeropool-bn", ] @@ -1008,6 +1056,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strum" version = "0.24.0" diff --git a/examples/non-fungible-token/Cargo.lock b/examples/non-fungible-token/Cargo.lock index 905b629dc..453160564 100644 --- a/examples/non-fungible-token/Cargo.lock +++ b/examples/non-fungible-token/Cargo.lock @@ -624,6 +624,41 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -1074,6 +1109,12 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.2.3" @@ -1657,6 +1698,7 @@ name = "near-sdk-macros" version = "4.1.0-pre.3" dependencies = [ "Inflector", + "darling", "proc-macro2", "quote", "syn", @@ -2562,6 +2604,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strum" version = "0.24.0" diff --git a/examples/status-message-collections/Cargo.lock b/examples/status-message-collections/Cargo.lock index 8e3c6dfc4..82bb6e64f 100644 --- a/examples/status-message-collections/Cargo.lock +++ b/examples/status-message-collections/Cargo.lock @@ -270,6 +270,41 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -343,6 +378,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "funty" version = "1.1.0" @@ -402,6 +443,12 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "impl-codec" version = "0.5.1" @@ -583,6 +630,7 @@ name = "near-sdk-macros" version = "4.1.0-pre.3" dependencies = [ "Inflector", + "darling", "proc-macro2", "quote", "syn", @@ -621,7 +669,7 @@ dependencies = [ "near-vm-errors", "ripemd", "serde", - "sha2 0.9.9", + "sha2 0.10.2", "sha3", "zeropool-bn", ] @@ -1008,6 +1056,12 @@ dependencies = [ "near-sdk", ] +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strum" version = "0.24.0" diff --git a/examples/status-message/Cargo.lock b/examples/status-message/Cargo.lock index a346405b6..35441b693 100644 --- a/examples/status-message/Cargo.lock +++ b/examples/status-message/Cargo.lock @@ -270,6 +270,41 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -343,6 +378,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "funty" version = "1.1.0" @@ -402,6 +443,12 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "impl-codec" version = "0.5.1" @@ -583,6 +630,7 @@ name = "near-sdk-macros" version = "4.1.0-pre.3" dependencies = [ "Inflector", + "darling", "proc-macro2", "quote", "syn", @@ -621,7 +669,7 @@ dependencies = [ "near-vm-errors", "ripemd", "serde", - "sha2 0.9.9", + "sha2 0.10.2", "sha3", "zeropool-bn", ] @@ -1008,6 +1056,12 @@ dependencies = [ "near-sdk", ] +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strum" version = "0.24.0" diff --git a/examples/test-contract/Cargo.lock b/examples/test-contract/Cargo.lock index 33d87637d..8119df4c2 100644 --- a/examples/test-contract/Cargo.lock +++ b/examples/test-contract/Cargo.lock @@ -270,6 +270,41 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -343,6 +378,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "funty" version = "1.1.0" @@ -402,6 +443,12 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "impl-codec" version = "0.5.1" @@ -583,6 +630,7 @@ name = "near-sdk-macros" version = "4.1.0-pre.3" dependencies = [ "Inflector", + "darling", "proc-macro2", "quote", "syn", @@ -621,7 +669,7 @@ dependencies = [ "near-vm-errors", "ripemd", "serde", - "sha2 0.9.9", + "sha2 0.10.2", "sha3", "zeropool-bn", ] @@ -1001,6 +1049,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strum" version = "0.24.0" diff --git a/examples/versioned/Cargo.lock b/examples/versioned/Cargo.lock index 7ee205509..c47b3b278 100644 --- a/examples/versioned/Cargo.lock +++ b/examples/versioned/Cargo.lock @@ -277,6 +277,41 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -350,6 +385,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "funty" version = "1.1.0" @@ -409,6 +450,12 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "impl-codec" version = "0.5.1" @@ -590,6 +637,7 @@ name = "near-sdk-macros" version = "4.1.0-pre.3" dependencies = [ "Inflector", + "darling", "proc-macro2", "quote", "syn", @@ -628,7 +676,7 @@ dependencies = [ "near-vm-errors", "ripemd", "serde", - "sha2 0.9.9", + "sha2 0.10.2", "sha3", "zeropool-bn", ] @@ -1010,6 +1058,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strum" version = "0.24.0"