From 292e8afb825f2ff507bb21fb1b5cd11fd81bb11f Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Mon, 5 Feb 2024 11:52:12 +0100 Subject: [PATCH] Fix warnings --- ethers/providers/jsonrpc/json.nim | 2 +- testmodule/providers/jsonrpc/testConversions.nim | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ethers/providers/jsonrpc/json.nim b/ethers/providers/jsonrpc/json.nim index 5ccd3d0..c97b007 100644 --- a/ethers/providers/jsonrpc/json.nim +++ b/ethers/providers/jsonrpc/json.nim @@ -397,7 +397,7 @@ func `%`*[T: object or ref object](obj: T): JsonNode = T.expectEmptyPragma(serialize, "Cannot specify 'key' or 'ignore' on object defition") - const serializeAllFields = T.hasCustomPragma(serialize) + const serializeAllFields {.used.} = T.hasCustomPragma(serialize) for name, value in o.fieldPairs: # TODO: move to % diff --git a/testmodule/providers/jsonrpc/testConversions.nim b/testmodule/providers/jsonrpc/testConversions.nim index 5df1358..8a6e668 100644 --- a/testmodule/providers/jsonrpc/testConversions.nim +++ b/testmodule/providers/jsonrpc/testConversions.nim @@ -135,7 +135,7 @@ suite "JSON Conversions": without tx =? PastTransaction.fromJson(json): fail - check tx.blockHash == BlockHash(array[32, byte].fromHex("0x595bffbe897e025ea2df3213c4cc52c3f3d69bc04b49011d558f1b0e70038922")) + check tx.blockHash == array[32, byte].fromHex("0x595bffbe897e025ea2df3213c4cc52c3f3d69bc04b49011d558f1b0e70038922") check tx.blockNumber == 0x22e.u256 check tx.`from` == Address.init("0xe00b677c29ff8d8fe6068530e2bc36158c54dd34").get check tx.gas == 0x4d4bb.u256 @@ -154,7 +154,7 @@ suite "JSON Conversions": test "PastTransaction serializes correctly": let tx = PastTransaction( - blockHash: BlockHash(array[32, byte].fromHex("0x595bffbe897e025ea2df3213c4cc52c3f3d69bc04b49011d558f1b0e70038922")), + blockHash: array[32, byte].fromHex("0x595bffbe897e025ea2df3213c4cc52c3f3d69bc04b49011d558f1b0e70038922"), blockNumber: 0x22e.u256, `from`: Address.init("0xe00b677c29ff8d8fe6068530e2bc36158c54dd34").get, gas: 0x4d4bb.u256,