mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-13 15:09:57 +00:00
failed admin test
This commit is contained in:
@@ -23,7 +23,7 @@ pub fn process_update_admin<'a, 'info>(
|
||||
// Validate admin signer
|
||||
let mut treasury_data = treasury_info.data.borrow_mut();
|
||||
let mut treasury = Treasury::try_from_bytes_mut(&mut treasury_data)?;
|
||||
if !treasury.admin.eq(&signer.key) {
|
||||
if treasury.admin.ne(&signer.key) {
|
||||
return Err(ProgramError::MissingRequiredSignature);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ pub fn process_update_difficulty<'a, 'info>(
|
||||
// Validate admin signer
|
||||
let mut treasury_data = treasury_info.data.borrow_mut();
|
||||
let mut treasury = Treasury::try_from_bytes_mut(&mut treasury_data)?;
|
||||
if !treasury.admin.eq(&signer.key) {
|
||||
if treasury.admin.ne(&signer.key) {
|
||||
return Err(ProgramError::MissingRequiredSignature);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,12 @@ async fn test_update_admin() {
|
||||
treasury_.total_claimed_rewards,
|
||||
treasury.total_claimed_rewards
|
||||
);
|
||||
|
||||
// Submit another update admin ix
|
||||
let ix = ore::instruction::update_admin(payer.pubkey(), payer.pubkey());
|
||||
let tx = Transaction::new_signed_with_payer(&[ix], Some(&payer.pubkey()), &[&payer], blockhash);
|
||||
let res = banks.process_transaction(tx).await;
|
||||
assert!(res.is_err());
|
||||
}
|
||||
|
||||
async fn setup_program_test_env() -> (BanksClient, Keypair, Hash) {
|
||||
|
||||
Reference in New Issue
Block a user