difftreelog
refactor extract evm string error
in: master
2 files changed
crates/evm-coder/src/abi.rsdiffbeforeafterboth163 self.write_padleft(&u128::to_be_bytes(*value))163 self.write_padleft(&u128::to_be_bytes(*value))164 }164 }165165166 /// This method writes u128, and exists only for convenience, because there is167 /// no u256 support in rust168 pub fn uint256(&mut self, value: &U256) {166 pub fn uint256(&mut self, value: &U256) {169 let mut out = [0; 32];167 let mut out = [0; 32];170 value.to_big_endian(&mut out);168 value.to_big_endian(&mut out);260 fn abi_write(&self, _writer: &mut AbiWriter) {}258 fn abi_write(&self, _writer: &mut AbiWriter) {}261}259}262263/// Error, which can be constructed from any ToString type264/// Encoded to Abi as Error(string)265#[derive(Debug)]266pub struct StringError(String);267268impl<E> From<E> for StringError269where270 E: ToString,271{272 fn from(e: E) -> Self {273 Self(e.to_string())274 }275}276277impl From<StringError> for AbiWriter {278 fn from(v: StringError) -> Self {279 let mut out = AbiWriter::new_call(crate::fn_selector!(Error(string)));280 out.string(&v.0);281 out282 }283}284260285#[macro_export]261#[macro_export]286macro_rules! abi_decode {262macro_rules! abi_decode {crates/evm-coder/src/execution.rsdiffbeforeafterbothno changes