Skip to content

Commit

Permalink
change(fc-pallet-pass): fail register early if the account is alrea…
Browse files Browse the repository at this point in the history
…dy registered.
  • Loading branch information
pandres95 committed Oct 2, 2024
1 parent 569c67c commit 4a750c3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pallets/pass/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ pub mod pallet {
) -> DispatchResult {
T::RegisterOrigin::ensure_origin(origin, &user)?;
let account_id = Self::account_id_for(user)?;
// ensure!(
// Self::account_exists(&account_id),
// Error::<T, I>::AccountAlreadyRegistered
// );
ensure!(
!Self::account_exists(&account_id),
Error::<T, I>::AccountAlreadyRegistered
);

Self::create_account(&account_id)?;
Self::deposit_event(Event::<T, I>::Registered {
Expand Down

0 comments on commit 4a750c3

Please sign in to comment.