From e5bfb26b5366b24e83e07f259b7b0a261e23c9a5 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Fri, 16 May 2025 11:55:54 -0300 Subject: [PATCH 01/17] Deleted unused library Fix --- CMakeLists.txt | 3 ++- clock/CMakeLists.txt | 10 ------- clock/time.cpp | 59 ----------------------------------------- clock/time.hpp | 33 ----------------------- data_transfer/types.hpp | 2 -- 5 files changed, 2 insertions(+), 105 deletions(-) delete mode 100644 clock/CMakeLists.txt delete mode 100644 clock/time.cpp delete mode 100644 clock/time.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 08fb06d..6780e1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,9 +36,10 @@ find_package(RocksDB CONFIG REQUIRED) option(TESTING "Build tests" ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + add_subdirectory(deps) add_subdirectory(primitives) -add_subdirectory(clock) add_subdirectory(codec) add_subdirectory(common) add_subdirectory(crypto) diff --git a/clock/CMakeLists.txt b/clock/CMakeLists.txt deleted file mode 100644 index 9bb24ad..0000000 --- a/clock/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -add_library(clock - time.cpp - ) -target_compile_definitions(clock PRIVATE - BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG - ) -target_link_libraries(clock - Boost::date_time - outcome - ) diff --git a/clock/time.cpp b/clock/time.cpp deleted file mode 100644 index fffc552..0000000 --- a/clock/time.cpp +++ /dev/null @@ -1,59 +0,0 @@ - -#include "clock/time.hpp" - -#include - -OUTCOME_CPP_DEFINE_CATEGORY_3(sgns::clock, TimeFromStringError, e) { - using sgns::clock::TimeFromStringError; - switch (e) { - case TimeFromStringError::INVALID_FORMAT: - return "Input has invalid format"; - default: - return "Unknown error"; - } -} - -namespace sgns::clock { - static boost::posix_time::ptime kPtimeUnixZero(boost::gregorian::date(1970, - 1, - 1)); - - Time::Time(const UnixTimeNano &unix_time_nano) - : unix_time_nano_(unix_time_nano) {} - - std::string Time::time() const { - return boost::posix_time::to_iso_extended_string( - kPtimeUnixZero - + boost::posix_time::nanoseconds(unix_time_nano_.count())) - + "Z"; - } - - UnixTime Time::unixTime() const { - return std::chrono::duration_cast(unix_time_nano_); - } - - UnixTimeNano Time::unixTimeNano() const { - return unix_time_nano_; - } - - bool Time::operator<(const Time &other) const { - return this->unix_time_nano_ < other.unix_time_nano_; - } - - bool Time::operator==(const Time &other) const { - return this->unix_time_nano_ == other.unix_time_nano_; - } - - IPFS::outcome::result