Skip to content

Commit

Permalink
qtils (#249)
Browse files Browse the repository at this point in the history
- outcome
- hex, unhex
- lexicographical_compare_three_way
- optionTake
- append, bytestr

Signed-off-by: turuslan <turuslan.devbox@gmail.com>
  • Loading branch information
turuslan authored May 29, 2024
1 parent c319206 commit 2e37528
Show file tree
Hide file tree
Showing 32 changed files with 55 additions and 707 deletions.
4 changes: 2 additions & 2 deletions cmake/Hunter/init.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ set(
include(${CMAKE_CURRENT_LIST_DIR}/HunterGate.cmake)

HunterGate(
URL https://github.com/qdrvm/hunter/archive/refs/tags/v0.25.3-qdrvm9.zip
SHA1 7f3f8ee341aaac8c400e776c8a9f28e8fc458296
URL https://github.com/qdrvm/hunter/archive/refs/tags/v0.25.3-qdrvm12.zip
SHA1 9d4b9844b84d3dfbf4a90923eedb3875718abf54
LOCAL
)
3 changes: 3 additions & 0 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ find_package(OpenSSL REQUIRED)
hunter_add_package(Protobuf)
find_package(Protobuf CONFIG REQUIRED)

hunter_add_package(qtils)
find_package(qtils CONFIG REQUIRED)

find_package(Threads)

hunter_add_package(c-ares)
Expand Down
2 changes: 1 addition & 1 deletion include/libp2p/common/final_action.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <optional>
#include <utility>

#include <libp2p/common/option_take.hpp>
#include <qtils/option_take.hpp>

namespace libp2p::common {

Expand Down
62 changes: 0 additions & 62 deletions include/libp2p/common/hexutil.hpp

This file was deleted.

34 changes: 0 additions & 34 deletions include/libp2p/common/option_take.hpp

This file was deleted.

5 changes: 2 additions & 3 deletions include/libp2p/common/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@

#include <array>
#include <cstdint>
#include <qtils/cxx20/lexicographical_compare_three_way.hpp>
#include <span>
#include <vector>

#include <libp2p/cxx20/lexicographical_compare_three_way.hpp>

namespace libp2p::common {
/// Hash160 as a sequence of 20 bytes
using Hash160 = std::array<uint8_t, 20u>;
Expand Down Expand Up @@ -44,7 +43,7 @@ namespace libp2p {

inline auto operator<=>(const SpanOfBytes auto &lhs,
const SpanOfBytes auto &rhs) {
return cxx20::lexicographical_compare_three_way(
return qtils::cxx20::lexicographical_compare_three_way(
lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
}

Expand Down
71 changes: 0 additions & 71 deletions include/libp2p/cxx20/lexicographical_compare_three_way.hpp

This file was deleted.

2 changes: 0 additions & 2 deletions include/libp2p/multi/uvarint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ namespace libp2p::multi {

const std::vector<uint8_t> &toVector() const;

std::string toHex() const;

/**
* Assigns the varint to an unsigned integer, encoding the latter
* @param n the integer to encode and store
Expand Down
122 changes: 0 additions & 122 deletions include/libp2p/outcome/outcome-register.hpp

This file was deleted.

Loading

0 comments on commit 2e37528

Please sign in to comment.