@@ -2583,7 +2583,7 @@ impl GovernanceProgramTest {
2583
2583
program_data. len ( ) ,
2584
2584
) ) ;
2585
2585
2586
- let mut instructions = bpf_loader_upgradeable:: create_buffer (
2586
+ let instructions = bpf_loader_upgradeable:: create_buffer (
2587
2587
& self . bench . payer . pubkey ( ) ,
2588
2588
& program_buffer_keypair. pubkey ( ) ,
2589
2589
& buffer_authority_keypair. pubkey ( ) ,
@@ -2592,28 +2592,33 @@ impl GovernanceProgramTest {
2592
2592
)
2593
2593
. unwrap ( ) ;
2594
2594
2595
- let chunk_size = 800 ;
2595
+ self . bench
2596
+ . process_transaction ( & instructions, Some ( & [ & program_buffer_keypair] ) )
2597
+ . await
2598
+ . unwrap ( ) ;
2596
2599
2597
- for ( chunk, i) in program_data. chunks ( chunk_size) . zip ( 0 ..) {
2598
- instructions. push ( bpf_loader_upgradeable:: write (
2600
+ const CHUNK_SIZE : usize = 800 ;
2601
+ for ( i, chunk) in program_data. chunks ( CHUNK_SIZE ) . enumerate ( ) {
2602
+ let instruction = bpf_loader_upgradeable:: write (
2599
2603
& program_buffer_keypair. pubkey ( ) ,
2600
2604
& buffer_authority_keypair. pubkey ( ) ,
2601
- ( i * chunk_size ) as u32 ,
2605
+ ( i * CHUNK_SIZE ) as u32 ,
2602
2606
chunk. to_vec ( ) ,
2603
- ) ) ;
2607
+ ) ;
2608
+ self . bench
2609
+ . process_transaction ( & [ instruction] , Some ( & [ & buffer_authority_keypair] ) )
2610
+ . await
2611
+ . unwrap ( ) ;
2604
2612
}
2605
2613
2606
- instructions . push ( bpf_loader_upgradeable:: set_buffer_authority (
2614
+ let set_authority_ixs = bpf_loader_upgradeable:: set_buffer_authority (
2607
2615
& program_buffer_keypair. pubkey ( ) ,
2608
2616
& buffer_authority_keypair. pubkey ( ) ,
2609
2617
& governance_cookie. address ,
2610
- ) ) ;
2618
+ ) ;
2611
2619
2612
2620
self . bench
2613
- . process_transaction (
2614
- & instructions[ ..] ,
2615
- Some ( & [ & program_buffer_keypair, & buffer_authority_keypair] ) ,
2616
- )
2621
+ . process_transaction ( & [ set_authority_ixs] , Some ( & [ & buffer_authority_keypair] ) )
2617
2622
. await
2618
2623
. unwrap ( ) ;
2619
2624
0 commit comments