Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #9942 from EOSIO/qy-cleos-net-peers-error
Browse files Browse the repository at this point in the history
Fix "cleos net peers" command error (for QY)
  • Loading branch information
nksanthosh authored Jan 20, 2021
2 parents ca70a9b + 8e792b1 commit 6dde648
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion programs/cleos/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3544,7 +3544,7 @@ int main( int argc, char** argv ) {

auto connections = net->add_subcommand("peers", localized("Status of all existing peers"));
connections->callback([&] {
const auto& v = call(url, net_connections, new_host);
const auto& v = call(url, net_connections);
std::cout << fc::json::to_pretty_string(v) << std::endl;
});

Expand Down
7 changes: 4 additions & 3 deletions tests/plugin_http_api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ def startEnv(self) :
"eosio::history_plugin",
"eosio::history_api_plugin")
nodeos_flags = (" --data-dir=%s --trace-dir=%s --trace-no-abis --filter-on=%s --access-control-allow-origin=%s "
"--contracts-console --http-validate-host=%s --verbose-http-errors ") % (self.data_dir, self.data_dir, "\"*\"", "\'*\'", "false")
"--contracts-console --http-validate-host=%s --verbose-http-errors "
"--p2p-peer-address localhost:9011 ") % (self.data_dir, self.data_dir, "\"*\"", "\'*\'", "false")
start_nodeos_cmd = ("%s -e -p eosio %s %s ") % (Utils.EosServerPath, nodeos_plugins, nodeos_flags)
self.nodeos.launchCmd(start_nodeos_cmd, self.node_id)
time.sleep(self.sleep_s)
Expand Down Expand Up @@ -855,11 +856,11 @@ def test_NetApi(self) :
# connections with empty parameter
default_cmd = cmd_base + "connections"
ret_str = Utils.runCmdReturnStr(default_cmd)
self.assertEqual(ret_str, "[]")
self.assertIn("\"peer\":\"localhost:9011\"", ret_str)
# connections with empty content parameter
empty_content_cmd = default_cmd + self.http_post_str + self.empty_content_str
ret_str = Utils.runCmdReturnStr(default_cmd)
self.assertEqual(ret_str, "[]")
self.assertIn("\"peer\":\"localhost:9011\"", ret_str)
# connections with invalid parameter
invalid_cmd = default_cmd + self.http_post_str + self.http_post_invalid_param
ret_json = Utils.runCmdReturnJson(invalid_cmd)
Expand Down

0 comments on commit 6dde648

Please sign in to comment.