安全帽测试中的时间操纵

Time manipulation in a hardhat test

假设我在 Solidity 智能合约中有一个功能,需要一段时间才能通过,然后它会为此示例采取一些行动,比如说一年,并正确地为这个功能实施单元测试我需要现在等待一年,显然这是不切实际的,所以我的问题是:是否有一种简单的方法来操纵 hardhat 开发网络内部的 block.timestamp 值?

对于任何回顾此事的人,我在这个堆栈溢出 post 上找到了解决方案:https://ethereum.stackexchange.com/questions/86633/time-dependent-tests-with-hardhat