Hey so instead of resorting to warp_to_slot function of the program test crate ,utilizing the set_account function i quickly cooked something along the lines of this Problem am facing is although when i retrieve the timestamp via by getting the clock and reading the updated value, problem is inside my programs i access the time via the sysvar cluster that is Clock::get()? which does not seem to get affected even after changing the time directly as shown, what am i doing wrong here ?
async fn set_exact_time (context : &mut ProgramTestContext, add_time : i64) {
let mut clock_account = get_clock(&mut context.banks_client).await;
let time_before = clock_account.unix_timestamp;
clock_account.unix_timestamp += add_time;
let new_data = bincode::serialize(&clock_account).unwrap();
let mut acc_info = context.banks_client.get_account(solana_program::sysvar::clock::id()).await.unwrap().unwrap();
acc_info.data = new_data;
let acc_shared_data = AccountSharedData::from(acc_info);
context.set_account(&solana_sdk::sysvar::clock::id(), &acc_shared_data);
let clock_account = get_clock(&mut context.banks_client).await.unix_timestamp;
println!("time now isss {clock_account},time before was {time_before}");
// let acc_shared_clock = AccountSharedData::from(clock_account);
}