File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -20,16 +20,20 @@ use {
20
20
account_info:: AccountInfo ,
21
21
program:: invoke_signed,
22
22
program_error:: ProgramError ,
23
- program_memory:: sol_memset,
24
23
pubkey:: Pubkey ,
25
24
system_instruction:: create_account,
26
25
} ,
27
26
std:: {
28
- borrow:: BorrowMut ,
29
27
cell:: RefMut ,
30
28
mem:: size_of,
31
29
} ,
32
30
} ;
31
+ #[ cfg( test) ]
32
+ use {
33
+ solana_program:: program_memory:: sol_memset,
34
+ std:: borrow:: BorrowMut ,
35
+ } ;
36
+
33
37
34
38
mod mapping;
35
39
mod permission;
@@ -109,7 +113,6 @@ pub trait PythAccount: Pod {
109
113
) ?;
110
114
111
115
check_valid_fresh_account ( account) ?;
112
- clear_account ( account) ?;
113
116
114
117
{
115
118
let mut account_header = load_account_as_mut :: < AccountHeader > ( account) ?;
@@ -170,6 +173,7 @@ fn create<'a>(
170
173
}
171
174
172
175
/// Sets the data of account to all-zero
176
+ #[ cfg( test) ]
173
177
pub fn clear_account ( account : & AccountInfo ) -> Result < ( ) , ProgramError > {
174
178
let mut data = account
175
179
. try_borrow_mut_data ( )
You can’t perform that action at this time.
0 commit comments