difftreelog
fix remove warning
in: master
2 files changed
crates/evm-coder/procedural/src/solidity_interface.rsdiffbeforeafterboth731 let selector_str = &self.selector_str;731 let selector_str = &self.selector_str;732 let custom_signature = self.expand_custom_signature();732 let custom_signature = self.expand_custom_signature();733 quote! {733 quote! {734 #[doc = #selector_str]734 const #screaming_name_signature: ::evm_coder::custom_signature::FunctionSignature = #custom_signature;735 const #screaming_name_signature: ::evm_coder::custom_signature::FunctionSignature = #custom_signature;735 #[doc = #selector_str]736 const #screaming_name: ::evm_coder::types::bytes4 = {736 const #screaming_name: ::evm_coder::types::bytes4 = {737 let mut data = [0_u8; Self::#screaming_name_signature.unit.len];737 let mut sum = ::evm_coder::sha3_const::Keccak256::new();738 let mut pos = 0;738 let mut pos = 0;739 while pos < Self::#screaming_name_signature.unit.len {739 while pos < Self::#screaming_name_signature.unit.len {740 data[pos] = Self::#screaming_name_signature.unit.data[pos];740 sum = sum.update(&[Self::#screaming_name_signature.unit.data[pos]; 1]);741 pos += 1;741 pos += 1;742 }742 }743 let a = ::evm_coder::sha3_const::Keccak256::new()743 let a = sum.finalize();744 .update(&data)745 .finalize();746 [a[0], a[1], a[2], a[3]]744 [a[0], a[1], a[2], a[3]]747 };745 };113411321135 let docs = &self.docs;1133 let docs = &self.docs;11361137 if let Some(expect_selector) = &self.info.expect_selector {1138 if !self.info.inline_is.0.is_empty() {1139 return syn::Error::new(1140 name.span(),1141 "expect_selector is not compatible with inline_is",1142 )1143 .to_compile_error();1144 }1145 let selector = self1146 .methods1147 .iter()1148 .map(|m| m.selector)1149 .fold(0, |a, b| a ^ b);11501151 if *expect_selector != selector {1152 let mut methods = String::new();1153 for meth in self.methods.iter() {1154 write!(methods, "\n- {}", meth.selector_str).expect("write to string");1155 }1156 return syn::Error::new(name.span(), format!("expected selector mismatch, expected {expect_selector:0>8x}, but implementation has {selector:0>8x}{methods}")).to_compile_error();1157 }1158 }1159 // let methods = self.methods.iter().map(Method::solidity_def);116011341161 quote! {1135 quote! {1162 #[derive(Debug)]1136 #[derive(Debug)]crates/evm-coder/src/custom_signature.rsdiffbeforeafterboth241/// ```241/// ```242#[macro_export]242#[macro_export]243macro_rules! make_signature {243macro_rules! make_signature {244 (new fn($func:expr)$(,)+) => {244 (new fn($func:expr)$(,)*) => {245 {245 {246 let fs = FunctionSignature::new($func);246 let fs = FunctionSignature::new($func);247 let fs = FunctionSignature::done(fs, false);247 let fs = FunctionSignature::done(fs, false);