Skip to content

Commit

Permalink
node: fix clang-tidy after PR 1763 (#1775)
Browse files Browse the repository at this point in the history
  • Loading branch information
canepat authored Jan 23, 2024
1 parent f4da896 commit 7280671
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 21 deletions.
1 change: 0 additions & 1 deletion silkworm/node/db/access_layer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

#include <catch2/catch.hpp>

#include <silkworm/core/chain/genesis.hpp>
#include <silkworm/core/common/bytes_to_string.hpp>
#include <silkworm/core/common/empty_hashes.hpp>
#include <silkworm/core/common/test_util.hpp>
Expand Down
2 changes: 1 addition & 1 deletion silkworm/node/db/memory_mutation_cursor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class MemoryMutationCursor : public RWCursorDupSort {
static inline void throw_error_nodata();
static inline void throw_error_notfound();

enum class MoveType {
enum class MoveType : uint8_t {
kNone,
kNext,
kNextDup,
Expand Down
4 changes: 2 additions & 2 deletions silkworm/node/db/prune_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static BlockAmount read_block_amount_for_key(mdbx::cursor& source, const char* k
value_type = BlockAmount::Type::kOlder;
// For compatibility reasons with Erigon we assume a value == UINT64_MAX means no pruning
if (value == UINT64_MAX) {
return BlockAmount();
return {};
}
} else if (data2.value.as_string() == "before") {
value_type = BlockAmount::Type::kBefore;
Expand All @@ -51,7 +51,7 @@ static BlockAmount read_block_amount_for_key(mdbx::cursor& source, const char* k
}
return BlockAmount(value_type, value);
}
return BlockAmount();
return {};
}

//! \brief Writes the BlockAmount keys in db
Expand Down
12 changes: 6 additions & 6 deletions silkworm/node/db/prune_mode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ using PruneThreshold = std::optional<BlockNum>; // for 'before' type

class BlockAmount {
public:
enum class Type {
enum class Type : uint8_t {
kOlder, // Prune Data Older than (moving window)
kBefore // Prune data before (fixed)
};
Expand Down Expand Up @@ -70,11 +70,11 @@ class PruneMode {

explicit PruneMode(BlockAmount history, BlockAmount receipts, BlockAmount senders, BlockAmount tx_index,
BlockAmount call_traces)
: history_{std::move(history)},
receipts_{std::move(receipts)},
senders_{std::move(senders)},
tx_index_{std::move(tx_index)},
call_traces_{std::move(call_traces)} {}
: history_{history},
receipts_{receipts},
senders_{senders},
tx_index_{tx_index},
call_traces_{call_traces} {}

[[nodiscard]] const BlockAmount& history() const { return history_; }
[[nodiscard]] const BlockAmount& receipts() const { return receipts_; }
Expand Down
1 change: 0 additions & 1 deletion silkworm/node/db/receipt_cbor_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

#include <silkworm/core/common/test_util.hpp>
#include <silkworm/core/common/util.hpp>
#include <silkworm/core/types/transaction.hpp>

namespace silkworm {

Expand Down
9 changes: 0 additions & 9 deletions silkworm/node/db/stages.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,6 @@ inline constexpr const char* kFinishKey{"Finish"};
//! \brief Not an actual stage rather placeholder for global unwind point
inline constexpr const char* kUnwindKey{"Unwind"};

//! \brief Create block for mining
inline constexpr const char* kMiningCreateBlockKey{"MiningCreateBlock"};

//! \brief Execute mining
inline constexpr const char* kMiningExecutionKey{"MiningExecution"};

//! \brief Mining completed
inline constexpr const char* kMiningFinishKey{"MiningFinish"};

//! \brief List of all known stages
inline constexpr const char* kAllStages[]{
kHeadersKey,
Expand Down
2 changes: 1 addition & 1 deletion silkworm/node/db/tables.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ inline constexpr db::MapConfig kAccountChangeSet{kAccountChangeSetName, mdbx::ke
inline constexpr const char* kAccountHistoryName{"AccountHistory"};
inline constexpr db::MapConfig kAccountHistory{kAccountHistoryName};

//! \details Holds blockbody data
//! \details Holds block body data
//! \struct
//! \verbatim
//! key : block number (BE 8 bytes) + block header hash (32 bytes)
Expand Down

0 comments on commit 7280671

Please sign in to comment.