From 9778fedd7a923b79f66c393fa04b68c06f37c707 Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Wed, 29 Jul 2020 20:06:16 -0600 Subject: [PATCH] Add new RPC error for TXs with no signatures --- core/src/rpc_error.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/src/rpc_error.rs b/core/src/rpc_error.rs index 9125b65c7f..e452c2d985 100644 --- a/core/src/rpc_error.rs +++ b/core/src/rpc_error.rs @@ -3,6 +3,7 @@ use solana_sdk::clock::Slot; const JSON_RPC_SERVER_ERROR_1: i64 = -32001; const JSON_RPC_SERVER_ERROR_2: i64 = -32002; +const JSON_RPC_SERVER_ERROR_3: i64 = -32003; pub enum RpcCustomError { BlockCleanedUp { @@ -12,6 +13,7 @@ pub enum RpcCustomError { SendTransactionPreflightFailure { message: String, }, + SendTransactionIsNotSigned, } impl From for Error { @@ -33,6 +35,11 @@ impl From for Error { message, data: None, }, + RpcCustomError::SendTransactionIsNotSigned => Self { + code: ErrorCode::ServerError(JSON_RPC_SERVER_ERROR_3), + message: "Transaction is not signed".to_string(), + data: None, + }, } } }