I am using the latest @coral-xyz/anchor ^0.31.1.
When I set my deadline as a future time in my TS test file:
const clock = svm.getClock();
clock.unixTimestamp = BigInt(deadline);
svm.setClock(clock);
svm.warpToSlot(1000n);
and when I ran above code in my Anchor test with my Solana program below:
let clock = Clock::get()?;
let time = clock.unix_timestamp as u32;
msg!("Solana time:{:?}", time); // time from Solana program
The time from my Solana program still shows my current unix time!! Why??
Reference to your Clock test: