integration: use pending block time to get current time

This commit is contained in:
Mark Spanbroek 2024-02-29 11:44:53 +01:00
parent cb3f11d678
commit 70f74b8de7
No known key found for this signature in database
GPG Key ID: FBE3E9548D427C00
1 changed files with 1 additions and 1 deletions

View File

@ -1,7 +1,7 @@
import pkg/ethers
proc currentTime*(provider: Provider): Future[UInt256] {.async.} =
return (!await provider.getBlock(BlockTag.latest)).timestamp
return (!await provider.getBlock(BlockTag.pending)).timestamp
proc advanceTime*(provider: JsonRpcProvider, seconds: UInt256) {.async.} =
discard await provider.send("evm_increaseTime", @[%("0x" & seconds.toHex)])