pub async fn restart_program(
        accounts_vector: &mut Vec<(&Pubkey, usize, Option<Vec<u8>>)>,
        token_accounts: Option<&mut Vec<(&Pubkey, &Pubkey, u64)>>,
        program_id: &Pubkey,
        signer_pubkey: &Pubkey,
        program_context: &mut ProgramTestContext,
    ) -> ProgramTestContext {
        for (pubkey, _, current_data) in accounts_vector.iter_mut() {
            let account = program_context
                .banks_client
                .get_account(**pubkey)
                .await
                .expect("get_account")
                .unwrap();
            *current_data = Some(account.data.to_vec());
        }
        let program_context_new = create_and_start_program_var(
            &accounts_vector,
            token_accounts,
            &program_id,
            &signer_pubkey,
        )
        .await;

        program_context_new
    }
// We need program restart logic since we're firing 300+ ix and
// the program_context seems to melt down every couple of hundred ix.
// It basically just picks up the account state where it left off and restarts the client
We need program restart logic since we're firing 300+ ix and
the program_context seems to melt down every couple of hundred ix.
It basically just picks up the account state where it left off and restarts the client
We need program restart logic since we ' re firing 300 + ix and the program_context seems to melt down every couple of hundred ix . It basically just picks up the account state where it left off and restarts the client
pub async fn restart_program(
        accounts_vector: &mut Vec<(&Pubkey, usize, Option<Vec<u8>>)>,
        token_accounts: Option<&mut Vec<(&Pubkey, &Pubkey, u64)>>,
        program_id: &Pubkey,
        signer_pubkey: &Pubkey,
        program_context: &mut ProgramTestContext,
    ) -> ProgramTestContext {
        for (pubkey, _, current_data) in accounts_vector.iter_mut() {
            let account = program_context
                .banks_client
                .get_account(**pubkey)
                .await
                .expect("get_account")
                .unwrap();
            *current_data = Some(account.data.to_vec());
        }
        let program_context_new = create_and_start_program_var(
            &accounts_vector,
            token_accounts,
            &program_id,
            &signer_pubkey,
        )
        .await;
        program_context_new
    }
pub async fn restart_program ( accounts_vector : & mut Vec < ( & Pubkey , usize , Option < Vec < u8 > > ) > , token_accounts : Option < & mut Vec < ( & Pubkey , & Pubkey , u64 ) > > , program_id : & Pubkey , signer_pubkey : & Pubkey , program_context : & mut ProgramTestContext , ) -> ProgramTestContext { for ( pubkey , _ , current_data ) in accounts_vector . iter_mut ( ) { let account = program_context . banks_client . get_account ( * * pubkey ) . await . expect ( " " ) . unwrap ( ) ; * current_data = Some ( account . data . to_vec ( ) ) ; } let program_context_new = create_and_start_program_var ( & accounts_vector , token_accounts , & program_id , & signer_pubkey , ) . await ; program_context_new }
We need program restart logic since we're firing 300+ ix and
the program_context seems to melt down every couple of hundred ix.
We need program restart logic since we ' re firing 300 + ix and the program_context seems to melt down every couple of hundred ix .
accounts_vector
&mut Vec<(&Pubkey, usize, Option<Vec<u8>>)>
token_accounts
Option<&mut Vec<(&Pubkey, &Pubkey, u64)>>
program_id
&Pubkey
signer_pubkey
&Pubkey
program_context
&mut ProgramTestContext