Skip to content

Commit

Permalink
Return transaction signature on succesfull forwarding (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
linuskendall authored Dec 21, 2022
1 parent 376f0a4 commit 6947c58
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/rpc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub trait Rpc {
meta: Self::Metadata,
data: String,
config: Option<SendPriorityTransactionConfig>,
) -> BoxFuture<Result<()>>;
) -> BoxFuture<Result<String>>;

#[rpc(name = "getHealth")]
fn get_health(&self) -> Result<()>;
Expand All @@ -53,7 +53,7 @@ impl Rpc for RpcServer {
meta: Self::Metadata,
data: String,
_config: Option<SendPriorityTransactionConfig>,
) -> BoxFuture<Result<()>> {
) -> BoxFuture<Result<String>> {
let auth = match meta.auth {
Ok(auth) => auth,
Err(err) => {
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit 6947c58

Please sign in to comment.