improve error message clarity
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
parent
098ea0e75b
commit
707e0a9c0d
9
Cargo.lock
generated
9
Cargo.lock
generated
@ -1195,7 +1195,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "casper-runtime"
|
||||
version = "4.0.11"
|
||||
version = "4.0.14"
|
||||
dependencies = [
|
||||
"casper-runtime-constants",
|
||||
"frame-benchmarking",
|
||||
@ -3684,7 +3684,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ghost-exodus"
|
||||
version = "0.0.11"
|
||||
version = "0.0.17"
|
||||
dependencies = [
|
||||
"chacha20poly1305",
|
||||
"frame-benchmarking",
|
||||
@ -3733,7 +3733,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ghost-governance"
|
||||
version = "0.3.7"
|
||||
version = "0.3.10"
|
||||
dependencies = [
|
||||
"frame-benchmarking",
|
||||
"frame-support",
|
||||
@ -3743,6 +3743,7 @@ dependencies = [
|
||||
"ghost-traits",
|
||||
"hex-literal",
|
||||
"libsecp256k1",
|
||||
"num-traits",
|
||||
"pallet-balances",
|
||||
"parity-scale-codec",
|
||||
"rustc-hex",
|
||||
@ -4109,7 +4110,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ghost-weaver"
|
||||
version = "0.0.10"
|
||||
version = "0.0.14"
|
||||
dependencies = [
|
||||
"frame-benchmarking",
|
||||
"frame-support",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "ghost-exodus"
|
||||
version = "0.0.16"
|
||||
version = "0.0.17"
|
||||
description = "Threshold signature generation with DKG included"
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
|
||||
@ -49,45 +49,45 @@ pub enum ExodusError {
|
||||
impl core::fmt::Debug for ExodusError {
|
||||
fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
|
||||
match *self {
|
||||
ExodusError::InvalidParticipantId => write!(fmt, "Participant index could not be parsed to identifier."),
|
||||
ExodusError::DeserializationError => write!(fmt, "Error during deserializing value."),
|
||||
ExodusError::SerializationError => write!(fmt, "Error serializing value."),
|
||||
ExodusError::InvalidParticipantId => write!(fmt, "Participant index could not be parsed as an identifier."),
|
||||
ExodusError::DeserializationError => write!(fmt, "Error while deserializing value."),
|
||||
ExodusError::SerializationError => write!(fmt, "Error while serializing value."),
|
||||
ExodusError::InvalidMinSigners(min, max) => write!(fmt, "Number of min_signers ({min}) must be at least 2 and not larger than max_signers ({max})."),
|
||||
ExodusError::InvalidMaxSigners(max_signers) => write!(fmt, "Number of max_signers must be at least 2, {max_signers} given."),
|
||||
ExodusError::DKGNotSupported(ref curve) => write!(fmt, "The ciphersuite {curve:?} does not support DKG."),
|
||||
ExodusError::IncorrectNumberOfCoefficients => write!(fmt, "Incorrect number of coefficients; should be equal to min signers."),
|
||||
ExodusError::IncorrectNumberOfCommitments => write!(fmt, "Incorrect number of commitments; should be equal to min signers."),
|
||||
ExodusError::InvalidNonceCommitments => write!(fmt, "Hiding nonce commitments indexes should match binding nonce commitments."),
|
||||
ExodusError::InvalidProofOfKnowledge => write!(fmt, "The proof of knowledge is not valid."),
|
||||
ExodusError::InvalidNonceCommitments => write!(fmt, "Hiding nonce commitment indices should match binding nonce commitments."),
|
||||
ExodusError::InvalidProofOfKnowledge => write!(fmt, "Invalid proof of knowledge."),
|
||||
ExodusError::IncorrectNumberOfPackages => write!(fmt, "Incorrect number of packages; should be equal to max signers."),
|
||||
ExodusError::IncorrectPackage => write!(fmt, "The incorrect package was specified."),
|
||||
ExodusError::IncorrectPackage => write!(fmt, "An incorrect package was specified."),
|
||||
ExodusError::PackageNotFound => write!(fmt, "Round 1 package not found for Round 2 participant."),
|
||||
ExodusError::InvalidSecretShare => write!(fmt, "Invalid secret share."),
|
||||
ExodusError::MissingCommitment => write!(fmt, "The Signing Package must contain the participant's Commitments."),
|
||||
ExodusError::MissingCommitment => write!(fmt, "The signing package must contain the participant's Commitments."),
|
||||
ExodusError::IncorrectCommitment => write!(fmt, "The participant's commitment is incorrect."),
|
||||
ExodusError::UnknownIdentifier => write!(fmt, "Unknown identifier."),
|
||||
ExodusError::UnknownIdentifier => write!(fmt, "Unknown identifier provided."),
|
||||
ExodusError::IdentityCommitment => write!(fmt, "Commitment equals the identity."),
|
||||
ExodusError::DuplicatedIdentifier => write!(fmt, "Duplicated identifier."),
|
||||
ExodusError::IncorrectNumberOfIdentifiers => write!(fmt, "Incorrect number of identifiers."),
|
||||
ExodusError::InvalidSignature => write!(fmt, "Invalid signature."),
|
||||
ExodusError::InvalidSignatureShare => write!(fmt, "Invalid signature share."),
|
||||
ExodusError::InvalidSignature => write!(fmt, "Invalid signature provided."),
|
||||
ExodusError::InvalidSignatureShare => write!(fmt, "Invalid signature share provided."),
|
||||
ExodusError::EncryptionFailed => write!(fmt, "Encryption failed."),
|
||||
ExodusError::DecryptionFailed => write!(fmt, "Decryption failed."),
|
||||
ExodusError::HKDFFailed => write!(fmt, "HKDF failed."),
|
||||
ExodusError::InvalidNonceLength => write!(fmt, "Encryption nonce has invalid length."),
|
||||
ExodusError::MalformedSigningKey => write!(fmt, "Malformed signing key encoding."),
|
||||
ExodusError::NoStoredNetworks => write!(fmt, "No stored networks to be worked on."),
|
||||
ExodusError::NoStoredNetworks => write!(fmt, "No stored networks to work on."),
|
||||
ExodusError::OffchainTimeoutPeriod => write!(fmt, "Offchain request should be in-flight."),
|
||||
ExodusError::BadSignature(auth_index) => write!(fmt, "Signature could not be created from {auth_index}."),
|
||||
ExodusError::TransactionSubmissionFailed(auth_index) => write!(fmt, "Could not submit transaction from {auth_index}."),
|
||||
ExodusError::UnknownReceiverIndex(receiver_index) => write!(fmt, "Unknown receiver index {receiver_index} found."),
|
||||
ExodusError::CouldNotConstructMessage(auth_index) => write!(fmt, "Could not construct message during OCW from {auth_index}."),
|
||||
ExodusError::NothingToWrite => write!(fmt, "Nothing to write into local storage."),
|
||||
ExodusError::NothingToWrite => write!(fmt, "Nothing to write to local storage."),
|
||||
ExodusError::UnknownPrefix => write!(fmt, "Unknown prefix used for local storage."),
|
||||
ExodusError::UnexpectedRound => write!(fmt, "Unexpected round provided."),
|
||||
ExodusError::InvalidMerkleProof => write!(fmt, "Invalid merkle proof provided."),
|
||||
ExodusError::InvalidMerkleProof => write!(fmt, "Invalid Merkle proof provided."),
|
||||
ExodusError::InvalidIdentityElement => write!(fmt, "Invalid identity element provided."),
|
||||
ExodusError::NoActiveAuthorities => write!(fmt, "No active authorities for signing exodus transactions."),
|
||||
ExodusError::NoActiveAuthorities => write!(fmt, "No active authorities for signing EXODUS transactions."),
|
||||
ExodusError::Unknown => write!(fmt, "Unknown error."),
|
||||
}
|
||||
}
|
||||
|
||||
@ -1972,7 +1972,7 @@ pub mod pallet {
|
||||
|
||||
},
|
||||
Err(err) => {
|
||||
log::error!(target: PALLET_LOG_TARGET, "🗺️ Exodus skipped or failed initialization at {:?}: {:?}", current_block, err);
|
||||
log::error!(target: PALLET_LOG_TARGET, "🗺️ Exodus skipped at {:?}: {:?}", current_block, err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "ghost-weaver"
|
||||
version = "0.0.13"
|
||||
version = "0.0.14"
|
||||
description = "Weaving a secure cryptographic tapestry across different external chains."
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
|
||||
@ -14,7 +14,7 @@ pub enum WeavingError<NetworkId> {
|
||||
impl<NetworkId: core::fmt::Debug> core::fmt::Debug for WeavingError<NetworkId> {
|
||||
fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
|
||||
match self {
|
||||
Self::NoStoredNetworks => write!(fmt, "No stored networks to be watch on."),
|
||||
Self::NoStoredNetworks => write!(fmt, "No stored networks to work on."),
|
||||
Self::UnparsableRequestBody => {
|
||||
write!(fmt, "HTTP request body contains invalid UTF-8 sequences.")
|
||||
}
|
||||
@ -22,25 +22,25 @@ impl<NetworkId: core::fmt::Debug> core::fmt::Debug for WeavingError<NetworkId> {
|
||||
write!(fmt, "The request deadline or network timeout was hit.")
|
||||
}
|
||||
Self::UnknownWeavingPhase(network_id) => {
|
||||
write!(fmt, "Unknown weaving phase for network: {:?}.", network_id)
|
||||
write!(fmt, "Unknown weaving phase for network #{:?}.", network_id)
|
||||
}
|
||||
Self::OffchainLockPeriod(network_id) => write!(
|
||||
fmt,
|
||||
"Storage lock is still held for network: {:?}.",
|
||||
"Storage lock is still held for network #{:?}.",
|
||||
network_id
|
||||
),
|
||||
Self::NoEndpointsAvailable(network_id) => write!(
|
||||
fmt,
|
||||
"Zero RPC URLs configured for network: {:?}.",
|
||||
"No RPC URLs configured for network #{:?}.",
|
||||
network_id
|
||||
),
|
||||
Self::ContradictoryHashes(network_id) => write!(
|
||||
fmt,
|
||||
"Divergence among reported hashes for network: {:?}.",
|
||||
"Divergence among reported hashes for network #{:?}.",
|
||||
network_id
|
||||
),
|
||||
Self::ContradictoryBlocks(len, deviation, network_id) => {
|
||||
write!(fmt, "Divergence among {len} reported blocks exceeds the maximum threshold of {deviation} provided for network: {:?}.", network_id)
|
||||
write!(fmt, "Divergence among {len} reported blocks exceeds the maximum allowed deviation of {deviation} for network #{:?}.", network_id)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -73,7 +73,7 @@ impl core::fmt::Debug for RpcResolverError {
|
||||
"The 'result' field in the JSON-RPC response is missing or null."
|
||||
),
|
||||
Self::UnknownNetworkType => {
|
||||
write!(fmt, "he provided network type identifier is not supported.")
|
||||
write!(fmt, "The provided network type identifier is not supported.")
|
||||
}
|
||||
Self::RpcProtocolError => write!(
|
||||
fmt,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user