Skip to content
Snippets Groups Projects
Commit 6dc639c7 authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

merge signature error types

parent 54a89f80
No related branches found
No related tags found
No related merge requests found
Pipeline #34044 waiting for manual action
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment