Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove noexcept and use updated p2p & hunter #2178

Closed
wants to merge 2 commits into from
Closed
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
6 changes: 3 additions & 3 deletions cmake/Hunter/hunter-gate-url.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
HunterGate(
URL https://github.com/qdrvm/hunter/archive/refs/tags/v0.25.3-qdrvm19.zip
SHA1 eed8b8333c14f25176d4af4fb26256981fd1b527
URL https://github.com/qdrvm/hunter/archive/refs/tags/v0.25.3-qdrvm20.zip
SHA1 954c638fe5b24c76ff8cc11c4713760f7457475e
LOCAL
)
)
4 changes: 2 additions & 2 deletions core/application/impl/app_state_manager_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ namespace kagome::application {
public:
AppStateManagerImpl();
AppStateManagerImpl(const AppStateManagerImpl &) = delete;
AppStateManagerImpl(AppStateManagerImpl &&) noexcept = delete;
AppStateManagerImpl(AppStateManagerImpl &&) = delete;

~AppStateManagerImpl() override;

AppStateManagerImpl &operator=(const AppStateManagerImpl &) = delete;
AppStateManagerImpl &operator=(AppStateManagerImpl &&) noexcept = delete;
AppStateManagerImpl &operator=(AppStateManagerImpl &&) = delete;

void atPrepare(OnPrepare &&cb) override;
void atLaunch(OnLaunch &&cb) override;
Expand Down
4 changes: 2 additions & 2 deletions core/common/blob.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ namespace kagome::common {
/**
* Converts current blob to std::string
*/
std::string toString() const noexcept {
std::string toString() const {
return std::string{this->begin(), this->end()};
}

/**
* Converts current blob to hex string.
*/
std::string toHex() const noexcept {
std::string toHex() const {
return hex_lower({this->begin(), this->end()});
}

Expand Down
2 changes: 1 addition & 1 deletion core/common/buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace kagome::common {
return *this;
}

SLBuffer &operator+=(const BufferView &view) noexcept {
SLBuffer &operator+=(const BufferView &view) {
return put(view);
}

Expand Down
8 changes: 4 additions & 4 deletions core/common/buffer_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ namespace kagome::common {

BufferView(std::initializer_list<uint8_t> &&) = delete;

BufferView(const span &other) noexcept : span(other) {}
BufferView(const span &other) : span(other) {}

template <typename T>
requires std::is_integral_v<std::decay_t<T>> and (sizeof(T) == 1)
BufferView(std::span<T> other) noexcept
BufferView(std::span<T> other)
: span(reinterpret_cast<const uint8_t *>(other.data()), other.size()) {}

template <typename T>
Expand Down Expand Up @@ -71,12 +71,12 @@ namespace kagome::common {
return {reinterpret_cast<const char *>(data()), size()};
}

auto operator<=>(const BufferView &other) const noexcept {
auto operator<=>(const BufferView &other) const {
return qtils::cxx20::lexicographical_compare_three_way(
span::begin(), span::end(), other.begin(), other.end());
}

auto operator==(const BufferView &other) const noexcept {
auto operator==(const BufferView &other) const {
return (*this <=> other) == std::strong_ordering::equal;
}
};
Expand Down
4 changes: 2 additions & 2 deletions core/common/hexutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ OUTCOME_CPP_DEFINE_CATEGORY(kagome::common, UnhexError, e) {
}

namespace kagome::common {
std::string hex_lower(BufferView bytes) noexcept {
std::string hex_lower(BufferView bytes) {
return fmt::format("{:x}", std::span{bytes});
}

std::string hex_lower_0x(BufferView bytes) noexcept {
std::string hex_lower_0x(BufferView bytes) {
return fmt::format("{:0x}", std::span{bytes});
}

Expand Down
4 changes: 2 additions & 2 deletions core/common/hexutil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ namespace kagome::common {
* @param len length of bytes
* @return hexstring
*/
std::string hex_lower(BufferView bytes) noexcept;
std::string hex_lower(BufferView bytes);

/**
* @brief Converts bytes to hex representation with prefix 0x
* @param array bytes
* @return hexstring
*/
std::string hex_lower_0x(BufferView bytes) noexcept;
std::string hex_lower_0x(BufferView bytes);

template <std::output_iterator<uint8_t> Iter>
outcome::result<void> unhex_to(std::string_view hex, Iter out) {
Expand Down
8 changes: 4 additions & 4 deletions core/common/lru_cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ namespace kagome {
class Lockable {
protected:
friend struct LockGuard<Lockable, IsLockable>;
inline void lock() const noexcept {}
inline void unlock() const noexcept {}
inline void lock() const {}
inline void unlock() const {}
};

template <>
class Lockable<true> {
protected:
friend struct LockGuard<Lockable, true>;
inline void lock() const noexcept {
inline void lock() const {
mutex_.lock();
}
inline void unlock() const noexcept {
inline void unlock() const {
mutex_.unlock();
}
mutable std::mutex mutex_;
Expand Down
6 changes: 3 additions & 3 deletions core/common/optref.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ namespace kagome {
return *data;
}

explicit operator bool() const noexcept {
explicit operator bool() const {
return data != nullptr;
}

bool operator!() const noexcept {
bool operator!() const {
return data == nullptr;
}

bool has_value() const noexcept {
bool has_value() const {
return data != nullptr;
}

Expand Down
3 changes: 1 addition & 2 deletions core/common/tagged.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ namespace kagome {

Tagged(T value) : Base(std::move(value)) {}

Tagged &operator=(T &&value) noexcept(
not std::is_lvalue_reference_v<decltype(value)>) {
Tagged &operator=(T &&value) {
if constexpr (std::is_scalar_v<T>) {
this->Wrapper<T>::value = std::forward<T>(value);
} else {
Expand Down
4 changes: 2 additions & 2 deletions core/consensus/consensus_selector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ namespace kagome::consensus {
ConsensusSelector() = default;
virtual ~ConsensusSelector() = default;

ConsensusSelector(ConsensusSelector &&) noexcept = delete;
ConsensusSelector(ConsensusSelector &&) = delete;
ConsensusSelector(const ConsensusSelector &) = delete;
ConsensusSelector &operator=(ConsensusSelector &&) noexcept = delete;
ConsensusSelector &operator=(ConsensusSelector &&) = delete;
ConsensusSelector &operator=(const ConsensusSelector &) = delete;

virtual std::shared_ptr<ProductionConsensus> getProductionConsensus(
Expand Down
4 changes: 2 additions & 2 deletions core/consensus/finality_consensus.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ namespace kagome::consensus {
FinalityConsensus() = default;
virtual ~FinalityConsensus() = default;

FinalityConsensus(FinalityConsensus &&) noexcept = delete;
FinalityConsensus(FinalityConsensus &&) = delete;
FinalityConsensus(const FinalityConsensus &) = delete;
FinalityConsensus &operator=(FinalityConsensus &&) noexcept = delete;
FinalityConsensus &operator=(FinalityConsensus &&) = delete;
FinalityConsensus &operator=(const FinalityConsensus &) = delete;
};

Expand Down
4 changes: 2 additions & 2 deletions core/consensus/production_consensus.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ namespace kagome::consensus {
ProductionConsensus() = default;
virtual ~ProductionConsensus() = default;

ProductionConsensus(ProductionConsensus &&) noexcept = delete;
ProductionConsensus(ProductionConsensus &&) = delete;
ProductionConsensus(const ProductionConsensus &) = delete;
ProductionConsensus &operator=(ProductionConsensus &&) noexcept = delete;
ProductionConsensus &operator=(ProductionConsensus &&) = delete;
ProductionConsensus &operator=(const ProductionConsensus &) = delete;

/// Return true if this consensus is used at start network
Expand Down
4 changes: 2 additions & 2 deletions core/consensus/timeline/slots_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ namespace kagome::consensus {
class SlotsUtil {
public:
SlotsUtil() = default;
SlotsUtil(SlotsUtil &&) noexcept = delete;
SlotsUtil(SlotsUtil &&) = delete;
SlotsUtil(const SlotsUtil &) = delete;

virtual ~SlotsUtil() = default;

SlotsUtil &operator=(SlotsUtil &&) noexcept = delete;
SlotsUtil &operator=(SlotsUtil &&) = delete;
SlotsUtil &operator=(const SlotsUtil &) = delete;

/// @return the duration of a slot in milliseconds
Expand Down
4 changes: 2 additions & 2 deletions core/consensus/timeline/timeline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ namespace kagome::consensus {
Timeline() = default;
virtual ~Timeline() = default;

Timeline(Timeline &&) noexcept = delete;
Timeline(Timeline &&) = delete;
Timeline(const Timeline &) = delete;
Timeline &operator=(Timeline &&) noexcept = delete;
Timeline &operator=(Timeline &&) = delete;
Timeline &operator=(const Timeline &) = delete;

/**
Expand Down
16 changes: 8 additions & 8 deletions core/crypto/bandersnatch/vrf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ namespace kagome::crypto::bandersnatch::vrf {
struct VrfInput {
VrfInput(const ::bandersnatch_VrfInput *ptr) : ptr(ptr) {}
VrfInput(const VrfInput &) = delete;
VrfInput(VrfInput &&x) noexcept : ptr(x.ptr) {
VrfInput(VrfInput &&x) : ptr(x.ptr) {
const_cast<const ::bandersnatch_VrfInput *&>(x.ptr) = nullptr;
}
VrfInput &operator=(const VrfInput &) = delete;
VrfInput &operator=(VrfInput &&x) noexcept = delete;
VrfInput &operator=(VrfInput &&x) = delete;
~VrfInput() {
if (ptr) {
::bandersnatch_vrf_input_free(ptr);
Expand All @@ -39,11 +39,11 @@ namespace kagome::crypto::bandersnatch::vrf {
struct VrfSignData {
VrfSignData(const ::bandersnatch_VrfSignData *ptr) : ptr(ptr) {}
VrfSignData(const VrfSignData &) = delete;
VrfSignData(VrfSignData &&x) noexcept : ptr(x.ptr) {
VrfSignData(VrfSignData &&x) : ptr(x.ptr) {
const_cast<const ::bandersnatch_VrfSignData *&>(x.ptr) = nullptr;
}
VrfSignData &operator=(const VrfSignData &) = delete;
VrfSignData &operator=(VrfSignData &&x) noexcept = delete;
VrfSignData &operator=(VrfSignData &&x) = delete;
~VrfSignData() {
if (ptr) {
::bandersnatch_vrf_sign_data_free(ptr);
Expand All @@ -55,11 +55,11 @@ namespace kagome::crypto::bandersnatch::vrf {
struct RingProver {
RingProver(const ::bandersnatch_RingProver *ptr) : ptr(ptr) {}
RingProver(const RingProver &) = delete;
RingProver(RingProver &&x) noexcept : ptr(x.ptr) {
RingProver(RingProver &&x) : ptr(x.ptr) {
const_cast<const ::bandersnatch_RingProver *&>(x.ptr) = nullptr;
}
RingProver &operator=(const RingProver &) = delete;
RingProver &operator=(RingProver &&x) noexcept = delete;
RingProver &operator=(RingProver &&x) = delete;
~RingProver() {
if (ptr) {
::bandersnatch_ring_prover_free(ptr);
Expand All @@ -71,11 +71,11 @@ namespace kagome::crypto::bandersnatch::vrf {
struct RingVerifier {
RingVerifier(const ::bandersnatch_RingVerifier *ptr) : ptr(ptr) {}
RingVerifier(const RingVerifier &) = delete;
RingVerifier(RingVerifier &&x) noexcept : ptr(x.ptr) {
RingVerifier(RingVerifier &&x) : ptr(x.ptr) {
const_cast<const ::bandersnatch_RingVerifier *&>(x.ptr) = nullptr;
}
RingVerifier &operator=(const RingVerifier &) = delete;
RingVerifier &operator=(RingVerifier &&x) noexcept = delete;
RingVerifier &operator=(RingVerifier &&x) = delete;
~RingVerifier() {
if (ptr) {
::bandersnatch_ring_verifier_free(ptr);
Expand Down
16 changes: 8 additions & 8 deletions core/crypto/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ namespace kagome::crypto {
static_assert(!std::is_const_v<T>,
"Secure clean guard must have write access to the data");

explicit SecureCleanGuard(std::span<T, Size> data) noexcept : data{data} {}
explicit SecureCleanGuard(std::span<T, Size> data) : data{data} {}

template <std::ranges::contiguous_range R>
requires std::ranges::output_range<R, T>
explicit SecureCleanGuard(R &&r) : data{r} {}

SecureCleanGuard(const SecureCleanGuard &) = delete;
SecureCleanGuard &operator=(const SecureCleanGuard &) = delete;
SecureCleanGuard(SecureCleanGuard &&g) noexcept : data{g.data} {
SecureCleanGuard(SecureCleanGuard &&g) : data{g.data} {
g.data = {};
}
SecureCleanGuard &operator=(SecureCleanGuard &&g) = delete;
Expand Down Expand Up @@ -92,7 +92,7 @@ namespace kagome::crypto {
return reinterpret_cast<T *>(p);
}

static void deallocate(pointer p, size_type) noexcept {
static void deallocate(pointer p, size_type) {
OPENSSL_free(p);
}

Expand All @@ -119,18 +119,18 @@ namespace kagome::crypto {
PrivateKey(const PrivateKey &) = default;
PrivateKey &operator=(const PrivateKey &) = default;

PrivateKey(PrivateKey &&key) noexcept = default;
PrivateKey(PrivateKey &&key) = default;

PrivateKey &operator=(PrivateKey &&key) noexcept = default;
PrivateKey &operator=(PrivateKey &&key) = default;

bool operator==(const PrivateKey &) const noexcept = default;
bool operator==(const PrivateKey &) const = default;

template <typename OtherTag>
bool operator==(const PrivateKey<Size, OtherTag> &key) const noexcept {
bool operator==(const PrivateKey<Size, OtherTag> &key) const {
return key == data.view();
}

bool operator==(std::span<const uint8_t> bytes) const noexcept {
bool operator==(std::span<const uint8_t> bytes) const {
return data.view() == bytes;
}

Expand Down
2 changes: 1 addition & 1 deletion core/log/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace kagome::log {
std::weak_ptr<soralog::LoggingSystem> logging_system_;

std::shared_ptr<soralog::LoggingSystem>
ensure_logger_system_is_initialized() noexcept {
ensure_logger_system_is_initialized() {
auto logging_system = logging_system_.lock();
BOOST_ASSERT_MSG(
logging_system,
Expand Down
8 changes: 4 additions & 4 deletions core/network/helpers/message_read_writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ namespace kagome::network {
MessageReadWriter() = default;
~MessageReadWriter() = default;

MessageReadWriter(MessageReadWriter &&) noexcept = default;
MessageReadWriter &operator=(MessageReadWriter &&) noexcept = default;
MessageReadWriter(MessageReadWriter &&) = default;
MessageReadWriter &operator=(MessageReadWriter &&) = default;

MessageReadWriter(const MessageReadWriter &) = delete;
MessageReadWriter &operator=(const MessageReadWriter &) = delete;
Expand Down Expand Up @@ -89,8 +89,8 @@ namespace kagome::network {
MessageReadWriter() = default;
~MessageReadWriter() = default;

MessageReadWriter(MessageReadWriter &&) noexcept = default;
MessageReadWriter &operator=(MessageReadWriter &&) noexcept = default;
MessageReadWriter(MessageReadWriter &&) = default;
MessageReadWriter &operator=(MessageReadWriter &&) = default;

MessageReadWriter(const MessageReadWriter &) = delete;
MessageReadWriter &operator=(const MessageReadWriter &) = delete;
Expand Down
2 changes: 1 addition & 1 deletion core/network/peer_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ namespace kagome::network {
template <>
struct std::hash<kagome::network::FetchedCollation> {
size_t operator()(
const kagome::network::FetchedCollation &value) const noexcept {
const kagome::network::FetchedCollation &value) const {
using CollatorId = kagome::parachain::CollatorId;
using CandidateHash = kagome::parachain::CandidateHash;
using RelayHash = kagome::parachain::RelayHash;
Expand Down
4 changes: 2 additions & 2 deletions core/network/protocol_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ namespace kagome::network {
class ProtocolBase {
public:
ProtocolBase() = default;
ProtocolBase(ProtocolBase &&) noexcept = delete;
ProtocolBase(ProtocolBase &&) = delete;
ProtocolBase(const ProtocolBase &) = delete;
virtual ~ProtocolBase() = default;
ProtocolBase &operator=(ProtocolBase &&) noexcept = delete;
ProtocolBase &operator=(ProtocolBase &&) = delete;
ProtocolBase &operator=(const ProtocolBase &) = delete;

virtual const ProtocolName &protocolName() const = 0;
Expand Down
4 changes: 2 additions & 2 deletions core/network/types/bootstrap_nodes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ namespace kagome::network {
struct BootstrapNodes : public std::vector<libp2p::peer::PeerInfo> {
BootstrapNodes() = delete;
BootstrapNodes(const BootstrapNodes &) = delete;
BootstrapNodes(BootstrapNodes &&) noexcept = delete;
BootstrapNodes(BootstrapNodes &&) = delete;
BootstrapNodes &operator=(const BootstrapNodes &) = delete;
BootstrapNodes &operator=(BootstrapNodes &&) noexcept = delete;
BootstrapNodes &operator=(BootstrapNodes &&) = delete;

BootstrapNodes(const application::AppConfiguration &app_config,
const application::ChainSpec &chain_spec) {
Expand Down
Loading
Loading