diff --git a/lib/ain-grpc/src/rpc.rs b/lib/ain-grpc/src/rpc.rs index d5a54e6e2c..03743596b5 100644 --- a/lib/ain-grpc/src/rpc.rs +++ b/lib/ain-grpc/src/rpc.rs @@ -97,15 +97,10 @@ pub trait MetachainRPC { ) -> Result; #[method(name = "eth_getTransactionCount")] - fn get_transaction_count( - &self, - input: String - ) -> Result; + fn get_transaction_count(&self, input: String) -> Result; #[method(name = "eth_estimateGas")] - fn estimate_gas( - &self - ) -> Result; + fn estimate_gas(&self) -> Result; } pub struct MetachainRPCModule { @@ -131,7 +126,9 @@ impl MetachainRPCServer for MetachainRPCModule { let from = from.map(|addr| addr.parse::().expect("Wrong `from` address format")); let to = to.map(|addr| addr.parse::().expect("Wrong `to` address format")); - let value: U256 = value.map(|addr| addr.parse::().expect("Wrong `value` address format")).unwrap_or_default(); + let value: U256 = value + .map(|addr| addr.parse::().expect("Wrong `value` address format")) + .unwrap_or_default(); let gas: u64 = gas.unwrap_or_default(); let (_, data) = self @@ -139,7 +136,7 @@ impl MetachainRPCServer for MetachainRPCModule { .evm .call(from, to, value, data.as_bytes(), gas, vec![]); - Ok(data) + Ok(Hex::encode(data)) } fn accounts(&self) -> Result, jsonrpsee::core::Error> { @@ -355,19 +352,14 @@ impl MetachainRPCServer for MetachainRPCModule { }) } - fn get_transaction_count( - &self, - input: String - ) -> Result { + fn get_transaction_count(&self, input: String) -> Result { let input = input.parse().expect("Invalid address"); let nonce = self.handler.evm.get_nonce(input); Ok(format!("{:#x}", nonce)) } - fn estimate_gas( - &self - ) -> Result { + fn estimate_gas(&self) -> Result { Ok(format!("{:#x}", 21000)) } }