I have a sign_up
function :
pub fn sign_up(ctx: Context<SignUp> , user_name: String , phone: String , email: String) -> Result<()> {// Code is here }
and one of the arguments is user_name
and i need to check the user_name
that has been sent to be unique among all accounts that is being created with this function and that requires me to look at other users user_name
as check whether the user_name
is taken or not ? and other usernames are in the data accounts of other users .
Note : I have also other arguments i need to check out the validation.
What do you guys suggest me to do ?
I don't know if PDA will work for this .