Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -73,7 +74,6 @@ install(TARGETS ipfs_blockservice
buffer rocksdb_wrapper cid ipld_node cbor ipfs_lite_hasher logger
hexutil
blake2
ipld_link
outcome
tinycbor
ipld_block
Expand Down
10 changes: 0 additions & 10 deletions clock/CMakeLists.txt

This file was deleted.

59 changes: 0 additions & 59 deletions clock/time.cpp

This file was deleted.

33 changes: 0 additions & 33 deletions clock/time.hpp

This file was deleted.

1 change: 0 additions & 1 deletion codec/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
add_subdirectory(cbor)
add_subdirectory(rle)
1 change: 0 additions & 1 deletion codec/cbor/cbor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include "codec/cbor/cbor_decode_stream.hpp"
#include "codec/cbor/cbor_encode_stream.hpp"
#include "codec/cbor/cbor_resolve.hpp"
#include "common/buffer.hpp"

namespace sgns::codec::cbor {
Expand Down
3 changes: 3 additions & 0 deletions codec/cbor/cbor_encode_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,20 @@ namespace sgns::codec::cbor {
if (maybe_cid_bytes.has_error()) {
IPFS::outcome::raise(CborEncodeError::INVALID_CID);
}

auto cid_bytes = maybe_cid_bytes.value();
cid_bytes.insert(cid_bytes.begin(), 0);

std::array<uint8_t, 9> encoded{0};

CborEncoder encoder;
cbor_encoder_init(&encoder, encoded.data(), encoded.size(), 0);
cbor_encode_tag(&encoder, kCidTag);
data_.insert(data_.end(),
encoded.begin(),
encoded.begin()
+ cbor_encoder_get_buffer_size(&encoder, encoded.data()));

*this << cid_bytes;
return *this;
}
Expand Down
4 changes: 2 additions & 2 deletions codec/cbor/cbor_encode_stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#include "codec/cbor/cbor_common.hpp"

#include <array>
#include <type_traits>
#include <vector>

#include <cbor.h>

#include "common/enum.hpp"
#include "platform/platform.hpp"

namespace sgns::codec::cbor {
Expand All @@ -23,7 +23,7 @@ namespace sgns::codec::cbor {
typename = std::enable_if_t<std::is_integral_v<T> || std::is_enum_v<T>>>
CborEncodeStream &operator<<(T num) {
if constexpr (std::is_enum_v<T>) {
return *this << common::to_int(num);
return *this << static_cast<std::underlying_type<T>>(num);
}
addCount(1);
std::array<uint8_t, 9> buffer{0};
Expand Down
9 changes: 0 additions & 9 deletions codec/rle/CMakeLists.txt

This file was deleted.

49 changes: 0 additions & 49 deletions codec/rle/rle_plus.hpp

This file was deleted.

43 changes: 0 additions & 43 deletions codec/rle/rle_plus_config.hpp

This file was deleted.

Loading