Add new RPC error for TXs with no signatures
This commit is contained in:
committed by
Trent Nelson
parent
a7079e4dde
commit
9778fedd7a
@ -3,6 +3,7 @@ use solana_sdk::clock::Slot;
|
|||||||
|
|
||||||
const JSON_RPC_SERVER_ERROR_1: i64 = -32001;
|
const JSON_RPC_SERVER_ERROR_1: i64 = -32001;
|
||||||
const JSON_RPC_SERVER_ERROR_2: i64 = -32002;
|
const JSON_RPC_SERVER_ERROR_2: i64 = -32002;
|
||||||
|
const JSON_RPC_SERVER_ERROR_3: i64 = -32003;
|
||||||
|
|
||||||
pub enum RpcCustomError {
|
pub enum RpcCustomError {
|
||||||
BlockCleanedUp {
|
BlockCleanedUp {
|
||||||
@ -12,6 +13,7 @@ pub enum RpcCustomError {
|
|||||||
SendTransactionPreflightFailure {
|
SendTransactionPreflightFailure {
|
||||||
message: String,
|
message: String,
|
||||||
},
|
},
|
||||||
|
SendTransactionIsNotSigned,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<RpcCustomError> for Error {
|
impl From<RpcCustomError> for Error {
|
||||||
@ -33,6 +35,11 @@ impl From<RpcCustomError> for Error {
|
|||||||
message,
|
message,
|
||||||
data: None,
|
data: None,
|
||||||
},
|
},
|
||||||
|
RpcCustomError::SendTransactionIsNotSigned => Self {
|
||||||
|
code: ErrorCode::ServerError(JSON_RPC_SERVER_ERROR_3),
|
||||||
|
message: "Transaction is not signed".to_string(),
|
||||||
|
data: None,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user