2021-11-23 16:55:16 +00:00
|
|
|
mode = ScriptMode.Verbose
|
|
|
|
|
2021-02-26 00:23:22 +00:00
|
|
|
version = "0.1.0"
|
|
|
|
author = "Dagger Team"
|
2021-10-29 19:30:52 +00:00
|
|
|
description = "p2p data durability engine"
|
2021-02-26 00:23:22 +00:00
|
|
|
license = "MIT"
|
|
|
|
|
2021-10-29 19:30:52 +00:00
|
|
|
requires "libp2p#unstable",
|
2021-02-26 00:23:22 +00:00
|
|
|
"nimcrypto >= 0.4.1",
|
|
|
|
"bearssl >= 0.1.4",
|
|
|
|
"chronicles >= 0.7.2",
|
|
|
|
"chronos >= 2.5.2",
|
|
|
|
"metrics",
|
|
|
|
"secp256k1",
|
|
|
|
"stew#head",
|
|
|
|
"protobufserialization >= 0.2.0 & < 0.3.0",
|
2021-04-15 09:23:49 +00:00
|
|
|
"https://github.com/status-im/nim-nitro >= 0.4.0 & < 0.5.0",
|
2022-03-16 13:19:14 +00:00
|
|
|
"https://github.com/status-im/nim-ethers >= 0.1.2 & < 0.2.0",
|
2021-05-10 07:42:38 +00:00
|
|
|
"questionable >= 0.9.1 & < 0.10.0",
|
2021-04-07 10:22:02 +00:00
|
|
|
"upraises >= 0.1.0 & < 0.2.0",
|
2021-10-29 19:30:52 +00:00
|
|
|
"asynctest >= 0.3.0 & < 0.4.0"
|
2021-11-23 16:55:16 +00:00
|
|
|
|
|
|
|
### Helper functions
|
|
|
|
proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") =
|
|
|
|
if not dirExists "build":
|
|
|
|
mkDir "build"
|
|
|
|
# allow something like "nim nimbus --verbosity:0 --hints:off nimbus.nims"
|
|
|
|
var extra_params = params
|
|
|
|
for i in 2..<paramCount():
|
|
|
|
extra_params &= " " & paramStr(i)
|
|
|
|
exec "nim " & lang & " --out:build/" & name & " " & extra_params & " " & srcDir & name & ".nim"
|
|
|
|
|
feat: integrate dagger contracts
Integrate dagger contracts from `nim-dagger-contracts` repo.
Add `dagger-contracts`, `nim-web3`, and all of `nim-web3`’s transitive deps as submodule deps to `nim-dagger`. Note: `nim-web3` and its transitive deps may no longer be needed when we switch to `nim-ethers`.
Add a `testContracts` nimble task to test all of the contracts functionality. Namely, this spins up an ethereum simulator, deploys the contracts (in `dagger-contracts`), runs the contract tests, and finally, regardless of success/error, kills the ethereum sim processes. The nimble task can be run with `./env.sh nimble testContracts`.
We also tested `nim-dagger-contracts` as a submodule dep of `nim-dagger`, and while the tests run as expected, the preference is to merge `nim-dagger-contracts` inside of `nim-dagger` for ease of parallel development. There’s also a high probability that `nim-dagger-contracts` is not being used as a dep by other projects. Are there any strong objections to this?
Co-authored-by: Michael Bradley <michaelsbradleyjr@gmail.com>
2022-01-25 00:22:58 +00:00
|
|
|
proc test(name: string, srcDir = "tests/", params = "-d:chronicles_log_level=DEBUG", lang = "c") =
|
|
|
|
buildBinary name, srcDir, params
|
2021-11-23 16:55:16 +00:00
|
|
|
exec "build/" & name
|
|
|
|
|
2022-03-15 14:24:03 +00:00
|
|
|
task testDagger, "Build & run Dagger tests":
|
|
|
|
test "testDagger", params = "-d:chronicles_log_level=WARN"
|
|
|
|
|
2022-03-21 10:37:47 +00:00
|
|
|
task testContracts, "Build & run Dagger Contract tests":
|
|
|
|
test "testContracts", "tests/", "-d:chronicles_log_level=WARN"
|
|
|
|
|
2022-03-28 08:18:53 +00:00
|
|
|
task test, "Run tests":
|
|
|
|
testDaggerTask()
|
|
|
|
|
|
|
|
task testAll, "Run all tests":
|
2022-03-15 14:24:03 +00:00
|
|
|
testDaggerTask()
|
|
|
|
testContractsTask()
|
2022-03-02 16:30:42 +00:00
|
|
|
|
|
|
|
task dagger, "build dagger binary":
|
|
|
|
buildBinary "dagger"
|