Skip to content

Commit

Permalink
check if identity is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnReedV committed Aug 15, 2024
1 parent f373434 commit 7425602
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pallets/subtensor/src/coinbase/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -973,8 +973,13 @@ impl<T: Config> Pallet<T> {
Self::init_new_network(netuid_to_register, 360);
log::debug!("init_new_network: {:?}", netuid_to_register,);

// --- 7. Remove the identity if it exists
// --- 7. Remove the identity if it exists
if let Some(identity_value) = identity {
ensure!(
Self::is_valid_subnet_identity(&identity_value),
Error::<T>::InvalidIdentity
);

SubnetIdentities::<T>::insert(netuid_to_register, identity_value);
Self::deposit_event(Event::SubnetIdentitySet(netuid_to_register));
}
Expand Down

0 comments on commit 7425602

Please sign in to comment.