diff --git a/.appveyor.yml b/.appveyor.yml index 7b27ff8..d8504f7 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -76,6 +76,7 @@ build_script: test_script: - nimble test + - nimble build_dcli deploy: off diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2afa134..71857fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -270,3 +270,4 @@ jobs: export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" nimble install -y --depsOnly env TEST_LANG="${{ matrix.target.TEST_LANG }}" PLATFORM="$PLATFORM" nimble test + env TEST_LANG="${{ matrix.target.TEST_LANG }}" PLATFORM="$PLATFORM" nimble build_dcli diff --git a/.travis.yml b/.travis.yml index c95fa80..2a3ad32 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,3 +46,4 @@ install: script: - nimble install -y --depsOnly - nimble test + - nimble build_dcli diff --git a/eth.nimble b/eth.nimble index 6d1adc8..6a1c7d8 100644 --- a/eth.nimble +++ b/eth.nimble @@ -24,9 +24,16 @@ proc runTest(path: string, release: bool = true, chronosStrict = true) = let chronosMode = if chronosStrict: "-d:chronosStrictException" else: "" exec "nim c -r " & releaseMode & " " & chronosMode & - " -d:chronicles_log_level=ERROR --verbosity:0 --hints:off " & path + " -d:chronicles_log_level=error --verbosity:0 --hints:off " & path rmFile path +proc buildBinary(path: string) = + echo "\nBuilding: ", path + exec "nim c -d:release -d:chronosStrictException " & + "-d:chronicles_log_level=trace --verbosity:0 --hints:off --threads:on " & + "--warning[CaseTransition]:off --warning[ObservableStores]:off " & + path + task test_keyfile, "Run keyfile tests": runTest("tests/keyfile/all_tests") @@ -88,3 +95,6 @@ task test_discv5_full, "Run discovery v5 and its dependencies tests": test_keys_task() test_rlp_task() test_discv5_task() + +task build_dcli, "Build dcli": + buildBinary("eth/p2p/discoveryv5/dcli") diff --git a/eth/common.nim b/eth/common.nim index 23fcad3..abe3686 100644 --- a/eth/common.nim +++ b/eth/common.nim @@ -1,2 +1,2 @@ -import common / [eth_types, utils] +import ./common/[eth_types, utils] export eth_types, utils diff --git a/eth/common/eth_types.nim b/eth/common/eth_types.nim index 840a7c6..27be672 100644 --- a/eth/common/eth_types.nim +++ b/eth/common/eth_types.nim @@ -1,7 +1,7 @@ import - strutils, - stew/[endians2, byteutils], options, times, chronicles, - stint, nimcrypto/[keccak, hash], eth/rlp, eth/trie/[trie_defs, db] + std/[strutils, options, times], + stew/[endians2, byteutils], chronicles, stint, nimcrypto/[keccak, hash], + ../rlp, ../trie/[trie_defs, db] export stint, read, append, KeccakHash diff --git a/eth/common/eth_types_json_serialization.nim b/eth/common/eth_types_json_serialization.nim index 6b027cf..992c7c4 100644 --- a/eth/common/eth_types_json_serialization.nim +++ b/eth/common/eth_types_json_serialization.nim @@ -1,6 +1,7 @@ import - times, net, - json_serialization, nimcrypto/[hash, utils], eth_types + std/[times, net], + json_serialization, nimcrypto/[hash, utils], + ./eth_types export json_serialization diff --git a/eth/common/state_accessors.nim b/eth/common/state_accessors.nim index b7e1408..c4982da 100644 --- a/eth/common/state_accessors.nim +++ b/eth/common/state_accessors.nim @@ -1,6 +1,6 @@ import - eth/trie/[trie_defs, db, hexary], eth/rlp, - eth_types + ../trie/[trie_defs, db, hexary], ../rlp, + ./eth_types proc getAccount*(db: TrieDatabaseRef, rootHash: KeccakHash, diff --git a/eth/common/transaction.nim b/eth/common/transaction.nim index 8c4fd95..8993ce9 100644 --- a/eth/common/transaction.nim +++ b/eth/common/transaction.nim @@ -1,5 +1,6 @@ import - eth/[common, rlp, keys], nimcrypto/keccak + nimcrypto/keccak, + ".."/[common, rlp, keys] proc initTransaction*(nonce: AccountNonce, gasPrice, gasLimit: GasInt, to: EthAddress, value: UInt256, payload: Blob, V: byte, R, S: UInt256, isContractCreation = false): Transaction = diff --git a/eth/common/utils.nim b/eth/common/utils.nim index 3c74cc2..b6acc9f 100644 --- a/eth/common/utils.nim +++ b/eth/common/utils.nim @@ -6,9 +6,13 @@ # This file may not be copied, modified, or distributed except according to # those terms. -import nimcrypto/hash, hashes, stew/byteutils, eth_types, metrics, os +import + std/[hashes, os], + nimcrypto/hash, stew/byteutils, metrics, + ./eth_types + when defined(posix): - import posix + import std/posix export metrics diff --git a/eth/db/kvstore.nim b/eth/db/kvstore.nim index b0bf1b5..7f28f23 100644 --- a/eth/db/kvstore.nim +++ b/eth/db/kvstore.nim @@ -11,8 +11,8 @@ {.push raises: [Defect].} import - stew/results, - tables, hashes, sets + std/[tables, hashes, sets], + stew/results export results diff --git a/eth/db/kvstore_rocksdb.nim b/eth/db/kvstore_rocksdb.nim index 0a6a112..e1b0c67 100644 --- a/eth/db/kvstore_rocksdb.nim +++ b/eth/db/kvstore_rocksdb.nim @@ -1,6 +1,9 @@ {.push raises: [Defect].} -import os, rocksdb, ./kvstore, stew/results +import + std/os, + rocksdb, stew/results, + ./kvstore export results diff --git a/eth/keyfile.nim b/eth/keyfile.nim index e4c28b7..b34894d 100644 --- a/eth/keyfile.nim +++ b/eth/keyfile.nim @@ -7,5 +7,5 @@ # Apache License, version 2.0, (LICENSE-APACHEv2) # MIT license (LICENSE-MIT) -import keyfile/uuid, keyfile/keyfile +import ./keyfile/[uuid, keyfile] export uuid, keyfile diff --git a/eth/keyfile/keyfile.nim b/eth/keyfile/keyfile.nim index 0a5d7ad..4278e79 100644 --- a/eth/keyfile/keyfile.nim +++ b/eth/keyfile/keyfile.nim @@ -9,8 +9,12 @@ {.push raises: [Defect].} -import nimcrypto/[bcmode, hmac, rijndael, pbkdf2, sha2, sysrand, utils, keccak, scrypt], - eth/keys, json, uuid, strutils, stew/results +import + std/[strutils, json], + nimcrypto/[bcmode, hmac, rijndael, pbkdf2, sha2, sysrand, utils, keccak, scrypt], + stew/results, + ../keys, + ./uuid export results diff --git a/eth/keys.nim b/eth/keys.nim index 17813f7..0c89b4b 100644 --- a/eth/keys.nim +++ b/eth/keys.nim @@ -15,9 +15,9 @@ {.push raises: [Defect].} import - secp256k1, bearssl, - nimcrypto/hash, nimcrypto/keccak, - stew/[byteutils, objects, results], strformat + std/strformat, + secp256k1, bearssl, stew/[byteutils, objects, results], + nimcrypto/[hash, keccak] from nimcrypto/utils import burnMem diff --git a/eth/net/nat.nim b/eth/net/nat.nim index c87a3e3..49ecd83 100644 --- a/eth/net/nat.nim +++ b/eth/net/nat.nim @@ -10,7 +10,7 @@ import std/[options, os, strutils, times], stew/results, nat_traversal/[miniupnpc, natpmp], chronicles, json_serialization/std/net, chronos, - eth/common/utils, ./utils as netutils + ../common/utils, ./utils as netutils type NatStrategy* = enum diff --git a/eth/p2p.nim b/eth/p2p.nim index 3e2bc75..a9edfe1 100644 --- a/eth/p2p.nim +++ b/eth/p2p.nim @@ -9,11 +9,10 @@ # import - tables, algorithm, random, bearssl, - chronos, chronos/timer, chronicles, - eth/keys, eth/common/eth_types, - eth/p2p/[kademlia, discovery, enode, peer_pool, rlpx], - eth/p2p/private/p2p_types + std/[tables, algorithm, random], + bearssl, chronos, chronos/timer, chronicles, + ./keys, ./common/eth_types, ./p2p/private/p2p_types, + ./p2p/[kademlia, discovery, enode, peer_pool, rlpx] export p2p_types, rlpx, enode, kademlia diff --git a/eth/p2p/auth.nim b/eth/p2p/auth.nim index 73118e0..b146d25 100644 --- a/eth/p2p/auth.nim +++ b/eth/p2p/auth.nim @@ -12,9 +12,11 @@ {.push raises: [Defect].} -import eth/[keys, rlp], nimcrypto/[rijndael, keccak, utils], bearssl -import ecies -import stew/[byteutils, endians2, objects, results] +import + nimcrypto/[rijndael, keccak, utils], bearssl, + stew/[byteutils, endians2, objects, results], + ".."/[keys, rlp], + ./ecies export results diff --git a/eth/p2p/blockchain_sync.nim b/eth/p2p/blockchain_sync.nim index a1fb370..7819b11 100644 --- a/eth/p2p/blockchain_sync.nim +++ b/eth/p2p/blockchain_sync.nim @@ -1,8 +1,8 @@ import - sets, options, random, hashes, - chronos, chronicles, eth/common/eth_types, - private/p2p_types, rlpx, peer_pool, rlpx_protocols/eth_protocol, - ../p2p + std/[sets, options, random, hashes], + chronos, chronicles, + ../common/eth_types, ../p2p, + ./private/p2p_types, ./rlpx_protocols/eth_protocol, "."/[rlpx, peer_pool] const minPeersToStartSync* = 2 # Wait for consensus of at least this diff --git a/eth/p2p/discovery.nim b/eth/p2p/discovery.nim index d4938a7..07afb90 100644 --- a/eth/p2p/discovery.nim +++ b/eth/p2p/discovery.nim @@ -9,11 +9,11 @@ # import - times, + std/times, chronos, stint, nimcrypto/keccak, chronicles, bearssl, - eth/[keys, rlp], - kademlia, enode, - stew/[objects, results] + stew/[objects, results], + ".."/[keys, rlp], + "."/[kademlia, enode] export Node, results diff --git a/eth/p2p/discoveryv5/dcli.nim b/eth/p2p/discoveryv5/dcli.nim index 42c9393..f56074a 100644 --- a/eth/p2p/discoveryv5/dcli.nim +++ b/eth/p2p/discoveryv5/dcli.nim @@ -3,7 +3,7 @@ import confutils, confutils/std/net, chronicles, chronicles/topics_registry, chronos, metrics, metrics/chronos_httpserver, stew/byteutils, ../../keys, ../../net/nat, - ./enr, ./node, ./protocol + "."/[enr, node, protocol] type DiscoveryCmd* = enum diff --git a/eth/p2p/discoveryv5/encoding.nim b/eth/p2p/discoveryv5/encoding.nim index 56861ae..4b1ecda 100644 --- a/eth/p2p/discoveryv5/encoding.nim +++ b/eth/p2p/discoveryv5/encoding.nim @@ -6,7 +6,8 @@ import std/[tables, options, hashes, net], nimcrypto, stint, chronicles, bearssl, stew/[results, byteutils], - eth/[rlp, keys], messages, node, enr, hkdf, sessions + ".."/../[rlp, keys], + "."/[messages, node, enr, hkdf, sessions] from stew/objects import checkedEnumAssign diff --git a/eth/p2p/discoveryv5/enr.nim b/eth/p2p/discoveryv5/enr.nim index 7e28e37..a993c32 100644 --- a/eth/p2p/discoveryv5/enr.nim +++ b/eth/p2p/discoveryv5/enr.nim @@ -4,7 +4,7 @@ import std/[strutils, macros, algorithm, options], stew/shims/net, stew/base64, nimcrypto, - eth/[rlp, keys] + ".."/../[rlp, keys] export options diff --git a/eth/p2p/discoveryv5/messages.nim b/eth/p2p/discoveryv5/messages.nim index 15876c7..37a4284 100644 --- a/eth/p2p/discoveryv5/messages.nim +++ b/eth/p2p/discoveryv5/messages.nim @@ -5,7 +5,7 @@ import std/[hashes, net], stew/arrayops, - eth/rlp, enr + ../../rlp, ./enr {.push raises: [Defect].} diff --git a/eth/p2p/discoveryv5/node.nim b/eth/p2p/discoveryv5/node.nim index 8319267..23bcf4c 100644 --- a/eth/p2p/discoveryv5/node.nim +++ b/eth/p2p/discoveryv5/node.nim @@ -1,7 +1,7 @@ import std/hashes, nimcrypto, stint, chronos, stew/shims/net, chronicles, - eth/keys, enr + ../../keys, ./enr export stint diff --git a/eth/p2p/discoveryv5/protocol.nim b/eth/p2p/discoveryv5/protocol.nim index 38af1fb..c657602 100644 --- a/eth/p2p/discoveryv5/protocol.nim +++ b/eth/p2p/discoveryv5/protocol.nim @@ -76,8 +76,8 @@ import std/[tables, sets, options, math, sequtils, algorithm], stew/shims/net as stewNet, json_serialization/std/net, stew/endians2, chronicles, chronos, stint, bearssl, metrics, - eth/[rlp, keys, async_utils], - messages, encoding, node, routing_table, enr, random2, sessions, ip_vote + ".."/../[rlp, keys, async_utils], + "."/[messages, encoding, node, routing_table, enr, random2, sessions, ip_vote] import nimcrypto except toHex diff --git a/eth/p2p/discoveryv5/routing_table.nim b/eth/p2p/discoveryv5/routing_table.nim index 00cb68c..41c737b 100644 --- a/eth/p2p/discoveryv5/routing_table.nim +++ b/eth/p2p/discoveryv5/routing_table.nim @@ -2,7 +2,7 @@ import std/[algorithm, times, sequtils, bitops, sets, options], stint, chronicles, metrics, bearssl, chronos, stew/shims/net as stewNet, ../../net/utils, - node, random2, enr + "."/[node, random2, enr] export options diff --git a/eth/p2p/ecies.nim b/eth/p2p/ecies.nim index def513f..d8dbb2b 100644 --- a/eth/p2p/ecies.nim +++ b/eth/p2p/ecies.nim @@ -12,9 +12,10 @@ {.push raises: [Defect].} -import bearssl -import eth/keys, nimcrypto/[rijndael, bcmode, hash, hmac, sha2, utils] -import stew/[results, endians2] +import + bearssl, stew/[results, endians2], + nimcrypto/[rijndael, bcmode, hash, hmac, sha2, utils], + ../keys export results diff --git a/eth/p2p/enode.nim b/eth/p2p/enode.nim index 6181bec..9cef3d9 100644 --- a/eth/p2p/enode.nim +++ b/eth/p2p/enode.nim @@ -10,8 +10,9 @@ {.push raises: [Defect].} -import uri, strutils, net -import eth/keys +import + std/[uri, strutils, net], + ../keys export keys diff --git a/eth/p2p/kademlia.nim b/eth/p2p/kademlia.nim index 7ef2b92..636bcec 100644 --- a/eth/p2p/kademlia.nim +++ b/eth/p2p/kademlia.nim @@ -9,9 +9,10 @@ # import - tables, hashes, times, algorithm, sets, sequtils, bearssl, random, - chronos, eth/keys, chronicles, stint, nimcrypto/keccak, - enode + std/[tables, hashes, times, algorithm, sets, sequtils, random], + chronos, bearssl, chronicles, stint, nimcrypto/keccak, + ../keys, + ./enode export sets # TODO: This should not be needed, but compilation fails otherwise diff --git a/eth/p2p/mock_peers.nim b/eth/p2p/mock_peers.nim index a6cc825..3a9cfe6 100644 --- a/eth/p2p/mock_peers.nim +++ b/eth/p2p/mock_peers.nim @@ -1,7 +1,8 @@ import - macros, deques, algorithm, - chronos, eth/[keys, rlp], eth/common/eth_types, - private/p2p_types, rlpx, ../p2p + std/[macros, deques, algorithm], + chronos, + ".."/[keys, rlp, p2p], ../common/eth_types, + ./private/p2p_types, ./rlpx type Action = proc (p: Peer, data: Rlp): Future[void] {.gcsafe.} diff --git a/eth/p2p/p2p_protocol_dsl.nim b/eth/p2p/p2p_protocol_dsl.nim index 0ef0e9b..0af3880 100644 --- a/eth/p2p/p2p_protocol_dsl.nim +++ b/eth/p2p/p2p_protocol_dsl.nim @@ -1,5 +1,5 @@ import - options, sequtils, + std/[options, sequtils], stew/shims/macros, chronos, faststreams/outputs type diff --git a/eth/p2p/p2p_tracing.nim b/eth/p2p/p2p_tracing.nim index 1e85aca..9dd78fd 100644 --- a/eth/p2p/p2p_tracing.nim +++ b/eth/p2p/p2p_tracing.nim @@ -2,7 +2,7 @@ const tracingEnabled = defined(p2pdump) when tracingEnabled: import - typetraits, + std/typetraits, json_serialization, chronicles #, chronicles_tail/configuration export diff --git a/eth/p2p/peer_pool.nim b/eth/p2p/peer_pool.nim index 58b9226..c4b2c39 100644 --- a/eth/p2p/peer_pool.nim +++ b/eth/p2p/peer_pool.nim @@ -2,9 +2,10 @@ # on the given network. import - os, tables, times, random, sequtils, options, - chronos, chronicles, eth/[rlp, keys, common], - private/p2p_types, discovery, kademlia, rlpx + std/[os, tables, times, random, sequtils, options], + chronos, chronicles, + ".."/[rlp, keys, common], + ./private/p2p_types, "."/[discovery, kademlia, rlpx] const lookupInterval = 5 diff --git a/eth/p2p/private/p2p_types.nim b/eth/p2p/private/p2p_types.nim index 0be9f98..2b52258 100644 --- a/eth/p2p/private/p2p_types.nim +++ b/eth/p2p/private/p2p_types.nim @@ -1,7 +1,8 @@ import - deques, tables, bearssl, - eth/[rlp, keys], chronos, eth/common/eth_types, - ../enode, ../kademlia, ../discovery, ../rlpxcrypt + std/[deques, tables], + bearssl, chronos, + ".."/../[rlp, keys], ".."/../common/eth_types, + ".."/[enode, kademlia, discovery, rlpxcrypt] const useSnappy* = defined(useSnappy) diff --git a/eth/p2p/rlpx.nim b/eth/p2p/rlpx.nim index a4692ab..f749049 100644 --- a/eth/p2p/rlpx.nim +++ b/eth/p2p/rlpx.nim @@ -1,7 +1,8 @@ import - tables, algorithm, deques, hashes, options, typetraits, - stew/shims/macros, chronicles, nimcrypto, chronos, eth/[rlp, common, keys, async_utils], - private/p2p_types, kademlia, auth, rlpxcrypt, enode, p2p_protocol_dsl + std/[tables, algorithm, deques, hashes, options, typetraits], + stew/shims/macros, chronicles, nimcrypto, chronos, + ".."/[rlp, common, keys, async_utils], + ./private/p2p_types, "."/[kademlia, auth, rlpxcrypt, enode, p2p_protocol_dsl] when useSnappy: import snappy diff --git a/eth/p2p/rlpx_protocols/bzz_protocol.nim b/eth/p2p/rlpx_protocols/bzz_protocol.nim index 4a29bd0..49544c4 100644 --- a/eth/p2p/rlpx_protocols/bzz_protocol.nim +++ b/eth/p2p/rlpx_protocols/bzz_protocol.nim @@ -1,5 +1,6 @@ import - chronos, chronicles, eth/p2p + chronos, chronicles, + ../../p2p # Limited bzz protocol that allows for doing a handshake with a peer running # ethersphere/swarm client rev. c535b271536d0dee5bd97c2541ca32a42f272d4f diff --git a/eth/p2p/rlpx_protocols/eth_protocol.nim b/eth/p2p/rlpx_protocols/eth_protocol.nim index 4ca8c62..fb74670 100644 --- a/eth/p2p/rlpx_protocols/eth_protocol.nim +++ b/eth/p2p/rlpx_protocols/eth_protocol.nim @@ -12,8 +12,9 @@ ## https://github.com/ethereum/wiki/wiki/Ethereum-Wire-Protocol import - chronos, stint, chronicles, eth/rlp, eth/common/eth_types, - ../rlpx, ../private/p2p_types, ../blockchain_utils, ../../p2p + chronos, stint, chronicles, + ../../rlp, ../../common/eth_types, ../../p2p, + ../rlpx, ../private/p2p_types, ../blockchain_utils type NewBlockHashesAnnounce* = object diff --git a/eth/p2p/rlpx_protocols/les/flow_control.nim b/eth/p2p/rlpx_protocols/les/flow_control.nim index 9aef7bd..dc33156 100644 --- a/eth/p2p/rlpx_protocols/les/flow_control.nim +++ b/eth/p2p/rlpx_protocols/les/flow_control.nim @@ -1,7 +1,9 @@ import - tables, sets, - chronicles, chronos, eth/rlp, eth/common/eth_types, - ../../rlpx, ../../private/p2p_types, private/les_types + std/[tables, sets], + chronicles, chronos, + ../../../rlp, ../../..//common/eth_types, + ../../rlpx, ../../private/p2p_types, + ./private/les_types const maxSamples = 100000 diff --git a/eth/p2p/rlpx_protocols/les/private/les_types.nim b/eth/p2p/rlpx_protocols/les/private/les_types.nim index b84992e..16aab15 100644 --- a/eth/p2p/rlpx_protocols/les/private/les_types.nim +++ b/eth/p2p/rlpx_protocols/les/private/les_types.nim @@ -1,6 +1,6 @@ import - hashes, tables, sets, - eth/common/eth_types + std/[hashes, tables, sets], + ../../../../common/eth_types type AnnounceType* = enum diff --git a/eth/p2p/rlpx_protocols/les_protocol.nim b/eth/p2p/rlpx_protocols/les_protocol.nim index 18ea897..d1b56e0 100644 --- a/eth/p2p/rlpx_protocols/les_protocol.nim +++ b/eth/p2p/rlpx_protocols/les_protocol.nim @@ -9,11 +9,11 @@ # import - times, tables, options, sets, hashes, strutils, stew/shims/macros, - chronicles, chronos, nimcrypto/[keccak, hash], - eth/[rlp, keys], eth/common/eth_types, - ../rlpx, ../kademlia, ../private/p2p_types, ../blockchain_utils, - les/private/les_types, les/flow_control + std/[times, tables, options, sets, hashes, strutils], + stew/shims/macros, chronicles, chronos, nimcrypto/[keccak, hash], + ../../[rlp, keys], ../../common/eth_types, + ../[rlpx, kademlia, blockchain_utils], ../private/p2p_types, + ./les/private/les_types, ./les/flow_control export les_types diff --git a/eth/p2p/rlpx_protocols/whisper/whisper_types.nim b/eth/p2p/rlpx_protocols/whisper/whisper_types.nim index abc6533..91a6409 100644 --- a/eth/p2p/rlpx_protocols/whisper/whisper_types.nim +++ b/eth/p2p/rlpx_protocols/whisper/whisper_types.nim @@ -9,10 +9,10 @@ # import - algorithm, bitops, math, options, tables, times, strutils, hashes, + std/[algorithm, bitops, math, options, tables, times, strutils, hashes], chronicles, stew/[byteutils, endians2], metrics, bearssl, nimcrypto/[bcmode, hash, keccak, rijndael], - eth/[keys, rlp, p2p], eth/p2p/ecies + ".."/../../[keys, rlp, p2p], ../../ecies logScope: topics = "whisper_types" diff --git a/eth/p2p/rlpx_protocols/whisper_protocol.nim b/eth/p2p/rlpx_protocols/whisper_protocol.nim index 94510bb..88a0e48 100644 --- a/eth/p2p/rlpx_protocols/whisper_protocol.nim +++ b/eth/p2p/rlpx_protocols/whisper_protocol.nim @@ -33,8 +33,10 @@ ## else there will be no peers to send and receive messages from. import - options, tables, times, chronos, chronicles, metrics, - eth/[keys, async_utils, p2p], whisper/whisper_types + std/[options, tables, times], + chronos, chronicles, metrics, + ".."/../[keys, async_utils, p2p], + ./whisper/whisper_types export whisper_types diff --git a/eth/p2p/rlpxcrypt.nim b/eth/p2p/rlpxcrypt.nim index 7d09d9a..0b62148 100644 --- a/eth/p2p/rlpxcrypt.nim +++ b/eth/p2p/rlpxcrypt.nim @@ -12,7 +12,8 @@ {.push raises: [Defect].} -import nimcrypto, stew/results +import + nimcrypto, stew/results from auth import ConnectionSecret export results diff --git a/eth/p2p/sync.nim b/eth/p2p/sync.nim index 7bebeae..0529213 100644 --- a/eth/p2p/sync.nim +++ b/eth/p2p/sync.nim @@ -1,4 +1,6 @@ -import times, chronos +import + std/times, + chronos type FullNodeSyncer* = ref object diff --git a/eth/rlp.nim b/eth/rlp.nim index a683b04..a77475b 100644 --- a/eth/rlp.nim +++ b/eth/rlp.nim @@ -3,9 +3,10 @@ ## https://ethereum.github.io/yellowpaper/paper.pdf import - macros, strutils, stew/byteutils, - rlp/[writer, object_serialization], - rlp/priv/defs + std/[macros, strutils], + stew/byteutils, + ./rlp/[writer, object_serialization], + ./rlp/priv/defs export writer, object_serialization diff --git a/eth/rlp/bin/rlp_inspect.nim b/eth/rlp/bin/rlp_inspect.nim index 6498351..bfdf2e0 100644 --- a/eth/rlp/bin/rlp_inspect.nim +++ b/eth/rlp/bin/rlp_inspect.nim @@ -1,4 +1,6 @@ -import os, ../../rlp +import + std/os, + ../../rlp if paramCount() > 0: echo rlpFromHex(paramStr(1)).inspect diff --git a/eth/rlp/bitseqs.nim b/eth/rlp/bitseqs.nim index 80608d5..a3eb9af 100644 --- a/eth/rlp/bitseqs.nim +++ b/eth/rlp/bitseqs.nim @@ -1,5 +1,6 @@ import - stew/bitseqs, ../rlp + stew/bitseqs, + ../rlp type Bytes = seq[byte] diff --git a/eth/rlp/object_serialization.nim b/eth/rlp/object_serialization.nim index e98f01e..3e6bfb9 100644 --- a/eth/rlp/object_serialization.nim +++ b/eth/rlp/object_serialization.nim @@ -1,4 +1,4 @@ -import macros +import std/macros template rlpIgnore* {.pragma.} ## Specifies that a certain field should be ignored for the purposes diff --git a/eth/rlp/options.nim b/eth/rlp/options.nim index 5f6d2da..f67b454 100644 --- a/eth/rlp/options.nim +++ b/eth/rlp/options.nim @@ -1,5 +1,6 @@ import - std/options, ../rlp + std/options, + ../rlp proc read*[T](rlp: var Rlp, O: type Option[T]): O {.inline.} = mixin read @@ -14,4 +15,3 @@ proc append*(writer: var RlpWriter, value: Option) = export options, rlp - diff --git a/eth/rlp/writer.nim b/eth/rlp/writer.nim index 4669a68..5854cb3 100644 --- a/eth/rlp/writer.nim +++ b/eth/rlp/writer.nim @@ -1,6 +1,6 @@ import - macros, - object_serialization, priv/defs + std/macros, + ./object_serialization, ./priv/defs type RlpWriter* = object diff --git a/eth/trie.nim b/eth/trie.nim index 91f92aa..29bf1f5 100644 --- a/eth/trie.nim +++ b/eth/trie.nim @@ -1,5 +1,5 @@ import - trie/[hexary, sparse_binary] + ./trie/[hexary, sparse_binary] export hexary, sparse_binary diff --git a/eth/trie/binaries.nim b/eth/trie/binaries.nim index b37608e..d988c2a 100644 --- a/eth/trie/binaries.nim +++ b/eth/trie/binaries.nim @@ -1,7 +1,7 @@ import - sequtils, - stew/ranges/ptr_arith, trie_defs, - ./trie_bitseq + std/sequtils, + stew/ranges/ptr_arith, + "."/[trie_defs, trie_bitseq] type TrieNodeKind* = enum diff --git a/eth/trie/binary.nim b/eth/trie/binary.nim index 41c0052..749021b 100644 --- a/eth/trie/binary.nim +++ b/eth/trie/binary.nim @@ -1,6 +1,5 @@ import - ./trie_bitseq, - ./trie_defs, ./db, ./binaries, ./trie_utils + "."/[trie_bitseq, trie_defs, db, binaries, trie_utils] export trie_utils diff --git a/eth/trie/branches.nim b/eth/trie/branches.nim index aeeec87..e3a9cde 100644 --- a/eth/trie/branches.nim +++ b/eth/trie/branches.nim @@ -1,5 +1,5 @@ import - ./trie_defs, ./binary, ./binaries, ./db, ./trie_utils, ./trie_bitseq + "."/[trie_defs, binary, binaries, db, trie_utils, trie_bitseq] type DB = TrieDatabaseRef diff --git a/eth/trie/db.nim b/eth/trie/db.nim index 06c157d..b3ef473 100644 --- a/eth/trie/db.nim +++ b/eth/trie/db.nim @@ -1,7 +1,7 @@ import - tables, hashes, sets, + std/[tables, hashes, sets], nimcrypto/[hash, keccak], - trie_defs, db_tracing + "."/[trie_defs, db_tracing] type MemDBRec = object diff --git a/eth/trie/hexary.nim b/eth/trie/hexary.nim index bf33c77..79caabc 100644 --- a/eth/trie/hexary.nim +++ b/eth/trie/hexary.nim @@ -1,7 +1,8 @@ import - tables, - nimcrypto/[keccak, hash], eth/rlp, - trie_defs, nibbles, db + std/tables, + nimcrypto/[keccak, hash], + ../rlp, + "."/[trie_defs, nibbles, db] type TrieNodeKey = object diff --git a/eth/trie/sparse_binary.nim b/eth/trie/sparse_binary.nim index 9a4cb5f..5571a2f 100644 --- a/eth/trie/sparse_binary.nim +++ b/eth/trie/sparse_binary.nim @@ -1,6 +1,5 @@ import - ./trie_bitseq, - ./trie_defs, ./trie_utils, ./db, ./sparse_proofs + "."/[trie_bitseq, trie_defs, trie_utils, db, sparse_proofs] export trie_utils, trie_bitseq, diff --git a/eth/trie/sparse_proofs.nim b/eth/trie/sparse_proofs.nim index 795b333..c72a689 100644 --- a/eth/trie/sparse_proofs.nim +++ b/eth/trie/sparse_proofs.nim @@ -1,5 +1,5 @@ import - ./trie_bitseq, ./trie_defs, /trie_utils + "."/[trie_bitseq, trie_defs, trie_utils] const treeHeight* = 160 diff --git a/eth/trie/trie_defs.nim b/eth/trie/trie_defs.nim index 61ce3ad..9a317e1 100644 --- a/eth/trie/trie_defs.nim +++ b/eth/trie/trie_defs.nim @@ -1,5 +1,6 @@ import - eth/rlp, nimcrypto/hash + nimcrypto/hash, + ../rlp type KeccakHash* = MDigest[256] diff --git a/eth/trie/trie_utils.nim b/eth/trie/trie_utils.nim index 50989aa..7bb8e2c 100644 --- a/eth/trie/trie_utils.nim +++ b/eth/trie/trie_utils.nim @@ -1,7 +1,7 @@ import stew/byteutils, nimcrypto/[hash, keccak], - trie_defs + ./trie_defs template checkValidHashZ*(x: untyped) = when x.type isnot KeccakHash: diff --git a/tests/db/all_tests.nim b/tests/db/all_tests.nim index 3675947..afb6f62 100644 --- a/tests/db/all_tests.nim +++ b/tests/db/all_tests.nim @@ -1,4 +1,4 @@ import - test_kvstore_rocksdb, - test_kvstore_sqlite3, - test_kvstore + ./test_kvstore_rocksdb, + ./test_kvstore_sqlite3, + ./test_kvstore diff --git a/tests/db/test_kvstore.nim b/tests/db/test_kvstore.nim index 806b935..b0556fb 100644 --- a/tests/db/test_kvstore.nim +++ b/tests/db/test_kvstore.nim @@ -1,7 +1,7 @@ {.used.} import - unittest, + std/unittest, ../../eth/db/kvstore const diff --git a/tests/db/test_kvstore_rocksdb.nim b/tests/db/test_kvstore_rocksdb.nim index cefc815..0e434d4 100644 --- a/tests/db/test_kvstore_rocksdb.nim +++ b/tests/db/test_kvstore_rocksdb.nim @@ -1,8 +1,8 @@ {.used.} import - os, chronicles, - unittest, + std/[os, unittest], + chronicles, ../../eth/db/[kvstore, kvstore_rocksdb], ./test_kvstore diff --git a/tests/db/test_kvstore_sqlite3.nim b/tests/db/test_kvstore_sqlite3.nim index 9c1315c..4f3f6ee 100644 --- a/tests/db/test_kvstore_sqlite3.nim +++ b/tests/db/test_kvstore_sqlite3.nim @@ -1,7 +1,7 @@ {.used.} import - os, + std/os, testutils/unittests, ../../eth/db/[kvstore, kvstore_sqlite3], ./test_kvstore diff --git a/tests/keyfile/test_keyfile.nim b/tests/keyfile/test_keyfile.nim index 0145968..fa353b6 100644 --- a/tests/keyfile/test_keyfile.nim +++ b/tests/keyfile/test_keyfile.nim @@ -9,7 +9,9 @@ {.used.} -import eth/keys, eth/keyfile/[keyfile], json, os, unittest +import + std/[json, os, unittest], + ../../eth/keys, ../../eth/keyfile/[keyfile] # Test vectors copied from # https://github.com/ethereum/tests/blob/develop/KeyStoreTests/basic_tests.json diff --git a/tests/keyfile/test_uuid.nim b/tests/keyfile/test_uuid.nim index 498e30f..0e48719 100644 --- a/tests/keyfile/test_uuid.nim +++ b/tests/keyfile/test_uuid.nim @@ -9,7 +9,9 @@ {.used.} -import eth/keyfile/uuid, unittest +import + unittest, + ../../eth/keyfile/uuid suite "Cross-platform UUID test suite": test "Platform UUID check": diff --git a/tests/keys/disabled_test_key_and_signature_datastructures.nim b/tests/keys/disabled_test_key_and_signature_datastructures.nim index 91191b5..162fa3f 100644 --- a/tests/keys/disabled_test_key_and_signature_datastructures.nim +++ b/tests/keys/disabled_test_key_and_signature_datastructures.nim @@ -7,8 +7,9 @@ # # at your option. This file may not be copied, modified, or distributed except according to those terms. -import eth/keys, #../src/private/conversion_bytes, - ./config +import + ../../eth/keys, #../src/private/conversion_bytes, + ./config import unittest diff --git a/tests/keys/test_keys.nim b/tests/keys/test_keys.nim index f9f1e8e..bb96a46 100644 --- a/tests/keys/test_keys.nim +++ b/tests/keys/test_keys.nim @@ -9,12 +9,12 @@ {.used.} -import unittest -import eth/keys, bearssl -import nimcrypto/hash, nimcrypto/keccak, nimcrypto/utils -from strutils import toLowerAscii +import + std/unittest, + nimcrypto/hash, nimcrypto/keccak, nimcrypto/utils, bearssl, stew/byteutils, + ../../eth/keys -import stew/byteutils +from strutils import toLowerAscii proc compare(x: openarray[byte], y: openarray[byte]): bool = result = len(x) == len(y) diff --git a/tests/keys/test_private_public_key_consistency.nim b/tests/keys/test_private_public_key_consistency.nim index 93f3d34..37711a2 100644 --- a/tests/keys/test_private_public_key_consistency.nim +++ b/tests/keys/test_private_public_key_consistency.nim @@ -9,8 +9,9 @@ {.used.} -import eth/keys, - ./config +import + ../../eth/keys, + ./config import unittest diff --git a/tests/p2p/all_discv5_tests.nim b/tests/p2p/all_discv5_tests.nim index b0fbfe0..520cb6e 100644 --- a/tests/p2p/all_discv5_tests.nim +++ b/tests/p2p/all_discv5_tests.nim @@ -1,8 +1,8 @@ import - test_enr, - test_hkdf, - test_lru, - test_ip_vote, - test_routing_table, - test_discoveryv5_encoding, - test_discoveryv5 + ./test_enr, + ./test_hkdf, + ./test_lru, + ./test_ip_vote, + ./test_routing_table, + ./test_discoveryv5_encoding, + ./test_discoveryv5 diff --git a/tests/p2p/bzz_basic_client.nim b/tests/p2p/bzz_basic_client.nim index bb49922..757ca74 100644 --- a/tests/p2p/bzz_basic_client.nim +++ b/tests/p2p/bzz_basic_client.nim @@ -1,6 +1,9 @@ import - tables, chronos, eth/p2p, eth/p2p/peer_pool, - eth/p2p/rlpx_protocols/bzz_protocol, ./p2p_test_helper + std/tables, + chronos, + ../../eth/p2p, ../../eth/p2p/peer_pool, + ../../eth/p2p/rlpx_protocols/bzz_protocol, + ./p2p_test_helper # Basic bzz test to test handshake with ethersphere/swarm node # Fixed enode string for now diff --git a/tests/p2p/disabled_test_shh_connect_mocked.nim b/tests/p2p/disabled_test_shh_connect_mocked.nim index 23689b2..882d05b 100644 --- a/tests/p2p/disabled_test_shh_connect_mocked.nim +++ b/tests/p2p/disabled_test_shh_connect_mocked.nim @@ -8,8 +8,10 @@ # MIT license (LICENSE-MIT) import - options, unittest, chronos, eth/[rlp, keys, p2p], - eth/p2p/mock_peers, eth/p2p/rlpx_protocols/[whisper_protocol] + std/[options, unittest], + chronos, + ../../eth/[rlp, keys, p2p], + ../../eth/p2p/mock_peers, ../../eth/p2p/rlpx_protocols/[whisper_protocol] proc localAddress(port: int): Address = let port = Port(port) diff --git a/tests/p2p/discv5_test_helper.nim b/tests/p2p/discv5_test_helper.nim index 716b71a..22bdd96 100644 --- a/tests/p2p/discv5_test_helper.nim +++ b/tests/p2p/discv5_test_helper.nim @@ -1,8 +1,8 @@ import stew/shims/net, bearssl, chronos, - eth/keys, - eth/p2p/discoveryv5/[enr, node, routing_table], - eth/p2p/discoveryv5/protocol as discv5_protocol + ../../eth/keys, + ../../eth/p2p/discoveryv5/[enr, node, routing_table], + ../../eth/p2p/discoveryv5/protocol as discv5_protocol export net diff --git a/tests/p2p/les/test_flow_control.nim b/tests/p2p/les/test_flow_control.nim index 1984db5..5277f03 100644 --- a/tests/p2p/les/test_flow_control.nim +++ b/tests/p2p/les/test_flow_control.nim @@ -1,5 +1,5 @@ import - eth/p2p/rlpx_protocols/les/flow_control + ../../../eth/p2p/rlpx_protocols/les/flow_control flow_control.tests() diff --git a/tests/p2p/p2p_test_helper.nim b/tests/p2p/p2p_test_helper.nim index 56c4816..230908a 100644 --- a/tests/p2p/p2p_test_helper.nim +++ b/tests/p2p/p2p_test_helper.nim @@ -1,6 +1,7 @@ import - unittest, chronos, nimcrypto, strutils, bearssl, - eth/[keys, p2p], eth/p2p/[discovery, enode] + std/[unittest, strutils], + chronos, nimcrypto, bearssl, + ../../eth/[keys, p2p], ../../eth/p2p/[discovery, enode] var nextPort = 30303 diff --git a/tests/p2p/shh_basic_client.nim b/tests/p2p/shh_basic_client.nim index 8f384b5..4a6fa0d 100644 --- a/tests/p2p/shh_basic_client.nim +++ b/tests/p2p/shh_basic_client.nim @@ -8,9 +8,10 @@ # MIT license (LICENSE-MIT) import - sequtils, options, strutils, parseopt, chronos, - eth/[keys, rlp, p2p], eth/p2p/rlpx_protocols/[whisper_protocol], - eth/p2p/[discovery, enode, peer_pool, bootnodes, whispernodes] + std/[sequtils, options, strutils, parseopt], + chronos, + ../../eth/[keys, rlp, p2p], eth/p2p/rlpx_protocols/[whisper_protocol], + ../../eth/p2p/[discovery, enode, peer_pool, bootnodes, whispernodes] const DefaultListeningPort = 30303 diff --git a/tests/p2p/test_auth.nim b/tests/p2p/test_auth.nim index c2b9891..1730f7d 100644 --- a/tests/p2p/test_auth.nim +++ b/tests/p2p/test_auth.nim @@ -7,9 +7,10 @@ # distribution, for details about the copyright. # -import unittest -import eth/keys, nimcrypto/[utils, keccak] -import eth/p2p/auth +import + std/unittest, + nimcrypto/[utils, keccak], + ../../eth/keys, ../../eth/p2p/auth # This was generated by `print` actual auth message generated by # https://github.com/ethereum/py-evm/blob/master/tests/p2p/test_auth.py diff --git a/tests/p2p/test_crypt.nim b/tests/p2p/test_crypt.nim index 86e8a14..d67faed 100644 --- a/tests/p2p/test_crypt.nim +++ b/tests/p2p/test_crypt.nim @@ -7,9 +7,10 @@ # distribution, for details about the copyright. # -import unittest -import eth/keys, nimcrypto/[utils, sysrand, keccak] -import eth/p2p/[auth, rlpxcrypt] +import + std/unittest, + nimcrypto/[utils, sysrand, keccak], + ../../eth/keys, ../../eth/p2p/[auth, rlpxcrypt] const data = [ ("initiator_private_key", diff --git a/tests/p2p/test_discovery.nim b/tests/p2p/test_discovery.nim index e5398c1..564e712 100644 --- a/tests/p2p/test_discovery.nim +++ b/tests/p2p/test_discovery.nim @@ -8,8 +8,9 @@ # import - sequtils, unittest, chronos, stew/byteutils, - eth/[keys, rlp], eth/p2p/[discovery, kademlia, enode], + std/[sequtils, unittest], + chronos, stew/byteutils, + ../../eth/[keys, rlp], ../../eth/p2p/[discovery, kademlia, enode], ./p2p_test_helper proc nodeIdInNodes(id: NodeId, nodes: openarray[Node]): bool = diff --git a/tests/p2p/test_discoveryv5.nim b/tests/p2p/test_discoveryv5.nim index 8ffa596..8860db6 100644 --- a/tests/p2p/test_discoveryv5.nim +++ b/tests/p2p/test_discoveryv5.nim @@ -2,10 +2,10 @@ import std/tables, - chronos, chronicles, stint, testutils/unittests, - stew/shims/net, eth/keys, bearssl, - eth/p2p/discoveryv5/[enr, node, routing_table, encoding, sessions, messages], - eth/p2p/discoveryv5/protocol as discv5_protocol, + chronos, chronicles, stint, testutils/unittests, stew/shims/net, bearssl, + ../../eth/keys, + ../../eth/p2p/discoveryv5/[enr, node, routing_table, encoding, sessions, messages], + ../../eth/p2p/discoveryv5/protocol as discv5_protocol, ./discv5_test_helper procSuite "Discovery v5 Tests": diff --git a/tests/p2p/test_discoveryv5_encoding.nim b/tests/p2p/test_discoveryv5_encoding.nim index 2166b4a..4130b34 100644 --- a/tests/p2p/test_discoveryv5_encoding.nim +++ b/tests/p2p/test_discoveryv5_encoding.nim @@ -3,8 +3,8 @@ import std/[unittest, options, sequtils, tables], stint, stew/byteutils, stew/shims/net, - eth/keys, - eth/p2p/discoveryv5/[messages, encoding, enr, node, sessions] + ../../eth/keys, + ../../eth/p2p/discoveryv5/[messages, encoding, enr, node, sessions] let rng = newRng() diff --git a/tests/p2p/test_ecies.nim b/tests/p2p/test_ecies.nim index 7580bbc..6464e32 100644 --- a/tests/p2p/test_ecies.nim +++ b/tests/p2p/test_ecies.nim @@ -7,9 +7,10 @@ # distribution, for details about the copyright. # -import unittest -import eth/keys, nimcrypto/[utils, sha2, hmac, rijndael] -import eth/p2p/ecies +import + std/unittest, + nimcrypto/[utils, sha2, hmac, rijndael], + ../../eth/keys, ../../eth/p2p/ecies proc compare[A, B](x: openarray[A], y: openarray[B], s: int = 0): bool = result = true diff --git a/tests/p2p/test_enode.nim b/tests/p2p/test_enode.nim index d1a29fa..82014d5 100644 --- a/tests/p2p/test_enode.nim +++ b/tests/p2p/test_enode.nim @@ -7,8 +7,9 @@ # Apache License, version 2.0, (LICENSE-APACHEv2) # MIT license (LICENSE-MIT) -import unittest, net, options -import eth/p2p/enode +import + std/[unittest, net, options], + ../../eth/p2p/enode suite "ENode": test "Go-Ethereum tests": diff --git a/tests/p2p/test_enr.nim b/tests/p2p/test_enr.nim index 21e72ec..1a20320 100644 --- a/tests/p2p/test_enr.nim +++ b/tests/p2p/test_enr.nim @@ -3,7 +3,7 @@ import std/[unittest, options, sequtils], nimcrypto/utils, stew/shims/net, - eth/p2p/enode, eth/p2p/discoveryv5/enr, eth/[keys, rlp] + ../../eth/p2p/discoveryv5/enr, ../../eth/[keys, rlp] let rng = newRng() diff --git a/tests/p2p/test_hkdf.nim b/tests/p2p/test_hkdf.nim index 9aa5bea..857420e 100644 --- a/tests/p2p/test_hkdf.nim +++ b/tests/p2p/test_hkdf.nim @@ -3,7 +3,7 @@ import std/unittest, nimcrypto, stew/byteutils, - eth/p2p/discoveryv5/hkdf + ../../eth/p2p/discoveryv5/hkdf proc hextToBytes(s: string): seq[byte] = if s.len != 0: return hexToSeqByte(s) diff --git a/tests/p2p/test_ip_vote.nim b/tests/p2p/test_ip_vote.nim index 5398bd6..7814ee8 100644 --- a/tests/p2p/test_ip_vote.nim +++ b/tests/p2p/test_ip_vote.nim @@ -2,8 +2,8 @@ import std/unittest, - eth/keys, stew/shims/net, - eth/p2p/discoveryv5/[node, ip_vote] + stew/shims/net, + ../../eth/keys, ../../eth/p2p/discoveryv5/[node, ip_vote] suite "IP vote": let rng = newRng() diff --git a/tests/p2p/test_lru.nim b/tests/p2p/test_lru.nim index 84a9e1e..79470fe 100644 --- a/tests/p2p/test_lru.nim +++ b/tests/p2p/test_lru.nim @@ -2,7 +2,7 @@ import std/[unittest, options], - eth/p2p/discoveryv5/lru + ../../eth/p2p/discoveryv5/lru suite "LRUCache": const diff --git a/tests/p2p/test_protocol_handlers.nim b/tests/p2p/test_protocol_handlers.nim index 547d188..1de4d1b 100644 --- a/tests/p2p/test_protocol_handlers.nim +++ b/tests/p2p/test_protocol_handlers.nim @@ -8,8 +8,9 @@ # MIT license (LICENSE-MIT) import - tables, chronos, testutils/unittests, - eth/p2p, + std/tables, + chronos, testutils/unittests, + ../../eth/p2p, ./p2p_test_helper type diff --git a/tests/p2p/test_rlpx_thunk.nim b/tests/p2p/test_rlpx_thunk.nim index 7ba57c1..6c3b1bb 100644 --- a/tests/p2p/test_rlpx_thunk.nim +++ b/tests/p2p/test_rlpx_thunk.nim @@ -1,7 +1,8 @@ import - json, os, stew/byteutils, unittest, chronos, - eth/p2p, eth/p2p/rlpx_protocols/[whisper_protocol, eth_protocol], - ../p2p/p2p_test_helper + std/[json, os, unittest], + chronos, stew/byteutils, + ../../eth/p2p, ../../eth/p2p/rlpx_protocols/[whisper_protocol, eth_protocol], + ./p2p_test_helper let rng = newRng() diff --git a/tests/p2p/test_routing_table.nim b/tests/p2p/test_routing_table.nim index 581e20c..68dc474 100644 --- a/tests/p2p/test_routing_table.nim +++ b/tests/p2p/test_routing_table.nim @@ -2,7 +2,8 @@ import std/unittest, - bearssl, eth/keys, eth/p2p/discoveryv5/[routing_table, node, enr], + bearssl, + ../../eth/keys, ../../eth/p2p/discoveryv5/[routing_table, node, enr], ./discv5_test_helper suite "Routing Table Tests": diff --git a/tests/p2p/test_shh.nim b/tests/p2p/test_shh.nim index 31f6d4e..7e66935 100644 --- a/tests/p2p/test_shh.nim +++ b/tests/p2p/test_shh.nim @@ -8,8 +8,10 @@ # MIT license (LICENSE-MIT) import - sequtils, options, unittest, tables, nimcrypto/hash, - eth/[keys, rlp], eth/p2p/rlpx_protocols/whisper/whisper_types as whisper + std/[sequtils, options, unittest, tables], + nimcrypto/hash, + ../../eth/[keys, rlp], + ../../eth/p2p/rlpx_protocols/whisper/whisper_types as whisper let rng = newRng() diff --git a/tests/p2p/test_shh_config.nim b/tests/p2p/test_shh_config.nim index 01ac113..c086e63 100644 --- a/tests/p2p/test_shh_config.nim +++ b/tests/p2p/test_shh_config.nim @@ -8,8 +8,8 @@ # MIT license (LICENSE-MIT) import - sequtils, options, unittest, times, - eth/p2p/rlpx_protocols/whisper_protocol as whisper + std/[sequtils, options, unittest, times], + ../../eth/p2p/rlpx_protocols/whisper_protocol as whisper suite "Whisper envelope validation": test "should validate and allow envelope according to config": diff --git a/tests/p2p/test_shh_connect.nim b/tests/p2p/test_shh_connect.nim index a3d5270..92242e4 100644 --- a/tests/p2p/test_shh_connect.nim +++ b/tests/p2p/test_shh_connect.nim @@ -8,8 +8,10 @@ # MIT license (LICENSE-MIT) import - sequtils, options, tables, chronos, testutils/unittests, bearssl, - eth/[keys, p2p], eth/p2p/rlpx_protocols/whisper_protocol, eth/p2p/peer_pool, + std/[sequtils, options, tables], + chronos, testutils/unittests, bearssl, + ../../eth/[keys, p2p], ../../eth/p2p/peer_pool, + ../../eth/p2p/rlpx_protocols/whisper_protocol, ./p2p_test_helper proc resetMessageQueues(nodes: varargs[EthereumNode]) = diff --git a/tests/p2p/tserver.nim b/tests/p2p/tserver.nim index ed87ecb..323f9a5 100644 --- a/tests/p2p/tserver.nim +++ b/tests/p2p/tserver.nim @@ -8,9 +8,9 @@ # MIT license (LICENSE-MIT) import - sequtils, strformat, options, testutils/unittests, - chronicles, chronos, eth/[rlp, keys, p2p], - eth/p2p/mock_peers + std/[sequtils, strformat, options], + testutils/unittests, chronicles, chronos, + ../../eth/[rlp, keys, p2p], ../../eth/p2p/mock_peers const clientId = "nim-eth-p2p/0.0.1" diff --git a/tests/rlp/test_api_usage.nim b/tests/rlp/test_api_usage.nim index 4db6f3b..1d23fd4 100644 --- a/tests/rlp/test_api_usage.nim +++ b/tests/rlp/test_api_usage.nim @@ -1,8 +1,9 @@ {.used.} import - math, unittest, strutils, stew/byteutils, - eth/rlp + std/[math, unittest, strutils], + stew/byteutils, + ../../eth/rlp proc q(s: string): string = "\"" & s & "\"" proc i(s: string): string = s.replace(" ").replace("\n") diff --git a/tests/rlp/test_common.nim b/tests/rlp/test_common.nim index 91c5499..4d70b50 100644 --- a/tests/rlp/test_common.nim +++ b/tests/rlp/test_common.nim @@ -1,6 +1,8 @@ {.used.} -import unittest, eth/common, eth/rlp +import + std/unittest, + ../../eth/[common, rlp] proc `==`(a, b: HashOrStatus): bool = result = a.isHash == b.isHash diff --git a/tests/rlp/test_json_suite.nim b/tests/rlp/test_json_suite.nim index 7a83a00..0bd81ed 100644 --- a/tests/rlp/test_json_suite.nim +++ b/tests/rlp/test_json_suite.nim @@ -1,8 +1,8 @@ {.used.} import - os, strutils, strformat, - util/json_testing + std/[os, strutils, strformat], + ./util/json_testing template sourceDir: string = currentSourcePath.rsplit(DirSep, 1)[0] diff --git a/tests/rlp/test_object_serialization.nim b/tests/rlp/test_object_serialization.nim index 67cd5bb..8cf7e16 100644 --- a/tests/rlp/test_object_serialization.nim +++ b/tests/rlp/test_object_serialization.nim @@ -1,7 +1,9 @@ {.used.} import - unittest, times, eth/rlp, stew/byteutils + std/[unittest, times], + stew/byteutils, + ../../eth/rlp type Transaction = object diff --git a/tests/rlp/util/json_testing.nim b/tests/rlp/util/json_testing.nim index ca686aa..43b8d1e 100644 --- a/tests/rlp/util/json_testing.nim +++ b/tests/rlp/util/json_testing.nim @@ -1,5 +1,7 @@ import - json, stew/byteutils, unittest, eth/rlp + std/[json, unittest], + stew/byteutils, + ../../../eth/rlp proc append(output: var RlpWriter, js: JsonNode) = case js.kind diff --git a/tests/test_async_utils.nim b/tests/test_async_utils.nim index 610678e..75726d1 100644 --- a/tests/test_async_utils.nim +++ b/tests/test_async_utils.nim @@ -3,7 +3,8 @@ # The testing framework from Chronicles can be extracted in a separate package. import - chronos, ../eth/async_utils + chronos, + ../eth/async_utils type SomeRecoverableError = object of CatchableError diff --git a/tests/test_bloom.nim b/tests/test_bloom.nim index d4561e4..1e010fa 100644 --- a/tests/test_bloom.nim +++ b/tests/test_bloom.nim @@ -1,4 +1,7 @@ -import eth/bloom, stint, unittest +import + std/unittest, + stint, + ../eth/bloom suite "Simple Bloom Filter tests": test "incl proc": diff --git a/tests/trie/all_tests.nim b/tests/trie/all_tests.nim index 28740e7..e217fb6 100644 --- a/tests/trie/all_tests.nim +++ b/tests/trie/all_tests.nim @@ -1,10 +1,10 @@ import - test_bin_trie, - test_binaries_utils, - test_branches_utils, - test_examples, - test_hexary_trie, - test_json_suite, - test_sparse_binary_trie, - test_transaction_db, - test_trie_bitseq + ./test_bin_trie, + ./test_binaries_utils, + ./test_branches_utils, + ./test_examples, + ./test_hexary_trie, + ./test_json_suite, + ./test_sparse_binary_trie, + ./test_transaction_db, + ./test_trie_bitseq diff --git a/tests/trie/test_bin_trie.nim b/tests/trie/test_bin_trie.nim index 8122638..db02bf7 100644 --- a/tests/trie/test_bin_trie.nim +++ b/tests/trie/test_bin_trie.nim @@ -1,9 +1,10 @@ {.used.} import - unittest, random, - eth/trie/[db, binary], - ./testutils, stew/byteutils + std/[unittest, random], + stew/byteutils, + ../../eth/trie/[db, binary], + ./testutils suite "binary trie": diff --git a/tests/trie/test_binaries_utils.nim b/tests/trie/test_binaries_utils.nim index 4d6c676..4536e5e 100644 --- a/tests/trie/test_binaries_utils.nim +++ b/tests/trie/test_binaries_utils.nim @@ -1,10 +1,10 @@ {.used.} import - unittest, strutils, - nimcrypto/[keccak, hash], - eth/trie/[binaries, trie_bitseq], - ./testutils, stew/byteutils + std/[unittest, strutils], + nimcrypto/[keccak, hash], stew/byteutils, + ../../eth/trie/[binaries, trie_bitseq], + ./testutils proc parseBitVector(x: string): TrieBitSeq = result = genBitVec(x.len) diff --git a/tests/trie/test_branches_utils.nim b/tests/trie/test_branches_utils.nim index 46ada61..d848817 100644 --- a/tests/trie/test_branches_utils.nim +++ b/tests/trie/test_branches_utils.nim @@ -1,8 +1,9 @@ {.used.} import - sets, unittest, strutils, stew/byteutils, - eth/trie/[db, binary, branches] + std/[sets, unittest, strutils], + stew/byteutils, + ../../eth/trie/[db, binary, branches] suite "branches utils": diff --git a/tests/trie/test_examples.nim b/tests/trie/test_examples.nim index 6ca2dc0..760df91 100644 --- a/tests/trie/test_examples.nim +++ b/tests/trie/test_examples.nim @@ -1,9 +1,9 @@ {.used.} import - unittest, stew/byteutils, - nimcrypto/[keccak, hash], - eth/trie/[db, binary, binaries, trie_utils, branches] + std/unittest, + stew/byteutils, nimcrypto/[keccak, hash], + ../../eth/trie/[db, binary, binaries, trie_utils, branches] suite "examples": diff --git a/tests/trie/test_hexary_trie.nim b/tests/trie/test_hexary_trie.nim index dbfaaa1..5ddbc93 100644 --- a/tests/trie/test_hexary_trie.nim +++ b/tests/trie/test_hexary_trie.nim @@ -1,9 +1,10 @@ {.used.} import - unittest, sequtils, os, stew/byteutils, - eth/trie/[hexary, db, trie_defs], nimcrypto/utils, - ./testutils, algorithm, random + std/[unittest, sequtils, os, algorithm, random], + stew/byteutils, nimcrypto/utils, + ../../eth/trie/[hexary, db, trie_defs], + ./testutils from strutils import split diff --git a/tests/trie/test_json_suite.nim b/tests/trie/test_json_suite.nim index f4a9548..5af9c4f 100644 --- a/tests/trie/test_json_suite.nim +++ b/tests/trie/test_json_suite.nim @@ -1,9 +1,9 @@ {.used.} import - os, json, tables, strutils, algorithm, - eth/trie/[db, hexary], - stew/byteutils + std/[os, json, tables, strutils, algorithm], + stew/byteutils, + ../../eth/trie/[db, hexary] type TestOp = object diff --git a/tests/trie/test_sparse_binary_trie.nim b/tests/trie/test_sparse_binary_trie.nim index 8ce508c..4a55064 100644 --- a/tests/trie/test_sparse_binary_trie.nim +++ b/tests/trie/test_sparse_binary_trie.nim @@ -1,8 +1,9 @@ {.used.} import - unittest, random, stew/byteutils, - eth/trie/[db, sparse_binary, sparse_proofs], + std/[unittest, random], + stew/byteutils, + ../../eth/trie/[db, sparse_binary, sparse_proofs], ./testutils suite "sparse binary trie": diff --git a/tests/trie/test_transaction_db.nim b/tests/trie/test_transaction_db.nim index 0e8691a..b1c765b 100644 --- a/tests/trie/test_transaction_db.nim +++ b/tests/trie/test_transaction_db.nim @@ -1,8 +1,9 @@ {.used.} import - unittest, - eth/trie/[db], ./testutils + std/unittest, + ../../eth/trie/db, + ./testutils suite "transaction db": setup: diff --git a/tests/trie/test_trie_bitseq.nim b/tests/trie/test_trie_bitseq.nim index adccb39..bde79ac 100644 --- a/tests/trie/test_trie_bitseq.nim +++ b/tests/trie/test_trie_bitseq.nim @@ -1,8 +1,8 @@ {.used.} import - random, unittest, - eth/trie/trie_bitseq + std/[random, unittest], + ../../eth/trie/trie_bitseq proc randomBytes(n: int): seq[byte] = result = newSeq[byte](n) diff --git a/tests/trie/testutils.nim b/tests/trie/testutils.nim index 059fc0a..8b64925 100644 --- a/tests/trie/testutils.nim +++ b/tests/trie/testutils.nim @@ -1,7 +1,7 @@ import - random, sets, - eth/trie/trie_bitseq, - nimcrypto/[utils, sysrand] + std/[random, sets], + nimcrypto/[utils, sysrand], + ../../eth/trie/trie_bitseq type RandGen*[T] = object