From 310b06dfe861011843db4b5f3c9e45b798a8e2ac Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Thu, 29 Jun 2023 10:23:14 +0200 Subject: [PATCH] Fix warnings --- testmodule/config.nims | 2 ++ testmodule/providers/jsonrpc/testJsonRpcSubscriptions.nim | 2 +- testmodule/testContracts.nim | 2 +- testmodule/testErc20.nim | 4 +--- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/testmodule/config.nims b/testmodule/config.nims index d2f7527..9201bed 100644 --- a/testmodule/config.nims +++ b/testmodule/config.nims @@ -1,3 +1,5 @@ switch("path", "..") when (NimMajor, NimMinor) >= (1, 4): switch("hint", "XCannotRaiseY:off") +when (NimMajor, NimMinor, NimPatch) >= (1, 6, 11): + switch("warning", "BareExcept:off") diff --git a/testmodule/providers/jsonrpc/testJsonRpcSubscriptions.nim b/testmodule/providers/jsonrpc/testJsonRpcSubscriptions.nim index 568a7c5..8671e7a 100644 --- a/testmodule/providers/jsonrpc/testJsonRpcSubscriptions.nim +++ b/testmodule/providers/jsonrpc/testJsonRpcSubscriptions.nim @@ -46,7 +46,7 @@ template subscriptionTests(subscriptions, client) = var count = 0 proc callback(blck: Block) = inc count - let subscription = await subscriptions.subscribeBlocks(callback) + discard await subscriptions.subscribeBlocks(callback) discard await client.call("evm_mine", newJArray()) check eventually count > 0 await subscriptions.close() diff --git a/testmodule/testContracts.nim b/testmodule/testContracts.nim index 1dab234..3c3f4c6 100644 --- a/testmodule/testContracts.nim +++ b/testmodule/testContracts.nim @@ -13,7 +13,7 @@ type TestToken = ref object of Erc20Token method mint(token: TestToken, holder: Address, amount: UInt256): ?TransactionResponse {.base, contract.} -method myBalance(token: TestToken): UInt256 {.contract, view.} +method myBalance(token: TestToken): UInt256 {.base, contract, view.} for url in ["ws://localhost:8545", "http://localhost:8545"]: diff --git a/testmodule/testErc20.nim b/testmodule/testErc20.nim index 8f21008..359c4e1 100644 --- a/testmodule/testErc20.nim +++ b/testmodule/testErc20.nim @@ -5,8 +5,6 @@ import pkg/stint import pkg/ethers import pkg/ethers/erc20 import ./hardhat -import ./miner -import ./mocks type TestToken = ref object of Erc20Token @@ -17,7 +15,7 @@ for url in ["ws://localhost:8545", "http://localhost:8545"]: suite "ERC20 (" & url & ")": - var token, token1: Erc20Token + var token: Erc20Token var testToken: TestToken var provider: JsonRpcProvider var snapshot: JsonNode