diff --git a/pallets/identity/src/lib.rs b/pallets/identity/src/lib.rs index b636f3c7e4324faab63e94563425704db359a788..e5b5623f600ba0c1b76044cef89a61092029a197 100644 --- a/pallets/identity/src/lib.rs +++ b/pallets/identity/src/lib.rs @@ -469,7 +469,7 @@ pub mod pallet { ensure!( (NEW_OWNER_KEY_PAYLOAD_PREFIX, new_key_payload) .using_encoded(|bytes| new_key_sig.verify(bytes, &new_key)), - Error::<T>::InvalidNewOwnerKeySig + Error::<T>::InvalidSignature ); // Apply phase @@ -543,7 +543,7 @@ pub mod pallet { ensure!( (REVOCATION_PAYLOAD_PREFIX, revocation_payload) .using_encoded(|bytes| revocation_sig.verify(bytes, &revocation_key)), - Error::<T>::InvalidRevocationSig + Error::<T>::InvalidSignature ); // finally if all checks pass, remove identity @@ -630,7 +630,7 @@ pub mod pallet { ensure!( (LINK_IDTY_PAYLOAD_PREFIX, payload) .using_encoded(|bytes| payload_sig.verify(bytes, &account_id)), - Error::<T>::InvalidLinkAccountSig + Error::<T>::InvalidSignature ); // apply Self::do_link_account(account_id, idty_index); @@ -667,14 +667,10 @@ pub mod pallet { IdtyNotValidated, /// Identity not yet renewable IdtyNotYetRenewable, - /// New owner key payload signature is invalid - InvalidNewOwnerKeySig, - /// Link account payload signature is invalid - InvalidLinkAccountSig, + /// payload signature is invalid + InvalidSignature, /// Revocation key is invalid InvalidRevocationKey, - /// Revocation payload signature is invalid - InvalidRevocationSig, /// Identity creation period is not respected NotRespectIdtyCreationPeriod, /// Not the same identity name diff --git a/pallets/identity/src/tests.rs b/pallets/identity/src/tests.rs index 0ab95d51e534870788918811abe6999761480ab6..01e24905bf5a3d9be25daddd467cca94e7f0f68e 100644 --- a/pallets/identity/src/tests.rs +++ b/pallets/identity/src/tests.rs @@ -245,7 +245,7 @@ fn test_change_owner_key() { (NEW_OWNER_KEY_PAYLOAD_PREFIX, new_key_payload.clone()).encode() ) ), - Error::<Test>::InvalidNewOwnerKeySig + Error::<Test>::InvalidSignature ); // Payload must be prefixed @@ -255,7 +255,7 @@ fn test_change_owner_key() { account(10).id, test_signature(account(10).signer, new_key_payload.clone().encode()) ), - Error::<Test>::InvalidNewOwnerKeySig + Error::<Test>::InvalidSignature ); // New owner key should not be used by another identity @@ -393,7 +393,7 @@ fn test_link_account() { (LINK_IDTY_PAYLOAD_PREFIX, payload.clone()).encode() ) ), - Error::<Test>::InvalidLinkAccountSig + Error::<Test>::InvalidSignature ); // Payload must be prefixed @@ -403,7 +403,7 @@ fn test_link_account() { account(10).id, test_signature(account(10).signer, payload.clone().encode()) ), - Error::<Test>::InvalidLinkAccountSig + Error::<Test>::InvalidSignature ); // Alice can change her owner key @@ -555,7 +555,7 @@ fn test_idty_revocation() { account(1).id, test_signature(account(1).signer, revocation_payload.encode()) ), - Err(Error::<Test>::InvalidRevocationSig.into()) + Err(Error::<Test>::InvalidSignature.into()) ); // Anyone can submit a revocation payload