mirror of
https://github.com/vacp2p/nim-libp2p.git
synced 2026-01-09 22:28:27 -05:00
chore: unused imports are now errors (#1399)
This commit is contained in:
@@ -4,6 +4,7 @@ if dirExists("nimbledeps/pkgs"):
|
||||
if dirExists("nimbledeps/pkgs2"):
|
||||
switch("NimblePath", "nimbledeps/pkgs2")
|
||||
|
||||
switch("warningAsError", "UnusedImport:on")
|
||||
switch("warning", "CaseTransition:off")
|
||||
switch("warning", "ObservableStores:off")
|
||||
switch("warning", "LockLevel:off")
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
## This module implementes CID (Content IDentifier).
|
||||
|
||||
{.push raises: [].}
|
||||
{.used.}
|
||||
|
||||
import tables, hashes
|
||||
import multibase, multicodec, multihash, vbuffer, varint, results
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
## This module implements MultiCodec.
|
||||
|
||||
{.push raises: [].}
|
||||
{.used.}
|
||||
|
||||
import tables, hashes
|
||||
import vbuffer
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
## 2. MURMUR
|
||||
|
||||
{.push raises: [].}
|
||||
{.used.}
|
||||
|
||||
import tables
|
||||
import nimcrypto/[sha, sha2, keccak, blake2, hash, utils]
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
{.push raises: [].}
|
||||
{.push public.}
|
||||
{.used.}
|
||||
|
||||
import
|
||||
std/[hashes, strutils],
|
||||
|
||||
@@ -4,7 +4,7 @@ const
|
||||
libp2p_pubsub_verify {.booldefine.} = true
|
||||
libp2p_pubsub_anonymize {.booldefine.} = false
|
||||
|
||||
import hashes, random, tables, sets, sequtils, sugar
|
||||
import hashes, random, tables, sets, sequtils
|
||||
import chronos, results, stew/byteutils, chronos/ratelimit
|
||||
import
|
||||
../../libp2p/[
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{.used.}
|
||||
|
||||
import testnative, testdaemon, ./pubsub/testpubsub, testinterop
|
||||
import testnative, ./pubsub/testpubsub, testinterop, testdaemon
|
||||
|
||||
@@ -108,17 +108,16 @@ proc pubsubTest(f: set[P2PDaemonFlags]): Future[bool] {.async.} =
|
||||
if resultsCount == 2:
|
||||
result = true
|
||||
|
||||
when isMainModule:
|
||||
suite "libp2p-daemon test suite":
|
||||
test "Simple spawn and get identity test":
|
||||
check:
|
||||
waitFor(identitySpawnTest()) == true
|
||||
test "Connect/Accept peer/stream test":
|
||||
check:
|
||||
waitFor(connectStreamTest()) == true
|
||||
asyncTest "GossipSub test":
|
||||
checkUntilTimeout:
|
||||
(await pubsubTest({PSGossipSub}))
|
||||
asyncTest "FloodSub test":
|
||||
checkUntilTimeout:
|
||||
(await pubsubTest({PSFloodSub}))
|
||||
suite "libp2p-daemon test suite":
|
||||
test "Simple spawn and get identity test":
|
||||
check:
|
||||
waitFor(identitySpawnTest()) == true
|
||||
test "Connect/Accept peer/stream test":
|
||||
check:
|
||||
waitFor(connectStreamTest()) == true
|
||||
asyncTest "GossipSub test":
|
||||
checkUntilTimeout:
|
||||
(await pubsubTest({PSGossipSub}))
|
||||
asyncTest "FloodSub test":
|
||||
checkUntilTimeout:
|
||||
(await pubsubTest({PSFloodSub}))
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
{.used.}
|
||||
|
||||
import helpers, commoninterop
|
||||
import ../libp2p
|
||||
import ../libp2p/crypto/crypto, ../libp2p/protocols/connectivity/relay/relay
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
import std/[strutils, sequtils, tables]
|
||||
import std/[sequtils, tables]
|
||||
import chronos
|
||||
import
|
||||
../libp2p/[
|
||||
@@ -36,6 +36,9 @@ const unixPlatform =
|
||||
defined(linux) or defined(solaris) or defined(macosx) or defined(freebsd) or
|
||||
defined(netbsd) or defined(openbsd) or defined(dragonfly)
|
||||
|
||||
when unixPlatform:
|
||||
import std/strutils
|
||||
|
||||
proc guessOsNameServers(): seq[TransportAddress] =
|
||||
when unixPlatform:
|
||||
var resultSeq = newSeqOfCap[TransportAddress](3)
|
||||
|
||||
Reference in New Issue
Block a user