Skip to content

Commit 9146681

Browse files
committed
refactor: [#1519] move mod registry
1 parent cfc5b34 commit 9146681

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

packages/swarm-coordination-registry/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ pub mod container;
22
pub mod event;
33
pub mod statistics;
44
pub mod swarm;
5-
pub mod registry;
65

76
use std::sync::Arc;
87

98
use tokio::sync::Mutex;
109
use torrust_tracker_clock::clock;
1110

12-
pub type Swarms = registry::Registry;
11+
pub type Swarms = swarm::registry::Registry;
1312
pub type SwarmHandle = Arc<Mutex<Coordinator>>;
1413
pub type Coordinator = swarm::coordinator::Coordinator;
1514

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
pub mod coordinator;
2+
pub mod registry;

packages/swarm-coordination-registry/src/registry.rs renamed to packages/swarm-coordination-registry/src/swarm/registry.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ mod tests {
510510

511511
use aquatic_udp_protocol::PeerId;
512512

513-
use crate::registry::Registry;
513+
use crate::swarm::registry::Registry;
514514
use crate::tests::{sample_info_hash, sample_peer};
515515

516516
/// It generates a peer id from a number where the number is the last
@@ -581,7 +581,7 @@ mod tests {
581581

582582
use std::sync::Arc;
583583

584-
use crate::registry::Registry;
584+
use crate::swarm::registry::Registry;
585585
use crate::tests::{sample_info_hash, sample_peer};
586586

587587
#[tokio::test]
@@ -617,8 +617,8 @@ mod tests {
617617
use torrust_tracker_primitives::peer::Peer;
618618
use torrust_tracker_primitives::DurationSinceUnixEpoch;
619619

620-
use crate::registry::tests::the_swarm_repository::numeric_peer_id;
621-
use crate::registry::Registry;
620+
use crate::swarm::registry::tests::the_swarm_repository::numeric_peer_id;
621+
use crate::swarm::registry::Registry;
622622
use crate::tests::{sample_info_hash, sample_peer};
623623

624624
#[tokio::test]
@@ -679,8 +679,8 @@ mod tests {
679679
use torrust_tracker_primitives::peer::Peer;
680680
use torrust_tracker_primitives::DurationSinceUnixEpoch;
681681

682-
use crate::registry::tests::the_swarm_repository::numeric_peer_id;
683-
use crate::registry::Registry;
682+
use crate::swarm::registry::tests::the_swarm_repository::numeric_peer_id;
683+
use crate::swarm::registry::Registry;
684684
use crate::tests::{sample_info_hash, sample_peer};
685685

686686
#[tokio::test]
@@ -757,7 +757,7 @@ mod tests {
757757
use torrust_tracker_configuration::TrackerPolicy;
758758
use torrust_tracker_primitives::DurationSinceUnixEpoch;
759759

760-
use crate::registry::Registry;
760+
use crate::swarm::registry::Registry;
761761
use crate::tests::{sample_info_hash, sample_peer};
762762

763763
#[tokio::test]
@@ -851,7 +851,7 @@ mod tests {
851851
use torrust_tracker_primitives::peer::Peer;
852852
use torrust_tracker_primitives::swarm_metadata::SwarmMetadata;
853853

854-
use crate::registry::Registry;
854+
use crate::swarm::registry::Registry;
855855
use crate::tests::{sample_info_hash, sample_peer};
856856
use crate::{Coordinator, SwarmHandle};
857857

@@ -912,10 +912,10 @@ mod tests {
912912

913913
use torrust_tracker_primitives::swarm_metadata::SwarmMetadata;
914914

915-
use crate::registry::tests::the_swarm_repository::returning_torrent_entries::{
915+
use crate::swarm::registry::tests::the_swarm_repository::returning_torrent_entries::{
916916
torrent_entry_info, TorrentEntryInfo,
917917
};
918-
use crate::registry::Registry;
918+
use crate::swarm::registry::Registry;
919919
use crate::tests::{sample_info_hash, sample_peer};
920920

921921
#[tokio::test]
@@ -952,10 +952,10 @@ mod tests {
952952
use torrust_tracker_primitives::pagination::Pagination;
953953
use torrust_tracker_primitives::swarm_metadata::SwarmMetadata;
954954

955-
use crate::registry::tests::the_swarm_repository::returning_torrent_entries::{
955+
use crate::swarm::registry::tests::the_swarm_repository::returning_torrent_entries::{
956956
torrent_entry_info, TorrentEntryInfo,
957957
};
958-
use crate::registry::Registry;
958+
use crate::swarm::registry::Registry;
959959
use crate::tests::{
960960
sample_info_hash_alphabetically_ordered_after_sample_info_hash_one, sample_info_hash_one,
961961
sample_peer_one, sample_peer_two,
@@ -1061,7 +1061,7 @@ mod tests {
10611061
use bittorrent_primitives::info_hash::fixture::gen_seeded_infohash;
10621062
use torrust_tracker_primitives::swarm_metadata::AggregateActiveSwarmMetadata;
10631063

1064-
use crate::registry::Registry;
1064+
use crate::swarm::registry::Registry;
10651065
use crate::tests::{complete_peer, leecher, sample_info_hash, seeder};
10661066

10671067
// todo: refactor to use test parametrization
@@ -1183,7 +1183,7 @@ mod tests {
11831183

11841184
use torrust_tracker_primitives::DurationSinceUnixEpoch;
11851185

1186-
use crate::registry::Registry;
1186+
use crate::swarm::registry::Registry;
11871187
use crate::tests::{sample_info_hash, sample_peer};
11881188

11891189
#[tokio::test]
@@ -1210,7 +1210,7 @@ mod tests {
12101210
mod it_should_count_peers {
12111211
use std::sync::Arc;
12121212

1213-
use crate::registry::Registry;
1213+
use crate::swarm::registry::Registry;
12141214
use crate::tests::{sample_info_hash, sample_peer};
12151215

12161216
#[tokio::test]
@@ -1238,7 +1238,7 @@ mod tests {
12381238

12391239
use torrust_tracker_primitives::swarm_metadata::SwarmMetadata;
12401240

1241-
use crate::registry::Registry;
1241+
use crate::swarm::registry::Registry;
12421242
use crate::tests::{leecher, sample_info_hash};
12431243

12441244
#[tokio::test]
@@ -1277,7 +1277,7 @@ mod tests {
12771277

12781278
use torrust_tracker_primitives::NumberOfDownloadsBTreeMap;
12791279

1280-
use crate::registry::Registry;
1280+
use crate::swarm::registry::Registry;
12811281
use crate::tests::{leecher, sample_info_hash};
12821282

12831283
#[tokio::test]
@@ -1353,7 +1353,7 @@ mod tests {
13531353

13541354
use crate::event::sender::tests::{expect_event_sequence, MockEventSender};
13551355
use crate::event::Event;
1356-
use crate::registry::Registry;
1356+
use crate::swarm::registry::Registry;
13571357
use crate::tests::sample_info_hash;
13581358

13591359
#[tokio::test]

0 commit comments

Comments
 (0)