From e132706f0b9866fa0b40b3edb698103699d67e64 Mon Sep 17 00:00:00 2001 From: sragss <65786432+sragss@users.noreply.github.com> Date: Fri, 2 Dec 2022 15:42:58 -0800 Subject: [PATCH] fix: prepend 0x to eth_getCode responses (#125) --- client/src/rpc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/rpc.rs b/client/src/rpc.rs index 12dc87a..db34689 100644 --- a/client/src/rpc.rs +++ b/client/src/rpc.rs @@ -131,7 +131,7 @@ impl EthRpcServer for RpcInner { let node = self.node.read().await; let code = convert_err(node.get_code(&address, block).await)?; - Ok(hex::encode(code)) + Ok(format!("0x{:}", hex::encode(code))) } async fn call(&self, opts: CallOpts, block: BlockTag) -> Result {