Skip to content

Commit 5bc72d5

Browse files
committed
fix tests
1 parent 6f6af0c commit 5bc72d5

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

program-libs/account-checks/tests/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ fn test_check_account_info_mut() {
170170
set_discriminator::<TestStruct>(&mut account.data).unwrap();
171171
assert_eq!(
172172
check_account_info_mut::<TestStruct, _>(&owner.to_bytes(), &account.get_account_info()),
173-
Err(AccountError::AccountMutable)
173+
Err(AccountError::AccountNotMutable)
174174
);
175175
}
176176

@@ -193,7 +193,7 @@ fn test_check_account_info_mut() {
193193
account_info_init::<TestStruct, _>(&account).unwrap();
194194
assert_eq!(
195195
check_account_info_mut::<TestStruct, _>(&owner, &account),
196-
Err(AccountError::AccountMutable)
196+
Err(AccountError::AccountNotMutable)
197197
);
198198
}
199199
}

programs/system/src/invoke/instruction.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use light_account_checks::checks::check_signer;
12
use pinocchio::{account_info::AccountInfo, program_error::ProgramError};
23

34
use crate::{
@@ -46,7 +47,8 @@ impl<'info> InvokeInstruction<'info> {
4647
let fee_payer = check_fee_payer(accounts.next())?;
4748

4849
// Fee payer and authority can be the same account in case of invoke.
49-
let authority = check_fee_payer(accounts.next())?;
50+
let authority = accounts.next().ok_or(ProgramError::NotEnoughAccountKeys)?;
51+
check_signer(authority).map_err(ProgramError::from)?;
5052

5153
let registered_program_pda = check_non_mut_account_info(accounts.next())?;
5254

0 commit comments

Comments
 (0)