lokinet/pybind/llarp/path/path_hop_config.cpp
Stephen Shelton 273270916e
The Great Wall of Blame
This commit reflects changes to clang-format rules. Unfortunately,
these rule changes create a massive change to the codebase, which
causes an apparent rewrite of git history.

Git blame's --ignore-rev flag can be used to ignore this commit when
attempting to `git blame` some code.
2020-04-07 12:38:56 -06:00

30 lines
828 B
C++

#include <path/path.hpp>
#include "common.hpp"
namespace llarp
{
namespace path
{
void
PathHopConfig_Init(py::module& mod)
{
auto str_func = [](PathHopConfig* hop) {
std::string s = "Hop: [";
s += RouterID(hop->rc.pubkey).ShortString();
s += "] -> [";
s += hop->upstream.ShortString();
s += "]";
return s;
};
py::class_<PathHopConfig>(mod, "PathHopConfig")
.def_readonly("rc", &PathHopConfig::rc)
.def_readonly("upstreamRouter", &PathHopConfig::upstream)
.def_readonly("txid", &PathHopConfig::txID)
.def_readonly("rxid", &PathHopConfig::rxID)
.def("ToString", str_func)
.def("__str__", str_func)
.def("__repr__", str_func);
}
} // namespace path
} // namespace llarp