sc-rpc-api: Remove unused error variants (#11012)

This commit is contained in:
Bastian Köcher
2022-03-17 12:16:56 +01:00
committed by GitHub
parent 96cf135586
commit be45d83aa2
@@ -43,15 +43,9 @@ pub enum Error {
/// Incorrect extrinsic format.
#[error("Invalid extrinsic format: {}", .0)]
BadFormat(#[from] codec::Error),
/// Incorrect seed phrase.
#[error("Invalid seed phrase/SURI")]
BadSeedPhrase,
/// Key type ID has an unknown format.
#[error("Invalid key type ID format (should be of length four)")]
BadKeyType,
/// Key type ID has some unsupported crypto.
#[error("The crypto of key type ID is unknown")]
UnsupportedKeyType,
/// Some random issue with the key store. Shouldn't happen.
#[error("The key store is unavailable")]
KeyStoreUnavailable,
@@ -84,8 +78,6 @@ const POOL_TOO_LOW_PRIORITY: i64 = POOL_INVALID_TX + 4;
const POOL_CYCLE_DETECTED: i64 = POOL_INVALID_TX + 5;
/// The transaction was not included to the pool because of the limits.
const POOL_IMMEDIATELY_DROPPED: i64 = POOL_INVALID_TX + 6;
/// The key type crypto is not known.
const UNSUPPORTED_KEY_TYPE: i64 = POOL_INVALID_TX + 7;
/// The transaction was not included to the pool since it is unactionable,
/// it is not propagable and the local node does not author blocks.
const POOL_UNACTIONABLE: i64 = POOL_INVALID_TX + 8;
@@ -156,14 +148,6 @@ impl From<Error> for rpc::Error {
the local node does not author blocks".into(),
),
},
Error::UnsupportedKeyType => rpc::Error {
code: rpc::ErrorCode::ServerError(UNSUPPORTED_KEY_TYPE),
message: "Unknown key type crypto" .into(),
data: Some(
"The crypto for the given key type is unknown, please add the public key to the \
request to insert the key successfully.".into()
),
},
Error::UnsafeRpcCalled(e) => e.into(),
e => errors::internal(e),
}