diff --git a/crates/client/src/client.rs b/crates/client/src/client.rs index 89c49514b..bf2a36ebb 100644 --- a/crates/client/src/client.rs +++ b/crates/client/src/client.rs @@ -116,6 +116,9 @@ pub async fn sign( let message_hash = Hasher::keccak(&message); let validators_info = get_validators_not_signer_for_relay(api, rpc).await?; + if validators_info.is_empty() { + return Err(ClientError::NoNonSigningValidators); + } tracing::debug!("Validators info {:?}", validators_info); let block_number = rpc.chain_get_header(None).await?.ok_or(ClientError::BlockNumber)?.number; diff --git a/crates/client/src/errors.rs b/crates/client/src/errors.rs index 163059b11..24705ae55 100644 --- a/crates/client/src/errors.rs +++ b/crates/client/src/errors.rs @@ -96,8 +96,6 @@ pub enum ClientError { TryFromSlice(#[from] std::array::TryFromSliceError), #[error("User is not registered on-chain")] NotRegistered, - #[error("No synced validators")] - NoSyncedValidators, #[error("Cannot confirm program was created")] CannotConfirmProgramCreated, #[error("Cannot confirm program was removed")] @@ -108,4 +106,6 @@ pub enum ClientError { CannotQuerySynced, #[error("Verifying key has incorrect length")] BadVerifyingKeyLength, + #[error("There are no validators which can act as a relay node for signature requests")] + NoNonSigningValidators, }