File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
tokens/token-2022/cpi-guard/steel/program/tests Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,10 @@ use solana_sdk::{
5
5
transaction:: Transaction ,
6
6
} ;
7
7
use spl_token_2022:: {
8
- extension:: { cpi_guard:: instruction:: enable_cpi_guard, ExtensionType } ,
8
+ extension:: {
9
+ cpi_guard:: instruction:: { disable_cpi_guard, enable_cpi_guard} ,
10
+ ExtensionType ,
11
+ } ,
9
12
instruction:: { initialize_account3, initialize_mint2} ,
10
13
state:: { Account , Mint } ,
11
14
} ;
@@ -108,4 +111,23 @@ async fn run_test() {
108
111
"Expected TokenError::CpiGuardBurnBlocked(43) , got: {}" ,
109
112
err_string
110
113
) ;
114
+
115
+ //Disable CPI Guard and try burn again, should pass
116
+ let disable_cpi_ix = disable_cpi_guard (
117
+ & spl_token_2022:: ID ,
118
+ & token_acc. pubkey ( ) ,
119
+ & payer. pubkey ( ) ,
120
+ & [ ] ,
121
+ )
122
+ . unwrap ( ) ;
123
+ let cpi_burn_ix = cpi_burn ( payer. pubkey ( ) , mint. pubkey ( ) , token_acc. pubkey ( ) ) ;
124
+
125
+ let tx = Transaction :: new_signed_with_payer (
126
+ & [ disable_cpi_ix, cpi_burn_ix] ,
127
+ Some ( & payer. pubkey ( ) ) ,
128
+ & [ & payer] ,
129
+ blockhash,
130
+ ) ;
131
+ let res = banks. process_transaction ( tx) . await ;
132
+ assert ! ( res. is_ok( ) ) ;
111
133
}
You can’t perform that action at this time.
0 commit comments