diff --git a/.gitmodules b/.gitmodules index c3f337a53..ae8504ebe 100644 --- a/.gitmodules +++ b/.gitmodules @@ -153,3 +153,13 @@ url = https://github.com/vacp2p/zerokit.git ignore = dirty branch = master +[submodule "vendor/nim-regex"] + path = vendor/nim-regex + url = https://github.com/nitely/nim-regex.git + ignore = untracked + branch = master +[submodule "vendor/nim-unicodedb"] + path = vendor/nim-unicodedb + url = https://github.com/nitely/nim-unicodedb.git + ignore = untracked + branch = master diff --git a/apps/wakunode2/config.nim b/apps/wakunode2/config.nim index d1e075556..193a8db76 100644 --- a/apps/wakunode2/config.nim +++ b/apps/wakunode2/config.nim @@ -1,8 +1,9 @@ import - std/[strutils, nre], + std/strutils, stew/results, chronicles, chronos, + regex, confutils, confutils/defs, confutils/std/net, @@ -473,8 +474,7 @@ proc defaultListenAddress*(): ValidIpAddress = proc defaultPrivateKey*(): PrivateKey = crypto.PrivateKey.random(Secp256k1, crypto.newRng()[]).value -proc readValue*(r: var TomlReader, val: var crypto.PrivateKey) - {.raises: [Defect, IOError, SerializationError].} = +proc readValue*(r: var TomlReader, val: var crypto.PrivateKey) {.raises: [SerializationError].} = val = try: parseCmdArg(crypto.PrivateKey, r.readValue(string)) except CatchableError as err: raise newException(SerializationError, err.msg) @@ -487,7 +487,7 @@ let DbUrlRegex = re"^[\w\+]+:\/\/[\w\/\\\.\:\@]+$" proc validateDbUrl*(val: string): ConfResult[string] = let val = val.strip() - if val == "" or val.match(DbUrlRegex).isSome(): + if val == "" or val.match(DbUrlRegex): return ok(val) else: return err("invalid 'db url' option format: " & val) @@ -498,7 +498,7 @@ let StoreMessageRetentionPolicyRegex = re"^\w+:\w$" proc validateStoreMessageRetentionPolicy*(val: string): ConfResult[string] = let val = val.strip() - if val == "" or val.match(StoreMessageRetentionPolicyRegex).isSome(): + if val == "" or val.match(StoreMessageRetentionPolicyRegex): return ok(val) else: return err("invalid 'store message retention policy' option format: " & val) diff --git a/vendor/nim-regex b/vendor/nim-regex new file mode 160000 index 000000000..ab9873553 --- /dev/null +++ b/vendor/nim-regex @@ -0,0 +1 @@ +Subproject commit ab98735539ddd8a1eaaa795fd2ca65293c1640b3 diff --git a/vendor/nim-unicodedb b/vendor/nim-unicodedb new file mode 160000 index 000000000..c3c9ae079 --- /dev/null +++ b/vendor/nim-unicodedb @@ -0,0 +1 @@ +Subproject commit c3c9ae079ab2eed33ffe5ca27ec4013beed7647f diff --git a/waku.nimble b/waku.nimble index 693a7dea7..21b76dd4d 100644 --- a/waku.nimble +++ b/waku.nimble @@ -8,7 +8,7 @@ license = "MIT or Apache License 2.0" #bin = @["build/waku"] ### Dependencies -requires "nim >= 1.2.0", +requires "nim >= 1.6.0", "chronicles", "confutils", "chronos", @@ -21,7 +21,8 @@ requires "nim >= 1.2.0", "metrics", "libp2p", # Only for Waku v2 "web3", - "presto" + "presto", + "regex" ### Helper functions proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") =