Skip to content

Commit

Permalink
Apply formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Jan 30, 2024
1 parent a78fa1f commit c5df1a5
Show file tree
Hide file tree
Showing 21 changed files with 70 additions and 70 deletions.
6 changes: 3 additions & 3 deletions nano/lib/errors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,9 @@ nano::error::operator std::string () const
}

/**
* Get error message, or an empty string if there's no error. If a custom error message is set,
* that will be returned, otherwise the error_code#message() is returned.
*/
* Get error message, or an empty string if there's no error. If a custom error message is set,
* that will be returned, otherwise the error_code#message() is returned.
*/
std::string nano::error::get_message () const
{
std::string res = message;
Expand Down
2 changes: 1 addition & 1 deletion nano/lib/ipc_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ namespace ipc
}

/**
* Returns a buffer with an IPC preamble for the given \p encoding_a followed by the payload. Depending on encoding,
* Returns a buffer with an IPC preamble for the given \p encoding_a followed by the payload. Depending on encoding,
* the buffer may contain a payload length or end sentinel.
*/
nano::shared_const_buffer prepare_request (nano::ipc::payload_encoding encoding_a, std::string const & payload_a);
Expand Down
2 changes: 1 addition & 1 deletion nano/lib/jsonconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ nano::jsonconfig::jsonconfig (boost::property_tree::ptree & tree_a, std::shared_
}

/**
* Reads a json object from the stream
* Reads a json object from the stream
* @return nano::error&, including a descriptive error message if the config file is malformed.
*/
nano::error & nano::jsonconfig::read (std::filesystem::path const & path_a)
Expand Down
6 changes: 3 additions & 3 deletions nano/lib/locks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class unique_lock final
};

/** Assumes std implementations of std::condition_variable never actually call nano::unique_lock::lock/unlock,
but instead use OS intrinsics with the mutex handle directly. Due to this we also do not account for any
but instead use OS intrinsics with the mutex handle directly. Due to this we also do not account for any
time the condition variable is blocked on another holder of the mutex. */
class condition_variable final
{
Expand Down Expand Up @@ -283,7 +283,7 @@ class locked
owner->mutex.unlock ();
}

T * operator-> ()
T * operator->()
{
return &owner->obj;
}
Expand All @@ -301,7 +301,7 @@ class locked
locked * owner{ nullptr };
};

scoped_lock operator-> ()
scoped_lock operator->()
{
return scoped_lock (this);
}
Expand Down
4 changes: 2 additions & 2 deletions nano/lib/memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ bool get_use_memory_pools ();
void set_use_memory_pools (bool use_memory_pools);

/** This makes some heuristic assumptions about the implementation defined shared_ptr internals.
Should only be used in the memory pool purge functions at exit, which doesn't matter much if
it is incorrect (other than reports from heap memory analysers) */
Should only be used in the memory pool purge functions at exit, which doesn't matter much if
it is incorrect (other than reports from heap memory analysers) */
template <typename T>
constexpr size_t determine_shared_ptr_pool_size ()
{
Expand Down
8 changes: 4 additions & 4 deletions nano/lib/optional_ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ class optional_ptr
return *ptr;
}

T * const operator-> ()
T * const operator->()
{
return ptr.operator-> ();
return ptr.operator->();
}

T const * const operator-> () const
T const * const operator->() const
{
return ptr.operator-> ();
return ptr.operator->();
}

T const * const get () const
Expand Down
4 changes: 2 additions & 2 deletions nano/lib/tomlconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ std::shared_ptr<cpptoml::array> nano::tomlconfig::create_array (std::string cons
}

/**
* Erase keys whose values are equal to the one in \p defaults
*/
* Erase keys whose values are equal to the one in \p defaults
*/
void nano::tomlconfig::erase_default_values (tomlconfig & defaults_a)
{
std::shared_ptr<cpptoml::table> clone = std::dynamic_pointer_cast<cpptoml::table> (tree->clone ());
Expand Down
8 changes: 4 additions & 4 deletions nano/slow_test/bootstrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ TEST (bootstrap_ascending, profile)
flags_server.disable_ongoing_bootstrap = true;
flags_server.disable_ascending_bootstrap = true;
auto data_path_server = nano::working_path (network);
//auto data_path_server = "";
// auto data_path_server = "";
auto server = std::make_shared<nano::node> (system.io_ctx, data_path_server, config_server, system.work, flags_server);
system.nodes.push_back (server);
server->start ();
Expand All @@ -93,10 +93,10 @@ TEST (bootstrap_ascending, profile)
config_client.ipc_config.transport_tcp.enabled = true;
// Disable database integrity safety for higher throughput
config_client.lmdb_config.sync = nano::lmdb_config::sync_strategy::nosync_unsafe;
//auto client = system.add_node (config_client, flags_client);
// auto client = system.add_node (config_client, flags_client);

// macos 16GB RAM disk: diskutil erasevolume HFS+ "RAMDisk" `hdiutil attach -nomount ram://33554432`
//auto data_path_client = "/Volumes/RAMDisk";
// auto data_path_client = "/Volumes/RAMDisk";
auto data_path_client = nano::unique_path ();
auto client = std::make_shared<nano::node> (system.io_ctx, data_path_client, config_client, system.work, flags_client);
system.nodes.push_back (client);
Expand Down Expand Up @@ -186,7 +186,7 @@ TEST (bootstrap_ascending, profile)
rate.observe (*client, nano::stat::type::ledger, nano::stat::detail::gap_previous, nano::stat::dir::in);
rate.background_print (3s);

//wait_for_key ();
// wait_for_key ();
while (true)
{
nano::test::establish_tcp (system, *client, server->network.endpoint ());
Expand Down
2 changes: 1 addition & 1 deletion nano/store/iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class iterator final
return *this;
}
iterator<T, U> & operator= (iterator<T, U> const &) = delete;
std::pair<T, U> * operator-> ()
std::pair<T, U> * operator->()
{
return &current;
}
Expand Down
24 changes: 12 additions & 12 deletions nano/store/lmdb/account.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@ class account : public nano::store::account
void for_each_par (std::function<void (store::read_transaction const &, store::iterator<nano::account, nano::account_info>, store::iterator<nano::account, nano::account_info>)> const & action_a) const override;

/**
* Maps account v1 to account information, head, rep, open, balance, timestamp and block count. (Removed)
* nano::account -> nano::block_hash, nano::block_hash, nano::block_hash, nano::amount, uint64_t, uint64_t
*/
* Maps account v1 to account information, head, rep, open, balance, timestamp and block count. (Removed)
* nano::account -> nano::block_hash, nano::block_hash, nano::block_hash, nano::amount, uint64_t, uint64_t
*/
MDB_dbi accounts_v0_handle{ 0 };

/**
* Maps account v0 to account information, head, rep, open, balance, timestamp and block count. (Removed)
* nano::account -> nano::block_hash, nano::block_hash, nano::block_hash, nano::amount, uint64_t, uint64_t
*/
* Maps account v0 to account information, head, rep, open, balance, timestamp and block count. (Removed)
* nano::account -> nano::block_hash, nano::block_hash, nano::block_hash, nano::amount, uint64_t, uint64_t
*/
MDB_dbi accounts_v1_handle{ 0 };

/**
* Maps account v0 to account information, head, rep, open, balance, timestamp, block count and epoch
* nano::account -> nano::block_hash, nano::block_hash, nano::block_hash, nano::amount, uint64_t, uint64_t, nano::epoch
*/
* Maps account v0 to account information, head, rep, open, balance, timestamp, block count and epoch
* nano::account -> nano::block_hash, nano::block_hash, nano::block_hash, nano::amount, uint64_t, uint64_t, nano::epoch
*/
MDB_dbi accounts_handle{ 0 };

/**
* Representative weights. (Removed)
* nano::account -> nano::uint128_t
*/
* Representative weights. (Removed)
* nano::account -> nano::uint128_t
*/
MDB_dbi representation_handle{ 0 };
};
} // amespace nano::store::lmdb
6 changes: 3 additions & 3 deletions nano/store/lmdb/block.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class block : public nano::store::block
void for_each_par (std::function<void (store::read_transaction const &, store::iterator<nano::block_hash, block_w_sideband>, store::iterator<nano::block_hash, block_w_sideband>)> const & action_a) const override;

/**
* Contains block_sideband and block for all block types (legacy send/change/open/receive & state blocks)
* nano::block_hash -> nano::block_sideband, nano::block
*/
* Contains block_sideband and block for all block types (legacy send/change/open/receive & state blocks)
* nano::block_hash -> nano::block_sideband, nano::block
*/
MDB_dbi blocks_handle{ 0 };

protected:
Expand Down
6 changes: 3 additions & 3 deletions nano/store/lmdb/confirmation_height.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class confirmation_height : public nano::store::confirmation_height
void for_each_par (std::function<void (store::read_transaction const &, store::iterator<nano::account, nano::confirmation_height_info>, store::iterator<nano::account, nano::confirmation_height_info>)> const & action_a) const override;

/*
* Confirmation height of an account, and the hash for the block at that height
* nano::account -> uint64_t, nano::block_hash
*/
* Confirmation height of an account, and the hash for the block at that height
* nano::account -> uint64_t, nano::block_hash
*/
MDB_dbi confirmation_height_handle{ 0 };
};
} // namespace nano::store::lmdb
6 changes: 3 additions & 3 deletions nano/store/lmdb/final_vote.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class final_vote : public nano::store::final_vote
void for_each_par (std::function<void (store::read_transaction const &, store::iterator<nano::qualified_root, nano::block_hash>, store::iterator<nano::qualified_root, nano::block_hash>)> const & action_a) const override;

/**
* Maps root to block hash for generated final votes.
* nano::qualified_root -> nano::block_hash
*/
* Maps root to block hash for generated final votes.
* nano::qualified_root -> nano::block_hash
*/
MDB_dbi final_votes_handle{ 0 };
};
} // namespace nano::store::lmdb
6 changes: 3 additions & 3 deletions nano/store/lmdb/frontier.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class frontier : public nano::store::frontier
void for_each_par (std::function<void (store::read_transaction const &, store::iterator<nano::block_hash, nano::account>, store::iterator<nano::block_hash, nano::account>)> const & action_a) const override;

/**
* Maps head block to owning account
* nano::block_hash -> nano::account
*/
* Maps head block to owning account
* nano::block_hash -> nano::account
*/
MDB_dbi frontiers_handle{ 0 };
};
} // namespace nano::store::lmdb
6 changes: 3 additions & 3 deletions nano/store/lmdb/iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class iterator : public iterator_impl<T, U>
return *this;
}

std::pair<store::db_val<MDB_val>, store::db_val<MDB_val>> * operator-> ()
std::pair<store::db_val<MDB_val>, store::db_val<MDB_val>> * operator->()
{
return &current;
}
Expand Down Expand Up @@ -213,9 +213,9 @@ class merge_iterator : public iterator_impl<T, U>
return *this;
}

std::pair<store::db_val<MDB_val>, store::db_val<MDB_val>> * operator-> ()
std::pair<store::db_val<MDB_val>, store::db_val<MDB_val>> * operator->()
{
return least_iterator ().operator-> ();
return least_iterator ().operator->();
}

bool operator== (merge_iterator<T, U> const & other) const
Expand Down
6 changes: 3 additions & 3 deletions nano/store/lmdb/online_weight.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class online_weight : public nano::store::online_weight
void clear (store::write_transaction const & transaction_a) override;

/**
* Samples of online vote weight
* uint64_t -> nano::amount
*/
* Samples of online vote weight
* uint64_t -> nano::amount
*/
MDB_dbi online_weight_handle{ 0 };
};
} // namespace nano::store::lmdb
6 changes: 3 additions & 3 deletions nano/store/lmdb/peer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class peer : public nano::store::peer
store::iterator<nano::endpoint_key, nano::no_value> end () const override;

/*
* Endpoints for peers
* nano::endpoint_key -> no_value
*/
* Endpoints for peers
* nano::endpoint_key -> no_value
*/
MDB_dbi peers_handle{ 0 };
};
} // namespace nano::store::lmdb
18 changes: 9 additions & 9 deletions nano/store/lmdb/pending.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ class pending : public nano::store::pending
void for_each_par (std::function<void (store::read_transaction const &, store::iterator<nano::pending_key, nano::pending_info>, store::iterator<nano::pending_key, nano::pending_info>)> const & action_a) const override;

/**
* Maps min_version 0 (destination account, pending block) to (source account, amount). (Removed)
* nano::account, nano::block_hash -> nano::account, nano::amount
*/
* Maps min_version 0 (destination account, pending block) to (source account, amount). (Removed)
* nano::account, nano::block_hash -> nano::account, nano::amount
*/
MDB_dbi pending_v0_handle{ 0 };

/**
* Maps min_version 1 (destination account, pending block) to (source account, amount). (Removed)
* nano::account, nano::block_hash -> nano::account, nano::amount
*/
* Maps min_version 1 (destination account, pending block) to (source account, amount). (Removed)
* nano::account, nano::block_hash -> nano::account, nano::amount
*/
MDB_dbi pending_v1_handle{ 0 };

/**
* Maps (destination account, pending block) to (source account, amount, version). (Removed)
* nano::account, nano::block_hash -> nano::account, nano::amount, nano::epoch
*/
* Maps (destination account, pending block) to (source account, amount, version). (Removed)
* nano::account, nano::block_hash -> nano::account, nano::amount, nano::epoch
*/
MDB_dbi pending_handle{ 0 };
};
} // namespace nano::store::lmdb
6 changes: 3 additions & 3 deletions nano/store/lmdb/pruned.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class pruned : public nano::store::pruned
void for_each_par (std::function<void (store::read_transaction const &, store::iterator<nano::block_hash, std::nullptr_t>, store::iterator<nano::block_hash, std::nullptr_t>)> const & action_a) const override;

/**
* Pruned blocks hashes
* nano::block_hash -> none
*/
* Pruned blocks hashes
* nano::block_hash -> none
*/
MDB_dbi pruned_handle{ 0 };
};
} // namespace nano::store::lmdb
6 changes: 3 additions & 3 deletions nano/store/lmdb/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ class version : public nano::store::version
int get (store::transaction const & transaction_a) const override;

/**
* Meta information about block store, such as versions.
* nano::uint256_union (arbitrary key) -> blob
*/
* Meta information about block store, such as versions.
* nano::uint256_union (arbitrary key) -> blob
*/
MDB_dbi meta_handle{ 0 };
};
} // namespace nano::store::lmdb
2 changes: 1 addition & 1 deletion nano/store/rocksdb/iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class iterator : public iterator_impl<T, U>
return *this;
}

std::pair<nano::store::rocksdb::db_val, nano::store::rocksdb::db_val> * operator-> ()
std::pair<nano::store::rocksdb::db_val, nano::store::rocksdb::db_val> * operator->()
{
return &current;
}
Expand Down

0 comments on commit c5df1a5

Please sign in to comment.