mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-02-23 15:23:12 +00:00
nim 2.2.6 became more strict in readValue for requiresInit types
This commit is contained in:
parent
56ebeb4429
commit
cd8c3f3116
@ -13,24 +13,24 @@ import
|
||||
|
||||
export json_serialization, json_options
|
||||
|
||||
type AutoShardingConfig* {.requiresInit.} = object
|
||||
type AutoShardingConfig* = object
|
||||
numShardsInCluster*: uint16
|
||||
|
||||
type RlnConfig* {.requiresInit.} = object
|
||||
type RlnConfig* = object
|
||||
contractAddress*: string
|
||||
chainId*: uint
|
||||
epochSizeSec*: uint64
|
||||
|
||||
type NetworkingConfig* {.requiresInit.} = object
|
||||
type NetworkingConfig* = object
|
||||
listenIpv4*: string
|
||||
p2pTcpPort*: uint16
|
||||
discv5UdpPort*: uint16
|
||||
|
||||
type MessageValidation* {.requiresInit.} = object
|
||||
type MessageValidation* = object
|
||||
maxMessageSize*: string # Accepts formats like "150 KiB", "1500 B"
|
||||
rlnConfig*: Option[RlnConfig]
|
||||
|
||||
type ProtocolsConfig* {.requiresInit.} = object
|
||||
type ProtocolsConfig* = object
|
||||
entryNodes: seq[string]
|
||||
staticStoreNodes: seq[string]
|
||||
clusterId: uint16
|
||||
@ -520,7 +520,7 @@ proc decodeNodeConfigFromJson*(
|
||||
var val = NodeConfig.init() # default-initialized
|
||||
try:
|
||||
var stream = unsafeMemoryInput(jsonStr)
|
||||
var reader = JsonReader[DefaultFlavor].init(stream)
|
||||
var reader = (JsonReader[DefaultFlavor].init(stream))
|
||||
reader.readValue(val)
|
||||
except IOError as err:
|
||||
raise (ref SerializationError)(msg: err.msg)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user