difftreelog
fix(evm-coder) reads should be hidden
in: master
1 file changed
crates/evm-coder/src/solidity.rsdiffbeforeafterboth225225226pub trait SolidityArguments {226pub trait SolidityArguments {227 fn solidity_name(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result;227 fn solidity_name(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result;228 fn solidity_get(&self, writer: &mut impl fmt::Write) -> fmt::Result;228 fn solidity_get(&self, prefix: &str, writer: &mut impl fmt::Write) -> fmt::Result;229 fn solidity_default(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result;229 fn solidity_default(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result;230 fn is_empty(&self) -> bool {230 fn is_empty(&self) -> bool {231 self.len() == 0231 self.len() == 0248 Ok(())248 Ok(())249 }249 }250 }250 }251 fn solidity_get(&self, _writer: &mut impl fmt::Write) -> fmt::Result {251 fn solidity_get(&self, _prefix: &str, _writer: &mut impl fmt::Write) -> fmt::Result {252 Ok(())252 Ok(())253 }253 }254 fn solidity_default(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result {254 fn solidity_default(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result {283 Ok(())283 Ok(())284 }284 }285 }285 }286 fn solidity_get(&self, writer: &mut impl fmt::Write) -> fmt::Result {286 fn solidity_get(&self, prefix: &str, writer: &mut impl fmt::Write) -> fmt::Result {287 writeln!(writer, "\t\t{};", self.0)287 writeln!(writer, "\t{prefix}\t{};", self.0)288 }288 }289 fn solidity_default(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result {289 fn solidity_default(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result {290 T::solidity_default(writer, tc)290 T::solidity_default(writer, tc)318 Ok(())318 Ok(())319 }319 }320 }320 }321 fn solidity_get(&self, writer: &mut impl fmt::Write) -> fmt::Result {321 fn solidity_get(&self, prefix: &str, writer: &mut impl fmt::Write) -> fmt::Result {322 writeln!(writer, "\t\t{};", self.1)322 writeln!(writer, "\t{prefix}\t{};", self.1)323 }323 }324 fn solidity_default(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result {324 fn solidity_default(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result {325 T::solidity_default(writer, tc)325 T::solidity_default(writer, tc)337 fn solidity_name(&self, _writer: &mut impl fmt::Write, _tc: &TypeCollector) -> fmt::Result {337 fn solidity_name(&self, _writer: &mut impl fmt::Write, _tc: &TypeCollector) -> fmt::Result {338 Ok(())338 Ok(())339 }339 }340 fn solidity_get(&self, _writer: &mut impl fmt::Write) -> fmt::Result {340 fn solidity_get(&self, _prefix: &str, _writer: &mut impl fmt::Write) -> fmt::Result {341 Ok(())341 Ok(())342 }342 }343 fn solidity_default(&self, _writer: &mut impl fmt::Write, _tc: &TypeCollector) -> fmt::Result {343 fn solidity_default(&self, _writer: &mut impl fmt::Write, _tc: &TypeCollector) -> fmt::Result {365 )* );365 )* );366 Ok(())366 Ok(())367 }367 }368 fn solidity_get(&self, writer: &mut impl fmt::Write) -> fmt::Result {368 fn solidity_get(&self, prefix: &str, writer: &mut impl fmt::Write) -> fmt::Result {369 for_tuples!( #(369 for_tuples!( #(370 Tuple.solidity_get(writer)?;370 Tuple.solidity_get(prefix, writer)?;371 )* );371 )* );372 Ok(())372 Ok(())373 }373 }470 if is_impl {470 if is_impl {471 writeln!(writer, " {{")?;471 writeln!(writer, " {{")?;472 writeln!(writer, "\t{hide_comment}\trequire(false, stub_error);")?;472 writeln!(writer, "\t{hide_comment}\trequire(false, stub_error);")?;473 self.args.solidity_get(writer)?;473 self.args.solidity_get(hide_comment, writer)?;474 match &self.mutability {474 match &self.mutability {475 SolidityMutability::Pure => {}475 SolidityMutability::Pure => {}476 SolidityMutability::View => writeln!(writer, "\t{hide_comment}\tdummy;")?,476 SolidityMutability::View => writeln!(writer, "\t{hide_comment}\tdummy;")?,