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