pub fn generate_event(&self) -> TokenStream {
		let name_as_string = &self.name.to_camel_case();
		let name = syn::Ident::new(&self.name.to_snake_case(), Span::call_site());
		let camel_name = syn::Ident::new(&self.name.to_camel_case(), Span::call_site());
		let recreate_inputs_quote = &self.recreate_inputs_quote;
		let anonymous = &self.anonymous;
		let log_init = &self.log_init;
		let filter_init = &self.filter_init;
		let filter_declarations = &self.filter_declarations;
		let filter_definitions = &self.filter_definitions;
		let wildcard_filter_params = &self.wildcard_filter_params;

		quote! {
			pub mod #name {
				use ethabi;
				use super::INTERNAL_ERR;

				pub fn event() -> ethabi::Event {
					ethabi::Event {
						name: #name_as_string.into(),
						inputs: #recreate_inputs_quote,
						anonymous: #anonymous,
					}
				}

				pub fn filter<#(#filter_declarations),*>(#(#filter_definitions),*) -> ethabi::TopicFilter {
					let raw = ethabi::RawTopicFilter {
						#(#filter_init)*
						..Default::default()
					};

					let e = event();
					e.filter(raw).expect(INTERNAL_ERR)
				}

				pub fn wildcard_filter() -> ethabi::TopicFilter {
					filter(#(#wildcard_filter_params),*)
				}

				pub fn parse_log(log: ethabi::RawLog) -> ethabi::Result<super::super::logs::#camel_name> {
					let e = event();
					let mut log = e.parse_log(log)?.params.into_iter();
					let result = super::super::logs::#camel_name {
						#(#log_init),*
					};
					Ok(result)
				}
			}
		}
	}
/// Generates rust interface for contract's event.
Generates rust interface for contract's event.
Generates rust interface for contract ' s event .
pub fn generate_event(&self) -> TokenStream {
		let name_as_string = &self.name.to_camel_case();
		let name = syn::Ident::new(&self.name.to_snake_case(), Span::call_site());
		let camel_name = syn::Ident::new(&self.name.to_camel_case(), Span::call_site());
		let recreate_inputs_quote = &self.recreate_inputs_quote;
		let anonymous = &self.anonymous;
		let log_init = &self.log_init;
		let filter_init = &self.filter_init;
		let filter_declarations = &self.filter_declarations;
		let filter_definitions = &self.filter_definitions;
		let wildcard_filter_params = &self.wildcard_filter_params;
		quote! {
			pub mod #name {
				use ethabi;
				use super::INTERNAL_ERR;
				pub fn event() -> ethabi::Event {
					ethabi::Event {
						name: #name_as_string.into(),
						inputs: #recreate_inputs_quote,
						anonymous: #anonymous,
					}
				}
				pub fn filter<#(#filter_declarations),*>(#(#filter_definitions),*) -> ethabi::TopicFilter {
					let raw = ethabi::RawTopicFilter {
						#(#filter_init)*
						..Default::default()
					};
					let e = event();
					e.filter(raw).expect(INTERNAL_ERR)
				}
				pub fn wildcard_filter() -> ethabi::TopicFilter {
					filter(#(#wildcard_filter_params),*)
				}
				pub fn parse_log(log: ethabi::RawLog) -> ethabi::Result<super::super::logs::#camel_name> {
					let e = event();
					let mut log = e.parse_log(log)?.params.into_iter();
					let result = super::super::logs::#camel_name {
						#(#log_init),*
					};
					Ok(result)
				}
			}
		}
	}
pub fn generate_event ( & self ) -> TokenStream { let name_as_string = & self . name . to_camel_case ( ) ; let name = syn :: Ident :: new ( & self . name . to_snake_case ( ) , Span :: call_site ( ) ) ; let camel_name = syn :: Ident :: new ( & self . name . to_camel_case ( ) , Span :: call_site ( ) ) ; let recreate_inputs_quote = & self . recreate_inputs_quote ; let anonymous = & self . anonymous ; let log_init = & self . log_init ; let filter_init = & self . filter_init ; let filter_declarations = & self . filter_declarations ; let filter_definitions = & self . filter_definitions ; let wildcard_filter_params = & self . wildcard_filter_params ; quote ! { pub mod name { use ethabi use super INTERNAL_ERR pub fn event ( ) ethabi Event { ethabi Event { name name_as_string into ( ) inputs recreate_inputs_quote anonymous anonymous } } pub fn filter ( filter_declarations ) ( ( filter_definitions ) ) ethabi TopicFilter { let raw ethabi RawTopicFilter { ( filter_init ) Default default ( ) } let e event ( ) e filter ( raw ) expect ( INTERNAL_ERR ) } pub fn wildcard_filter ( ) ethabi TopicFilter { filter ( ( wildcard_filter_params ) ) } pub fn parse_log ( log ethabi RawLog ) ethabi Result super super logs camel_name { let e event ( ) let mut log e parse_log ( log ) params into_iter ( ) let result super super logs camel_name { ( log_init ) } Ok ( result ) } } } }
Generates rust interface for contract's event.
Generates rust interface for contract ' s event .
&self