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

Fix "cleos net peers" command error #9942

Merged
merged 2 commits into from
Jan 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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