nim-codex/tests
Eric df6b9c6760
Workaround for Hardhat last block timestamp bug (#644)
* Workaround for Hardhat timestamp bug

Likely due to a Hardhat bug in which the callbacks for subscription events are called and awaited before updating its local understanding of the last block time, Hardhat will report a block time in the `newHeads` event that is generally 1 second before the time reported from `getLatestBlock.timestamp`. This was causing issues with the OnChainClock's offset and therefore the `now()` used by the `OnChainClock` would sometimes be off by a second (or more), causing tests to fail.

This commit introduce a `codex_use_hardhat` compilation flag, that when set, will always get the latest block timestamp from Hardhat via the `getLatestBlock.timestamp` RPC call for `OnChainClock.now` calls. Otherwise, the last block timestamp reported in the `newHeads` event will be used.

Update the docker dist tests compilation flag for simulated proof failures (it was not correct), and explicitly add the `codex_use_hardhat=false` for clarity.

* enable simulated proof failures for coverage

* comment out failing test on linux -- will be replaced

* bump codex contracts eth

* add back clock offset for non-hardhat cases

* bump codex-contracts-eth

increases pointer by 67 blocks each period increase

* Add `codex_use_hardhat` flag to coverage tests
2023-12-20 08:06:24 +11:00
..
codex chore: improve log information (#656) 2023-12-19 04:29:18 +00:00
contracts Workaround for Hardhat last block timestamp bug (#644) 2023-12-20 08:06:24 +11:00
fixtures Node setup (#32) 2022-01-10 09:32:56 -06:00
helpers Taiko L2 (#483) 2023-09-13 16:17:56 +02:00
integration Workaround for Hardhat last block timestamp bug (#644) 2023-12-20 08:06:24 +11:00
checktest.nim Create memory-leak detecting test suite (#226) 2023-06-22 12:01:21 -06:00
config.nims [build] fix: ignore logging when running singular tests (#369) 2023-03-16 15:32:09 +01:00
coverage.nim Bump deps take2 (#492) 2023-08-01 16:47:57 -07:00
coverage.nims Bump deps take2 (#492) 2023-08-01 16:47:57 -07:00
ethertest.nim Rename provider to ethProvider in tests (#657) 2023-12-18 09:34:04 +00:00
examples.nim refactor: move expiry update from fetchBatched (#634) 2023-11-28 22:04:11 +01:00
helpers.nim Create memory-leak detecting test suite (#226) 2023-06-22 12:01:21 -06:00
logging.nim Bump deps take2 (#492) 2023-08-01 16:47:57 -07:00
nimlldb.py Bump deps take2 (#492) 2023-08-01 16:47:57 -07:00
testCodex.nim removing old por proofs implementation (#593) 2023-10-23 07:58:07 -07:00
testContracts.nim Validator (#387) 2023-04-19 15:06:00 +02:00
testIntegration.nim Taiko L2 (#483) 2023-09-13 16:17:56 +02:00
testTaiko.nim Taiko L2 (#483) 2023-09-13 16:17:56 +02:00