Mock a `timestamp()` call on a local Fuel node

I have different tests that require me to test for scenarios in the future. The best way to accomplish this is by mocking the timestamp() call used by the Fuel node.

Something like the Fuel equivalent of evm_increaseTime and evm_mine? Does this exist? If not, any alternative suggestions?

1 Like

Hey @theAusicist, you can try running the test with the .call() method, here is an example repo for the same.

well aware of this. my question was more geared toward if there was a way of “fooling” the local Fuel node into advancing time specifically to test time-dependent functions.

here’s an example using Hardhat. Something similar for Fuel? @Nazeeh21

Hey @theAusicist please have a look here and let me know if this is helpful.

ah! this is exactly what I was looking for. thanks so much!

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.