Skip to content

Commit

Permalink
Fix compilation errors in ncli_testnet.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheatfate committed Oct 15, 2024
1 parent 341f262 commit 815dc27
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion ncli/ncli_testnet.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{.push raises: [].}

import
std/[json, options],
std/[json, options, times],
chronos, bearssl/rand, chronicles, confutils, stint, json_serialization,
web3, eth/keys, eth/p2p/discoveryv5/random2,
stew/[io2, byteutils], json_rpc/jsonmarshal,
Expand Down Expand Up @@ -333,6 +333,22 @@ func createDepositContractSnapshot(
depositContractState: merkleizer.toDepositContractState,
blockHeight: blockHeight)

proc writeValue*(writer: var JsonWriter, value: DateTime) =
writer.writeValue($value)

proc readValue*(reader: var JsonReader, value: var DateTime) =
let s = reader.readValue(string)
try:
value = parse(s, "YYYY-MM-dd HH:mm:ss'.'fffzzz", utc())
except CatchableError:
raiseUnexpectedValue(reader, "Invalid date time")

proc writeValue*(writer: var JsonWriter, value: IoErrorCode) =
writer.writeValue(distinctBase value)

proc readValue*(reader: var JsonReader, value: var IoErrorCode) =
IoErrorCode reader.readValue(distinctBase IoErrorCode)

proc createEnr(rng: var HmacDrbgContext,
dataDir: string,
netKeyFile: string,
Expand Down

0 comments on commit 815dc27

Please sign in to comment.