Hi i have a UserAccount which is used to hold the data of the user and is created with a instruction called sign_up , and also i have a setup_game instruction and in there I want to check that is there a user registered with the given Pubkey. In TS tests to do that i use :
const account = await program.account.userAccount.fetch(
secondUser.publicKey
);
So this gives the user_account of that Pubkey . And my Rust code so far :
pub fn setup_game(ctx: Context<SetupGame>, player_two: Pubkey) -> Result<()> {
ctx.accounts
.game
.start([ctx.accounts.player_one.key(), player_two])
}
account
belongs to a registered user?