Adding node vendor version string to version RPC.

This commit is contained in:
clemahieu 2017-01-13 17:27:46 -06:00
commit 6f68d923a0
2 changed files with 2 additions and 0 deletions

View file

@ -1225,6 +1225,7 @@ TEST (rpc, version)
ASSERT_EQ ("1", response1.first.get <std::string> ("rpc_version"));
ASSERT_EQ (boost::network::http::server <rai::rpc>::response::ok, static_cast <uint16_t> (boost::network::http::status (response1.second)));
ASSERT_EQ ("2", response1.first.get <std::string> ("store_version"));
ASSERT_EQ (boost::str (boost::format ("RaiBlocks %1%.%2%.%3%") % RAIBLOCKS_VERSION_MAJOR % RAIBLOCKS_VERSION_MINOR % RAIBLOCKS_VERSION_PATCH), response1.first.get <std::string> ("node_vendor"));
rpc.stop();
thread1.join ();
}

View file

@ -1218,6 +1218,7 @@ void rai::rpc_handler::version ()
boost::property_tree::ptree response_l;
response_l.put ("rpc_version", "1");
response_l.put ("store_version", std::to_string (rpc.node.store_version ()));
response_l.put ("node_vendor", boost::str (boost::format ("RaiBlocks %1%.%2%.%3%") % RAIBLOCKS_VERSION_MAJOR % RAIBLOCKS_VERSION_MINOR % RAIBLOCKS_VERSION_PATCH));
rpc.send_response (connection, response_l);
}