what is the difference between signer
constraint:
Checks the given account signed the transaction.
Custom errors are supported via @.
Consider using the Signer type if you would only have this constraint on the account.
Example:
#[account(signer)]
pub authority: AccountInfo<'info>,
#[account(signer @ MyError::MyErrorCode)]
pub payer: AccountInfo<'info>
and
pub struct AccountInfo<'a> {
pub key: &'a Pubkey,
pub is_signer: bool,
pub is_writable: bool,
pub lamports: Rc<RefCell<&'a mut u64>>,
pub data: Rc<RefCell<&'a mut [u8]>>,
pub owner: &'a Pubkey,
pub executable: bool,
pub rent_epoch: Epoch,
}
is_signer property on AccountInfo?
is_signer: bool Was the transaction signed by this account’s public key?
and then we have also Signer
type instead of AccountInfo
pub struct Signer<'info> { /* private fields */ }
Type validating that the account signed the transaction. No other ownership or type checks are done. If this is used, one should not try to access the underlying account data.