To work around this issue when subscriptions are
inactive for more than 5 minutes:
https://github.com/NomicFoundation/hardhat/issues/2053
Use 100 millisecond polling; default polling interval
of 4 seconds is too close to the 5 second timeout for
`check eventually`.
* market: use `pending` blocktag when querying onchain state
* clock: use wall clock in integration tests
reason: we'll need to wait for the next period in
integration tests, and we can't do that if the
time doesn't advance
* clock: remove unused field
* integration: use pending block time to get current time
* clock: fix on-chain clock for hardhat
Only use 'latest' block for updates
Only update the first time you see a block
* integration: do not start tests with a very outdated block
* integration: allow for longer expiry period
* 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
* Add get active slot /slots/{slotId} to REST api, use utils/json
- Add endpoint /slots/{slotId} to get an active SalesAgent from the Sales module. Used in integration tests to test when a sale has reached a certain state. Those integration test changes will be included in a larger PR, coming later.
- Add OpenAPI changes for new endpoint and associated components
- Use utils/json instead of nim-json-serialization. Required exemption of imports from several packages that export nim-json-serialization by default.
* Only except `toJson` from import/export of chronicles
Previously it could take up to one second to complete
the future. This messed with the timings in the
integration tests and made them less predictable.
* [build] disable XCannotRaiseY hint
There are too many {.raises:[Defect].} in the
libraries that we use, drowning out all other
warnings and hints
* [build] disable BareExcept warning
Not yet enabled in a released version of Nim,
so libraries that we depend on have not fixed
this yet, drowning out our own hints and warnings
* [build] disable DotLikeOps warning
dot-like ops were an experiment that is not going
land in Nim
* [build] compile log statements in tests
When running tests, all log statements are compiled.
They are filtered out at runtime during a test run.
* [build] do not build executable when running unit test
It's already built in the integration test
* [build] Fix warnings
- remove unused code
- remove unused imports
- stop using deprecated stuff
* [build] Put compiler flags behind nim version checks
* [CI] remove Nim 1.2 compatibility