mirror of https://github.com/status-im/nim-eth.git
Enable tests with also json sink and fix failures (#624)
And a few minor cleanups
This commit is contained in:
parent
d74dc40bee
commit
c5dd5e4115
|
@ -11,7 +11,7 @@ import
|
|||
std/[algorithm, times, sequtils, bitops, sets, options],
|
||||
bearssl/rand,
|
||||
stint, chronicles, metrics, chronos, stew/shims/net as stewNet,
|
||||
../../net/utils, stew/endians2,
|
||||
../../net/utils,
|
||||
"."/[node, random2, enr]
|
||||
|
||||
export options
|
||||
|
|
|
@ -27,6 +27,8 @@ type
|
|||
proc (d: DatagramTransport):
|
||||
SendCallback[TransportAddress] {.gcsafe, raises: [].}
|
||||
|
||||
chronicles.formatIt(TransportAddress): $it
|
||||
|
||||
# This should probably be defined in TransportAddress module, as hash function should
|
||||
# be consistent with equality function
|
||||
# in nim zero arrays always have hash equal to 0, irrespectively of array size, to
|
||||
|
|
|
@ -311,6 +311,8 @@ type
|
|||
|
||||
ConnectionResult*[A] = Result[UtpSocket[A], OutgoingConnectionError]
|
||||
|
||||
chronicles.formatIt(UtpSocketKey): $it
|
||||
|
||||
const
|
||||
# Default maximum size of the data packet payload. With this configuration
|
||||
# data packets will have 508 bytes (488 + 20 header).
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
# rocksdb init does this type of assignment
|
||||
--define:nimOldCaseObjects
|
||||
|
||||
-d:"chronicles_sinks=textlines[stdout],json[dynamic]"
|
||||
-d:"chronicles_log_level=TRACE"
|
||||
-d:"chronicles_runtime_filtering=on"
|
||||
|
||||
# Avoid some rare stack corruption while using exceptions with a SEH-enabled
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
{.push raises: [].}
|
||||
|
||||
import
|
||||
std/[options, strutils, tables, sets],
|
||||
confutils, confutils/std/net, chronicles, chronicles/topics_registry,
|
||||
|
@ -182,7 +184,7 @@ proc discover(d: discv5_protocol.Protocol, psFile: string) {.async.} =
|
|||
await sleepAsync(1000) # 1 sec of delay
|
||||
|
||||
|
||||
proc run(config: DiscoveryConf) =
|
||||
proc run(config: DiscoveryConf) {.raises: [CatchableError].} =
|
||||
let
|
||||
bindIp = config.listenAddress
|
||||
udpPort = Port(config.udpPort)
|
||||
|
@ -235,7 +237,9 @@ proc run(config: DiscoveryConf) =
|
|||
waitFor(discover(d, config.persistingFile))
|
||||
|
||||
when isMainModule:
|
||||
{.pop.}
|
||||
let config = DiscoveryConf.load()
|
||||
{.push raises: [].}
|
||||
|
||||
setLogLevel(config.logLevel)
|
||||
|
||||
|
|
Loading…
Reference in New Issue