Nimsuggest tweaks (#453)

* Fixes/workarounds for nimsuggest failures in codex.nim.
* remove rng prefix - it appears to work now
This commit is contained in:
Jaremy Creechley 2023-06-21 15:02:05 -07:00 committed by GitHub
parent cfd2cf9302
commit 6d1469b4be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 26 deletions

View File

@ -7,29 +7,30 @@ license = "MIT"
binDir = "build"
srcDir = "."
requires "nim >= 1.2.0",
"asynctest >= 0.3.2 & < 0.4.0",
"bearssl >= 0.1.4",
"chronicles >= 0.7.2",
"chronos >= 2.5.2",
"confutils",
"ethers >= 0.2.4 & < 0.3.0",
"libbacktrace",
"libp2p",
"metrics",
"nimcrypto >= 0.4.1",
"nitro >= 0.5.1 & < 0.6.0",
"presto",
"protobuf_serialization >= 0.2.0 & < 0.3.0",
"questionable >= 0.10.6 & < 0.11.0",
"secp256k1",
"stew",
"upraises >= 0.1.0 & < 0.2.0",
"https://github.com/status-im/lrucache.nim#1.2.2",
"leopard >= 0.1.0 & < 0.2.0",
"blscurve",
"libp2pdht",
"eth"
requires "nim >= 1.2.0"
requires "asynctest >= 0.3.2 & < 0.4.0"
requires "bearssl >= 0.1.4"
requires "chronicles >= 0.7.2"
requires "chronos >= 2.5.2"
requires "confutils"
requires "ethers >= 0.2.4 & < 0.3.0"
requires "libbacktrace"
requires "libp2p"
requires "metrics"
requires "nimcrypto >= 0.4.1"
requires "nitro >= 0.5.1 & < 0.6.0"
requires "presto"
requires "protobuf_serialization >= 0.2.0 & < 0.3.0"
requires "questionable >= 0.10.6 & < 0.11.0"
requires "secp256k1"
requires "stew"
requires "upraises >= 0.1.0 & < 0.2.0"
requires "toml_serialization"
requires "https://github.com/status-im/lrucache.nim#1.2.2"
requires "leopard >= 0.1.0 & < 0.2.0"
requires "blscurve"
requires "libp2pdht"
requires "eth"
when declared(namedBin):
namedBin = {

View File

@ -141,8 +141,11 @@ proc stop*(s: CodexServer) {.async.} =
s.runHandle.complete()
proc new*(T: type CodexServer, config: CodexConf, privateKey: CodexPrivateKey): T =
proc new*(
T: type CodexServer,
config: CodexConf,
privateKey: CodexPrivateKey): CodexServer =
## create CodexServer including setting up datastore, repostore, etc
let
switch = SwitchBuilder
.new()
@ -221,6 +224,7 @@ proc new*(T: type CodexServer, config: CodexConf, privateKey: CodexPrivateKey):
.expect("Should start rest server!")
switch.mount(network)
T(
config: config,
codexNode: codexNode,

View File

@ -252,7 +252,10 @@ proc getCodexVersion(): string =
return tag
proc getCodexRevision(): string =
strip(staticExec("git rev-parse --short HEAD"))[0..5]
# using a slice in a static context breaks nimsuggest for some reason
var res = strip(staticExec("git rev-parse --short HEAD"))
res.setLen(6)
return res
proc getNimBanner(): string =
staticExec("nim --version | grep Version")