From 07cf801b970050f2180b1b4b4a05e7fad00f2a0f Mon Sep 17 00:00:00 2001 From: Mamy Ratsimbazafy Date: Wed, 6 Feb 2019 17:01:04 +0100 Subject: [PATCH] Rebrand asyncdispatch2 to chronos (#2) * Rebrand asyncdispatch2 to chronos * fix nimble path to chronos --- eth.nimble | 2 +- eth/p2p.nim | 2 +- eth/p2p/blockchain_sync.nim | 2 +- eth/p2p/discovery.nim | 2 +- eth/p2p/kademlia.nim | 2 +- eth/p2p/mock_peers.nim | 2 +- eth/p2p/peer_pool.nim | 2 +- eth/p2p/private/p2p_types.nim | 2 +- eth/p2p/rlpx.nim | 2 +- eth/p2p/rlpx_protocols/eth_protocol.nim | 2 +- eth/p2p/rlpx_protocols/les/flow_control.nim | 2 +- eth/p2p/rlpx_protocols/les_protocol.nim | 2 +- eth/p2p/rlpx_protocols/whisper_protocol.nim | 2 +- eth/p2p/sync.nim | 2 +- tests/p2p/disabled_test_shh_connect_mocked.nim | 2 +- tests/p2p/shh_basic_client.nim | 2 +- tests/p2p/test_discovery.nim | 2 +- tests/p2p/test_shh_connect.nim | 2 +- tests/p2p/tserver.nim | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/eth.nimble b/eth.nimble index 7fc2f72..d9bdab0 100644 --- a/eth.nimble +++ b/eth.nimble @@ -12,7 +12,7 @@ requires "nim >= 0.19.0", "secp256k1", "rocksdb", "package_visible_types", - "asyncdispatch2", + "https://github.com/status-im/nim-chronos", "chronicles" proc test(filename: string) = diff --git a/eth/p2p.nim b/eth/p2p.nim index b8e04ea..a4d0793 100644 --- a/eth/p2p.nim +++ b/eth/p2p.nim @@ -10,7 +10,7 @@ import tables, algorithm, random, - asyncdispatch2, asyncdispatch2/timer, chronicles, + chronos, chronos/timer, chronicles, eth/keys, eth/common/eth_types, eth/p2p/[kademlia, discovery, enode, peer_pool, rlpx], eth/p2p/private/p2p_types diff --git a/eth/p2p/blockchain_sync.nim b/eth/p2p/blockchain_sync.nim index 0dcf8fc..0f34d8c 100644 --- a/eth/p2p/blockchain_sync.nim +++ b/eth/p2p/blockchain_sync.nim @@ -1,6 +1,6 @@ import sets, options, random, hashes, - asyncdispatch2, chronicles, eth/common/eth_types, + chronos, chronicles, eth/common/eth_types, private/p2p_types, rlpx, peer_pool, rlpx_protocols/eth_protocol, ../p2p diff --git a/eth/p2p/discovery.nim b/eth/p2p/discovery.nim index 7c4388f..e36fb85 100644 --- a/eth/p2p/discovery.nim +++ b/eth/p2p/discovery.nim @@ -10,7 +10,7 @@ import times, - asyncdispatch2, eth/[keys, rlp], stint, nimcrypto, chronicles, + chronos, eth/[keys, rlp], stint, nimcrypto, chronicles, kademlia, enode export diff --git a/eth/p2p/kademlia.nim b/eth/p2p/kademlia.nim index a04732b..7c0ba21 100644 --- a/eth/p2p/kademlia.nim +++ b/eth/p2p/kademlia.nim @@ -10,7 +10,7 @@ import tables, hashes, times, algorithm, sets, sequtils, random, - asyncdispatch2, chronicles, eth/keys, stint, nimcrypto, + chronos, chronicles, eth/keys, stint, nimcrypto, 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 7118f2f..911f77d 100644 --- a/eth/p2p/mock_peers.nim +++ b/eth/p2p/mock_peers.nim @@ -1,6 +1,6 @@ import macros, deques, algorithm, - asyncdispatch2, eth/[keys, rlp], eth/common/eth_types, + chronos, eth/[keys, rlp], eth/common/eth_types, private/p2p_types, rlpx, ../p2p type diff --git a/eth/p2p/peer_pool.nim b/eth/p2p/peer_pool.nim index 61fd9af..a2fd544 100644 --- a/eth/p2p/peer_pool.nim +++ b/eth/p2p/peer_pool.nim @@ -3,7 +3,7 @@ import os, tables, times, random, sequtils, - asyncdispatch2, chronicles, eth/[rlp, keys], + chronos, chronicles, eth/[rlp, keys], private/p2p_types, discovery, kademlia, rlpx const diff --git a/eth/p2p/private/p2p_types.nim b/eth/p2p/private/p2p_types.nim index 74d350c..830f5bd 100644 --- a/eth/p2p/private/p2p_types.nim +++ b/eth/p2p/private/p2p_types.nim @@ -1,7 +1,7 @@ import deques, tables, package_visible_types, - eth/[rlp, keys], asyncdispatch2, eth/common/eth_types, + eth/[rlp, keys], chronos, eth/common/eth_types, ../enode, ../kademlia, ../discovery, ../options, ../rlpxcrypt const diff --git a/eth/p2p/rlpx.nim b/eth/p2p/rlpx.nim index ac8b702..75c084d 100644 --- a/eth/p2p/rlpx.nim +++ b/eth/p2p/rlpx.nim @@ -1,6 +1,6 @@ import macros, tables, algorithm, deques, hashes, options, typetraits, - chronicles, nimcrypto, asyncdispatch2, eth/[rlp, common, keys], + chronicles, nimcrypto, chronos, eth/[rlp, common, keys], private/p2p_types, kademlia, auth, rlpxcrypt, enode, p2p_tracing when useSnappy: diff --git a/eth/p2p/rlpx_protocols/eth_protocol.nim b/eth/p2p/rlpx_protocols/eth_protocol.nim index 2dd9f74..cd3fb59 100644 --- a/eth/p2p/rlpx_protocols/eth_protocol.nim +++ b/eth/p2p/rlpx_protocols/eth_protocol.nim @@ -12,7 +12,7 @@ ## https://github.com/ethereum/wiki/wiki/Ethereum-Wire-Protocol import - asyncdispatch2, stint, chronicles, eth/rlp, eth/common/eth_types, + chronos, stint, chronicles, eth/rlp, eth/common/eth_types, ../rlpx, ../private/p2p_types, ../blockchain_utils, ../../p2p type diff --git a/eth/p2p/rlpx_protocols/les/flow_control.nim b/eth/p2p/rlpx_protocols/les/flow_control.nim index 4ac0ce4..80cb282 100644 --- a/eth/p2p/rlpx_protocols/les/flow_control.nim +++ b/eth/p2p/rlpx_protocols/les/flow_control.nim @@ -1,6 +1,6 @@ import tables, sets, - chronicles, asyncdispatch2, eth/rlp, eth/common/eth_types, + chronicles, chronos, eth/rlp, eth/common/eth_types, ../../rlpx, ../../private/p2p_types, private/les_types const diff --git a/eth/p2p/rlpx_protocols/les_protocol.nim b/eth/p2p/rlpx_protocols/les_protocol.nim index 7360c74..c42687d 100644 --- a/eth/p2p/rlpx_protocols/les_protocol.nim +++ b/eth/p2p/rlpx_protocols/les_protocol.nim @@ -10,7 +10,7 @@ import times, tables, options, sets, hashes, strutils, macros, - chronicles, asyncdispatch2, nimcrypto/[keccak, hash], + 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 diff --git a/eth/p2p/rlpx_protocols/whisper_protocol.nim b/eth/p2p/rlpx_protocols/whisper_protocol.nim index 5d6a008..ab20bf8 100644 --- a/eth/p2p/rlpx_protocols/whisper_protocol.nim +++ b/eth/p2p/rlpx_protocols/whisper_protocol.nim @@ -8,7 +8,7 @@ import algorithm, bitops, endians, math, options, sequtils, strutils, tables, times, - secp256k1, chronicles, asyncdispatch2, eth/common/eth_types, eth/[keys, rlp], + secp256k1, chronicles, chronos, eth/common/eth_types, eth/[keys, rlp], hashes, byteutils, nimcrypto/[bcmode, hash, keccak, rijndael, sysrand], eth/p2p, ../ecies diff --git a/eth/p2p/sync.nim b/eth/p2p/sync.nim index 48f9af0..7bebeae 100644 --- a/eth/p2p/sync.nim +++ b/eth/p2p/sync.nim @@ -1,4 +1,4 @@ -import times, asyncdispatch2 +import times, chronos type FullNodeSyncer* = ref object diff --git a/tests/p2p/disabled_test_shh_connect_mocked.nim b/tests/p2p/disabled_test_shh_connect_mocked.nim index b618869..17f1ec6 100644 --- a/tests/p2p/disabled_test_shh_connect_mocked.nim +++ b/tests/p2p/disabled_test_shh_connect_mocked.nim @@ -8,7 +8,7 @@ # MIT license (LICENSE-MIT) import - options, unittest, asyncdispatch2, eth/[rlp, keys, p2p], + options, unittest, chronos, eth/[rlp, keys, p2p], eth/p2p/mock_peers, eth/p2p/rlpx_protocols/[whisper_protocol] proc localAddress(port: int): Address = diff --git a/tests/p2p/shh_basic_client.nim b/tests/p2p/shh_basic_client.nim index d784b8e..38e6dd7 100644 --- a/tests/p2p/shh_basic_client.nim +++ b/tests/p2p/shh_basic_client.nim @@ -8,7 +8,7 @@ # MIT license (LICENSE-MIT) import - sequtils, options, strutils, parseopt, asyncdispatch2, + sequtils, options, strutils, parseopt, chronos, eth/[keys, rlp, p2p], eth/p2p/rlpx_protocols/[whisper_protocol], eth/p2p/[discovery, enode, peer_pool] diff --git a/tests/p2p/test_discovery.nim b/tests/p2p/test_discovery.nim index 915929d..9310897 100644 --- a/tests/p2p/test_discovery.nim +++ b/tests/p2p/test_discovery.nim @@ -8,7 +8,7 @@ # import sequtils, logging -import eth/keys, asyncdispatch2, byteutils +import eth/keys, chronos, byteutils import eth/p2p/[discovery, kademlia, enode] const clientId = "nim-eth-p2p/0.0.1" diff --git a/tests/p2p/test_shh_connect.nim b/tests/p2p/test_shh_connect.nim index 87d8c72..831e664 100644 --- a/tests/p2p/test_shh_connect.nim +++ b/tests/p2p/test_shh_connect.nim @@ -8,7 +8,7 @@ # MIT license (LICENSE-MIT) import - sequtils, options, unittest, tables, asyncdispatch2, eth/[rlp, keys, p2p], + sequtils, options, unittest, tables, chronos, eth/[rlp, keys, p2p], eth/p2p/rlpx_protocols/[whisper_protocol], eth/p2p/[discovery, enode] const diff --git a/tests/p2p/tserver.nim b/tests/p2p/tserver.nim index e5803e3..9428b4e 100644 --- a/tests/p2p/tserver.nim +++ b/tests/p2p/tserver.nim @@ -9,7 +9,7 @@ import sequtils, strformat, options, unittest, - chronicles, asyncdispatch2, eth/[rlp, keys, p2p], + chronicles, chronos, eth/[rlp, keys, p2p], eth/p2p/mock_peers const