Rename RPCs to indicate they're operations on wallets.

This commit is contained in:
clemahieu 2017-01-13 19:01:51 -06:00
commit 00b0a2635b
3 changed files with 14 additions and 14 deletions

View file

@ -385,7 +385,7 @@ TEST (rpc, representative)
std::string wallet;
system.nodes [0]->wallets.items.begin ()->first.encode_hex (wallet);
request.put ("wallet", wallet);
request.put ("action", "representative");
request.put ("action", "wallet_representative");
auto response (test_response (request, rpc, system.service));
ASSERT_EQ (boost::network::http::server <rai::rpc>::response::ok, static_cast <uint16_t> (boost::network::http::status (response.second)));
std::string account_text1 (response.first.get <std::string> ("representative"));
@ -406,7 +406,7 @@ TEST (rpc, representative_set)
system.nodes [0]->wallets.items.begin ()->first.encode_hex (wallet);
request.put ("wallet", wallet);
rai::keypair key;
request.put ("action", "representative_set");
request.put ("action", "wallet_representative_set");
request.put ("representative", key.pub.to_account ());
auto response (test_response (request, rpc, system.service));
ASSERT_EQ (boost::network::http::server <rai::rpc>::response::ok, static_cast <uint16_t> (boost::network::http::status (response.second)));

View file

@ -1031,7 +1031,7 @@ void rai::rpc_handler::rai_to_raw ()
}
}
void rai::rpc_handler::representative ()
void rai::rpc_handler::wallet_representative ()
{
std::string wallet_text (request.get <std::string> ("wallet"));
rai::uint256_union wallet;
@ -1057,7 +1057,7 @@ void rai::rpc_handler::representative ()
}
}
void rai::rpc_handler::representative_set ()
void rai::rpc_handler::wallet_representative_set ()
{
if (rpc.config.enable_control)
{
@ -1697,14 +1697,6 @@ void rai::rpc_handler::process_request ()
{
rai_to_raw ();
}
else if (action == "representative")
{
representative ();
}
else if (action == "representative_set")
{
representative_set ();
}
else if (action == "search_pending")
{
search_pending ();
@ -1749,6 +1741,14 @@ void rai::rpc_handler::process_request ()
{
wallet_key_valid ();
}
else if (action == "wallet_representative")
{
wallet_representative ();
}
else if (action == "wallet_representative_set")
{
wallet_representative_set ();
}
else if (action == "work_generate")
{
work_generate ();

View file

@ -112,8 +112,6 @@ public:
void process ();
void rai_to_raw ();
void rai_from_raw ();
void representative ();
void representative_set ();
void search_pending ();
void send ();
void stop ();
@ -125,6 +123,8 @@ public:
void wallet_destroy ();
void wallet_export ();
void wallet_key_valid ();
void wallet_representative ();
void wallet_representative_set ();
void work_generate ();
void work_cancel ();
size_t length;