Skip to content

Commit

Permalink
Fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
swatanabe committed Aug 8, 2023
1 parent e17ada8 commit c68e957
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libraries/net/include/psibase/shortest_path_routing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ namespace psibase::net
}
};

template <typename Derived, typename Msg>
concept has_validate_message =
requires(Derived& d, const Msg& msg) { d.consensus().validate_message(msg); };

struct RouteUpdateMessage
{
static constexpr unsigned type = 4;
Expand Down Expand Up @@ -520,8 +524,8 @@ namespace psibase::net
}
}
template <typename T>
requires has_validate_message<Derived, T>
auto validate_message(const SignedMessage<T>& msg)
-> decltype(consensus().validate_message(*msg.data))
{
try
{
Expand All @@ -534,7 +538,8 @@ namespace psibase::net
return consensus().validate_message(*msg.data);
}
template <typename T>
auto validate_message(const T& msg) -> decltype(consensus().validate_message(msg))
requires has_validate_message<Derived, T>
auto validate_message(const T& msg)
{
return consensus().validate_message(msg);
}
Expand Down

0 comments on commit c68e957

Please sign in to comment.