@@ -32,46 +32,37 @@ pub struct CreateGuard {
3232}
3333
3434impl CreateGuard {
35- pub fn instruction (
36- & self ,
37- args : CreateGuardInstructionArgs ,
38- ) -> solana_program:: instruction:: Instruction {
35+ pub fn instruction ( & self , args : CreateGuardInstructionArgs ) -> solana_instruction:: Instruction {
3936 self . instruction_with_remaining_accounts ( args, & [ ] )
4037 }
4138 #[ allow( clippy:: arithmetic_side_effects) ]
4239 #[ allow( clippy:: vec_init_then_push) ]
4340 pub fn instruction_with_remaining_accounts (
4441 & self ,
4542 args : CreateGuardInstructionArgs ,
46- remaining_accounts : & [ solana_program :: instruction :: AccountMeta ] ,
47- ) -> solana_program :: instruction :: Instruction {
43+ remaining_accounts : & [ solana_instruction :: AccountMeta ] ,
44+ ) -> solana_instruction :: Instruction {
4845 let mut accounts = Vec :: with_capacity ( 8 + remaining_accounts. len ( ) ) ;
49- accounts. push ( solana_program:: instruction:: AccountMeta :: new (
50- self . guard , false ,
51- ) ) ;
52- accounts. push ( solana_program:: instruction:: AccountMeta :: new (
53- self . mint , true ,
54- ) ) ;
55- accounts. push ( solana_program:: instruction:: AccountMeta :: new (
46+ accounts. push ( solana_instruction:: AccountMeta :: new ( self . guard , false ) ) ;
47+ accounts. push ( solana_instruction:: AccountMeta :: new ( self . mint , true ) ) ;
48+ accounts. push ( solana_instruction:: AccountMeta :: new (
5649 self . mint_token_account ,
5750 false ,
5851 ) ) ;
59- accounts. push ( solana_program :: instruction :: AccountMeta :: new_readonly (
52+ accounts. push ( solana_instruction :: AccountMeta :: new_readonly (
6053 self . guard_authority ,
6154 true ,
6255 ) ) ;
63- accounts. push ( solana_program:: instruction:: AccountMeta :: new (
64- self . payer , true ,
65- ) ) ;
66- accounts. push ( solana_program:: instruction:: AccountMeta :: new_readonly (
56+ accounts. push ( solana_instruction:: AccountMeta :: new ( self . payer , true ) ) ;
57+ accounts. push ( solana_instruction:: AccountMeta :: new_readonly (
6758 self . associated_token_program ,
6859 false ,
6960 ) ) ;
70- accounts. push ( solana_program :: instruction :: AccountMeta :: new_readonly (
61+ accounts. push ( solana_instruction :: AccountMeta :: new_readonly (
7162 self . token_program ,
7263 false ,
7364 ) ) ;
74- accounts. push ( solana_program :: instruction :: AccountMeta :: new_readonly (
65+ accounts. push ( solana_instruction :: AccountMeta :: new_readonly (
7566 self . system_program ,
7667 false ,
7768 ) ) ;
@@ -80,7 +71,7 @@ impl CreateGuard {
8071 let mut args = borsh:: to_vec ( & args) . unwrap ( ) ;
8172 data. append ( & mut args) ;
8273
83- solana_program :: instruction :: Instruction {
74+ solana_instruction :: Instruction {
8475 program_id : crate :: WEN_TRANSFER_GUARD_ID ,
8576 accounts,
8677 data,
@@ -147,7 +138,7 @@ pub struct CreateGuardBuilder {
147138 cpi_rule : Option < CpiRule > ,
148139 transfer_amount_rule : Option < TransferAmountRule > ,
149140 additional_fields_rule : Option < Vec < MetadataAdditionalFieldRule > > ,
150- __remaining_accounts : Vec < solana_program :: instruction :: AccountMeta > ,
141+ __remaining_accounts : Vec < solana_instruction :: AccountMeta > ,
151142}
152143
153144impl CreateGuardBuilder {
@@ -237,24 +228,21 @@ impl CreateGuardBuilder {
237228 }
238229 /// Add an additional account to the instruction.
239230 #[ inline( always) ]
240- pub fn add_remaining_account (
241- & mut self ,
242- account : solana_program:: instruction:: AccountMeta ,
243- ) -> & mut Self {
231+ pub fn add_remaining_account ( & mut self , account : solana_instruction:: AccountMeta ) -> & mut Self {
244232 self . __remaining_accounts . push ( account) ;
245233 self
246234 }
247235 /// Add additional accounts to the instruction.
248236 #[ inline( always) ]
249237 pub fn add_remaining_accounts (
250238 & mut self ,
251- accounts : & [ solana_program :: instruction :: AccountMeta ] ,
239+ accounts : & [ solana_instruction :: AccountMeta ] ,
252240 ) -> & mut Self {
253241 self . __remaining_accounts . extend_from_slice ( accounts) ;
254242 self
255243 }
256244 #[ allow( clippy:: clone_on_copy) ]
257- pub fn instruction ( & self ) -> solana_program :: instruction :: Instruction {
245+ pub fn instruction ( & self ) -> solana_instruction :: Instruction {
258246 let accounts = CreateGuard {
259247 guard : self . guard . expect ( "guard is not set" ) ,
260248 mint : self . mint . expect ( "mint is not set" ) ,
@@ -386,40 +374,31 @@ impl<'a, 'b> CreateGuardCpi<'a, 'b> {
386374 ) ] ,
387375 ) -> solana_program:: entrypoint:: ProgramResult {
388376 let mut accounts = Vec :: with_capacity ( 8 + remaining_accounts. len ( ) ) ;
389- accounts. push ( solana_program:: instruction:: AccountMeta :: new (
390- * self . guard . key ,
391- false ,
392- ) ) ;
393- accounts. push ( solana_program:: instruction:: AccountMeta :: new (
394- * self . mint . key ,
395- true ,
396- ) ) ;
397- accounts. push ( solana_program:: instruction:: AccountMeta :: new (
377+ accounts. push ( solana_instruction:: AccountMeta :: new ( * self . guard . key , false ) ) ;
378+ accounts. push ( solana_instruction:: AccountMeta :: new ( * self . mint . key , true ) ) ;
379+ accounts. push ( solana_instruction:: AccountMeta :: new (
398380 * self . mint_token_account . key ,
399381 false ,
400382 ) ) ;
401- accounts. push ( solana_program :: instruction :: AccountMeta :: new_readonly (
383+ accounts. push ( solana_instruction :: AccountMeta :: new_readonly (
402384 * self . guard_authority . key ,
403385 true ,
404386 ) ) ;
405- accounts. push ( solana_program:: instruction:: AccountMeta :: new (
406- * self . payer . key ,
407- true ,
408- ) ) ;
409- accounts. push ( solana_program:: instruction:: AccountMeta :: new_readonly (
387+ accounts. push ( solana_instruction:: AccountMeta :: new ( * self . payer . key , true ) ) ;
388+ accounts. push ( solana_instruction:: AccountMeta :: new_readonly (
410389 * self . associated_token_program . key ,
411390 false ,
412391 ) ) ;
413- accounts. push ( solana_program :: instruction :: AccountMeta :: new_readonly (
392+ accounts. push ( solana_instruction :: AccountMeta :: new_readonly (
414393 * self . token_program . key ,
415394 false ,
416395 ) ) ;
417- accounts. push ( solana_program :: instruction :: AccountMeta :: new_readonly (
396+ accounts. push ( solana_instruction :: AccountMeta :: new_readonly (
418397 * self . system_program . key ,
419398 false ,
420399 ) ) ;
421400 remaining_accounts. iter ( ) . for_each ( |remaining_account| {
422- accounts. push ( solana_program :: instruction :: AccountMeta {
401+ accounts. push ( solana_instruction :: AccountMeta {
423402 pubkey : * remaining_account. 0 . key ,
424403 is_signer : remaining_account. 1 ,
425404 is_writable : remaining_account. 2 ,
@@ -429,7 +408,7 @@ impl<'a, 'b> CreateGuardCpi<'a, 'b> {
429408 let mut args = borsh:: to_vec ( & self . __args ) . unwrap ( ) ;
430409 data. append ( & mut args) ;
431410
432- let instruction = solana_program :: instruction :: Instruction {
411+ let instruction = solana_instruction :: Instruction {
433412 program_id : crate :: WEN_TRANSFER_GUARD_ID ,
434413 accounts,
435414 data,
0 commit comments