@@ -45,11 +45,11 @@ pub fn process_set_authority(accounts: &[AccountInfo], instruction_data: &[u8])
45
45
return Err ( TokenError :: AccountFrozen . into ( ) ) ;
46
46
}
47
47
48
- match args . authority_type ( ) ? {
48
+ match authority_type {
49
49
AuthorityType :: AccountOwner => {
50
50
validate_owner ( & account. owner , authority_info, remaining) ?;
51
51
52
- if let Some ( authority) = args . new_authority ( ) {
52
+ if let Some ( authority) = new_authority {
53
53
account. owner = * authority;
54
54
} else {
55
55
return Err ( TokenError :: InvalidInstruction . into ( ) ) ;
@@ -66,7 +66,7 @@ pub fn process_set_authority(accounts: &[AccountInfo], instruction_data: &[u8])
66
66
let authority = account. close_authority ( ) . unwrap_or ( & account. owner ) ;
67
67
validate_owner ( authority, authority_info, remaining) ?;
68
68
69
- if let Some ( authority) = args . new_authority ( ) {
69
+ if let Some ( authority) = new_authority {
70
70
account. set_close_authority ( authority) ;
71
71
} else {
72
72
account. clear_close_authority ( ) ;
@@ -81,15 +81,15 @@ pub fn process_set_authority(accounts: &[AccountInfo], instruction_data: &[u8])
81
81
// `load_mut` validates that the mint is initialized.
82
82
let mint = unsafe { load_mut :: < Mint > ( account_info. borrow_mut_data_unchecked ( ) ) ? } ;
83
83
84
- match args . authority_type ( ) ? {
84
+ match authority_type {
85
85
AuthorityType :: MintTokens => {
86
86
// Once a mint's supply is fixed, it cannot be undone by setting a new
87
87
// mint_authority.
88
88
let mint_authority = mint. mint_authority ( ) . ok_or ( TokenError :: FixedSupply ) ?;
89
89
90
90
validate_owner ( mint_authority, authority_info, remaining) ?;
91
91
92
- if let Some ( authority) = args . new_authority ( ) {
92
+ if let Some ( authority) = new_authority {
93
93
mint. set_mint_authority ( authority) ;
94
94
} else {
95
95
mint. clear_mint_authority ( ) ;
@@ -104,7 +104,7 @@ pub fn process_set_authority(accounts: &[AccountInfo], instruction_data: &[u8])
104
104
105
105
validate_owner ( freeze_authority, authority_info, remaining) ?;
106
106
107
- if let Some ( authority) = args . new_authority ( ) {
107
+ if let Some ( authority) = new_authority {
108
108
mint. set_freeze_authority ( authority) ;
109
109
} else {
110
110
mint. clear_freeze_authority ( ) ;
0 commit comments