Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: extract duplicate implementation of InfoHash struct #1066

Conversation

josecelano
Copy link
Member

@josecelano josecelano commented Oct 30, 2024

Relates to:

The InfoHash type was duplicated here and in the Index. I've extracted it into a new crate. I'm planning to move the very basic types that we are using in other projects.

I'm also planning to extract more packages like:

  • UDP tracker client
  • HTTP tracker client
  • Tracker console client (after merging UDP console client, HTTP console client and Tracker checker). See Overhaul clients #669

Some of those new packages also depend on this new bittorrent-primitives crate.

@josecelano josecelano linked an issue Oct 30, 2024 that may be closed by this pull request
@josecelano josecelano force-pushed the 360-extract-duplicate-implementation-of-infohash-struct branch from f2c56f3 to 8719b00 Compare October 30, 2024 17:01
@josecelano josecelano marked this pull request as draft October 30, 2024 17:02
The `InfoHash` struct has been extracted into a new crate to be reused
in other projects like the Torrust Index:

https://github.com/torrust/bittorrent-primitives
@josecelano josecelano force-pushed the 360-extract-duplicate-implementation-of-infohash-struct branch from 8719b00 to 7fe648c Compare October 30, 2024 17:07
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.11%. Comparing base (105dfc1) to head (7fe648c).
Report is 3 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1066      +/-   ##
===========================================
- Coverage    77.32%   77.11%   -0.21%     
===========================================
  Files          178      176       -2     
  Lines        10269    10085     -184     
===========================================
- Hits          7940     7777     -163     
+ Misses        2329     2308      -21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@josecelano
Copy link
Member Author

ACK 7fe648c

@josecelano josecelano added this to the v3.1.0 milestone Oct 30, 2024
@josecelano josecelano marked this pull request as ready for review October 30, 2024 18:21
@josecelano josecelano merged commit ad10d1b into torrust:develop Oct 31, 2024
17 checks passed
josecelano added a commit to torrust/torrust-index that referenced this pull request Oct 31, 2024
…struct

569fbd2 chore: remove unused dep binascii (Jose Celano)
e58b314 refactor: replace InfoHash with external extracted crate (Jose Celano)
912715f feat: add dep bittorrent-primitives (Jose Celano)

Pull request description:

  Relates to:
    - torrust/torrust-tracker#360
    - torrust/torrust-tracker#1066

  The `InfoHash` type was duplicated here and in the [Tracker](torrust/torrust-tracker#360). I've extracted it into a new crate:

  https://github.com/torrust/bittorrent-primitives

ACKs for top commit:
  josecelano:
    ACK 569fbd2

Tree-SHA512: a09f849555067a08efe4609c68d38ca690ef7d3d795b81deeb3b6aa8f2cfa235082620745835f26155b80076a78f23c8eb99f46dbfb46a5da67a9c8b54c64691
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extract duplicate implementation of InfoHash struct
1 participant