From 6947c58b45d38f92148dc19091211dfbb23e0082 Mon Sep 17 00:00:00 2001 From: Linus Kendall Date: Wed, 21 Dec 2022 17:02:43 +0530 Subject: [PATCH] Return transaction signature on succesfull forwarding (#16) --- server/rpc_server.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/rpc_server.rs b/server/rpc_server.rs index 5ee0159..7b4d7b6 100644 --- a/server/rpc_server.rs +++ b/server/rpc_server.rs @@ -37,7 +37,7 @@ pub trait Rpc { meta: Self::Metadata, data: String, config: Option, - ) -> BoxFuture>; + ) -> BoxFuture>; #[rpc(name = "getHealth")] fn get_health(&self) -> Result<()>; @@ -53,7 +53,7 @@ impl Rpc for RpcServer { meta: Self::Metadata, data: String, _config: Option, - ) -> BoxFuture> { + ) -> BoxFuture> { let auth = match meta.auth { Ok(auth) => auth, Err(err) => { @@ -118,7 +118,7 @@ impl Rpc for RpcServer { .publish(signature.to_string(), data) .await { - Ok(_) => Ok(()), + Ok(_) => Ok(signature.to_string()), Err(_) => Err(jsonrpc_core::error::Error { code: jsonrpc_core::error::ErrorCode::InternalError, message: "Failed to forward the transaction".into(),