Important
Deprecated in favor of aiken-extra/test_kit
A utility library to help comparing and mocking time intervals.
ℹ️ | Package info | aiken-extra/time_util v6.220.202501 | 🐞 |
---|---|---|---|
🟢 | Depends on | aiken-lang/stdlib v2.2.0 | ✅ |
🟢 | Tested with | aiken v1.1.9 | ✅ |
You can have a real latest block-time value when running tests!
Note
For Linux
Copy ./check.sh
and paste it in the root directory of your Aiken project.
Make it an executable.
Add now
to aiken.toml
configurations like:
[config.default]
...
now = 0
...
[config.any]
...
now = 0
...
Run ./check.sh
(with optional -m
and/or -E
arguments)
$ ./check.sh -H
Usage: ./check.sh -m <MATCH_TEST> -E <ENV>
It will get the latest block-time, thanks to Koios,
and reconfigure the value for now
in all environments.
Access it from your code by:
use config
trace config.now