{"action":"created","comment":{"url":"https://api.github.com/repos/ripple/rippled/pulls/comments/111810257","pull_request_review_id":33078218,"id":111810257,"diff_hunk":"@@ -0,0 +1,98 @@\n+//------------------------------------------------------------------------------\n+/*\n+    This file is part of rippled: https://github.com/ripple/rippled\n+    Copyright (c) 2012-2017 Ripple Labs Inc.\n+\n+    Permission to use, copy, modify, and/or distribute this software for any\n+    purpose  with  or without fee is hereby granted, provided that the above\n+    copyright notice and this permission notice appear in all copies.\n+\n+    THE  SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n+    WITH  REGARD  TO  THIS  SOFTWARE  INCLUDING  ALL  IMPLIED  WARRANTIES  OF\n+    MERCHANTABILITY  AND  FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n+    ANY  SPECIAL ,  DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n+    WHATSOEVER  RESULTING  FROM  LOSS  OF USE, DATA OR PROFITS, WHETHER IN AN\n+    ACTION  OF  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n+    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n+*/\n+//==============================================================================\n+\n+#include <test/jtx.h>\n+#include <test/jtx/Env.h>\n+#include <ripple/protocol/JsonFields.h>\n+#include <ripple/overlay/Cluster.h>\n+#include <ripple/overlay/Overlay.h>\n+#include <unordered_map>\n+\n+namespace ripple {\n+\n+class Peers_test : public beast::unit_test::suite\n+{\n+    void testRequest()\n+    {\n+        testcase(\"Basic request\");\n+        using namespace test::jtx;\n+        Env env {*this};\n+\n+        // without modification of the cluster, expect an empty set\n+        // from this request\n+        auto peers = env.rpc(\"peers\")[jss::result];\n+        BEAST_EXPECT(peers.isMember(jss::cluster) &&\n+            peers[jss::cluster].size() == 0 );\n+        BEAST_EXPECT(peers.isMember(jss::peers) &&\n+            peers[jss::peers].isNull());\n+\n+        // insert some nodes in to the cluster\n+        std::unordered_map<std::string, std::string> nodes;\n+        for(auto i =0; i < 3; ++i)\n+        {\n+\n+            auto seed = generateSeed(\"seed\" + std::to_string(i));","path":"src/test/rpc/Peers_test.cpp","position":50,"original_position":50,"commit_id":"749244f5d1467f8e7e38d12853ec867733b31cb6","original_commit_id":"749244f5d1467f8e7e38d12853ec867733b31cb6","user":{"login":"nbougalis","id":5085415,"avatar_url":"https://avatars0.githubusercontent.com/u/5085415?v=3","gravatar_id":"","url":"https://api.github.com/users/nbougalis","html_url":"https://github.com/nbougalis","followers_url":"https://api.github.com/users/nbougalis/followers","following_url":"https://api.github.com/users/nbougalis/following{/other_user}","gists_url":"https://api.github.com/users/nbougalis/gists{/gist_id}","starred_url":"https://api.github.com/users/nbougalis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbougalis/subscriptions","organizations_url":"https://api.github.com/users/nbougalis/orgs","repos_url":"https://api.github.com/users/nbougalis/repos","events_url":"https://api.github.com/users/nbougalis/events{/privacy}","received_events_url":"https://api.github.com/users/nbougalis/received_events","type":"User","site_admin":false},"body":"Not change needed, but you could replace 50-53 with:\r\n\r\n    auto kp = generateKeyPair (KeyType::secp256k1, generateSeed(\"seed\" + std::to_string(i)));\r\n\r\nYou'd also have the `SecretKey` in `kp` which you don't strictly need, but, overall, I think it would simpify the code.","created_at":"2017-04-17T20:08:16Z","updated_at":"2017-04-17T20:09:39Z","html_url":"https://github.com/ripple/rippled/pull/2060#discussion_r111810257","pull_request_url":"https://api.github.com/repos/ripple/rippled/pulls/2060","_links":{"self":{"href":"https://api.github.com/repos/ripple/rippled/pulls/comments/111810257"},"html":{"href":"https://github.com/ripple/rippled/pull/2060#discussion_r111810257"},"pull_request":{"href":"https://api.github.com/repos/ripple/rippled/pulls/2060"}}},"pull_request":{"url":"https://api.github.com/repos/ripple/rippled/pulls/2060","id":111832399,"html_url":"https://github.com/ripple/rippled/pull/2060","diff_url":"https://github.com/ripple/rippled/pull/2060.diff","patch_url":"https://github.com/ripple/rippled/pull/2060.patch","issue_url":"https://api.github.com/repos/ripple/rippled/issues/2060","number":2060,"state":"open","locked":false,"title":"Add Unit Test for peers RPC Request [RIPD-1419]","user":{"login":"mellery451","id":463430,"avatar_url":"https://avatars2.githubusercontent.com/u/463430?v=3","gravatar_id":"","url":"https://api.github.com/users/mellery451","html_url":"https://github.com/mellery451","followers_url":"https://api.github.com/users/mellery451/followers","following_url":"https://api.github.com/users/mellery451/following{/other_user}","gists_url":"https://api.github.com/users/mellery451/gists{/gist_id}","starred_url":"https://api.github.com/users/mellery451/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mellery451/subscriptions","organizations_url":"https://api.github.com/users/mellery451/orgs","repos_url":"https://api.github.com/users/mellery451/repos","events_url":"https://api.github.com/users/mellery451/events{/privacy}","received_events_url":"https://api.github.com/users/mellery451/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-03-21T17:14:18Z","updated_at":"2017-04-17T20:09:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b93779226b749e4fcfc56e20c745b644fe569fd5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ripple/rippled/pulls/2060/commits","review_comments_url":"https://api.github.com/repos/ripple/rippled/pulls/2060/comments","review_comment_url":"https://api.github.com/repos/ripple/rippled/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ripple/rippled/issues/2060/comments","statuses_url":"https://api.github.com/repos/ripple/rippled/statuses/749244f5d1467f8e7e38d12853ec867733b31cb6","head":{"label":"mellery451:peers-test","ref":"peers-test","sha":"749244f5d1467f8e7e38d12853ec867733b31cb6","user":{"login":"mellery451","id":463430,"avatar_url":"https://avatars2.githubusercontent.com/u/463430?v=3","gravatar_id":"","url":"https://api.github.com/users/mellery451","html_url":"https://github.com/mellery451","followers_url":"https://api.github.com/users/mellery451/followers","following_url":"https://api.github.com/users/mellery451/following{/other_user}","gists_url":"https://api.github.com/users/mellery451/gists{/gist_id}","starred_url":"https://api.github.com/users/mellery451/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mellery451/subscriptions","organizations_url":"https://api.github.com/users/mellery451/orgs","repos_url":"https://api.github.com/users/mellery451/repos","events_url":"https://api.github.com/users/mellery451/events{/privacy}","received_events_url":"https://api.github.com/users/mellery451/received_events","type":"User","site_admin":false},"repo":{"id":63169724,"name":"rippled","full_name":"mellery451/rippled","owner":{"login":"mellery451","id":463430,"avatar_url":"https://avatars2.githubusercontent.com/u/463430?v=3","gravatar_id":"","url":"https://api.github.com/users/mellery451","html_url":"https://github.com/mellery451","followers_url":"https://api.github.com/users/mellery451/followers","following_url":"https://api.github.com/users/mellery451/following{/other_user}","gists_url":"https://api.github.com/users/mellery451/gists{/gist_id}","starred_url":"https://api.github.com/users/mellery451/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mellery451/subscriptions","organizations_url":"https://api.github.com/users/mellery451/orgs","repos_url":"https://api.github.com/users/mellery451/repos","events_url":"https://api.github.com/users/mellery451/events{/privacy}","received_events_url":"https://api.github.com/users/mellery451/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mellery451/rippled","description":"Ripple peer-to-peer network daemon","fork":true,"url":"https://api.github.com/repos/mellery451/rippled","forks_url":"https://api.github.com/repos/mellery451/rippled/forks","keys_url":"https://api.github.com/repos/mellery451/rippled/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mellery451/rippled/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mellery451/rippled/teams","hooks_url":"https://api.github.com/repos/mellery451/rippled/hooks","issue_events_url":"https://api.github.com/repos/mellery451/rippled/issues/events{/number}","events_url":"https://api.github.com/repos/mellery451/rippled/events","assignees_url":"https://api.github.com/repos/mellery451/rippled/assignees{/user}","branches_url":"https://api.github.com/repos/mellery451/rippled/branches{/branch}","tags_url":"https://api.github.com/repos/mellery451/rippled/tags","blobs_url":"https://api.github.com/repos/mellery451/rippled/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mellery451/rippled/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mellery451/rippled/git/refs{/sha}","trees_url":"https://api.github.com/repos/mellery451/rippled/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mellery451/rippled/statuses/{sha}","languages_url":"https://api.github.com/repos/mellery451/rippled/languages","stargazers_url":"https://api.github.com/repos/mellery451/rippled/stargazers","contributors_url":"https://api.github.com/repos/mellery451/rippled/contributors","subscribers_url":"https://api.github.com/repos/mellery451/rippled/subscribers","subscription_url":"https://api.github.com/repos/mellery451/rippled/subscription","commits_url":"https://api.github.com/repos/mellery451/rippled/commits{/sha}","git_commits_url":"https://api.github.com/repos/mellery451/rippled/git/commits{/sha}","comments_url":"https://api.github.com/repos/mellery451/rippled/comments{/number}","issue_comment_url":"https://api.github.com/repos/mellery451/rippled/issues/comments{/number}","contents_url":"https://api.github.com/repos/mellery451/rippled/contents/{+path}","compare_url":"https://api.github.com/repos/mellery451/rippled/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mellery451/rippled/merges","archive_url":"https://api.github.com/repos/mellery451/rippled/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mellery451/rippled/downloads","issues_url":"https://api.github.com/repos/mellery451/rippled/issues{/number}","pulls_url":"https://api.github.com/repos/mellery451/rippled/pulls{/number}","milestones_url":"https://api.github.com/repos/mellery451/rippled/milestones{/number}","notifications_url":"https://api.github.com/repos/mellery451/rippled/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mellery451/rippled/labels{/name}","releases_url":"https://api.github.com/repos/mellery451/rippled/releases{/id}","deployments_url":"https://api.github.com/repos/mellery451/rippled/deployments","created_at":"2016-07-12T15:29:01Z","updated_at":"2016-07-12T15:29:12Z","pushed_at":"2017-04-13T17:27:20Z","git_url":"git://github.com/mellery451/rippled.git","ssh_url":"git@github.com:mellery451/rippled.git","clone_url":"https://github.com/mellery451/rippled.git","svn_url":"https://github.com/mellery451/rippled","homepage":"https://ripple.com","size":84560,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"ripple:develop","ref":"develop","sha":"c6b6d82a754fe449cc533e18659df483c10a5c98","user":{"login":"ripple","id":3165523,"avatar_url":"https://avatars1.githubusercontent.com/u/3165523?v=3","gravatar_id":"","url":"https://api.github.com/users/ripple","html_url":"https://github.com/ripple","followers_url":"https://api.github.com/users/ripple/followers","following_url":"https://api.github.com/users/ripple/following{/other_user}","gists_url":"https://api.github.com/users/ripple/gists{/gist_id}","starred_url":"https://api.github.com/users/ripple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ripple/subscriptions","organizations_url":"https://api.github.com/users/ripple/orgs","repos_url":"https://api.github.com/users/ripple/repos","events_url":"https://api.github.com/users/ripple/events{/privacy}","received_events_url":"https://api.github.com/users/ripple/received_events","type":"Organization","site_admin":false},"repo":{"id":2724167,"name":"rippled","full_name":"ripple/rippled","owner":{"login":"ripple","id":3165523,"avatar_url":"https://avatars1.githubusercontent.com/u/3165523?v=3","gravatar_id":"","url":"https://api.github.com/users/ripple","html_url":"https://github.com/ripple","followers_url":"https://api.github.com/users/ripple/followers","following_url":"https://api.github.com/users/ripple/following{/other_user}","gists_url":"https://api.github.com/users/ripple/gists{/gist_id}","starred_url":"https://api.github.com/users/ripple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ripple/subscriptions","organizations_url":"https://api.github.com/users/ripple/orgs","repos_url":"https://api.github.com/users/ripple/repos","events_url":"https://api.github.com/users/ripple/events{/privacy}","received_events_url":"https://api.github.com/users/ripple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ripple/rippled","description":"Decentralized cryptocurrency blockchain daemon implementing the Ripple Consensus Ledger in C++","fork":false,"url":"https://api.github.com/repos/ripple/rippled","forks_url":"https://api.github.com/repos/ripple/rippled/forks","keys_url":"https://api.github.com/repos/ripple/rippled/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ripple/rippled/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ripple/rippled/teams","hooks_url":"https://api.github.com/repos/ripple/rippled/hooks","issue_events_url":"https://api.github.com/repos/ripple/rippled/issues/events{/number}","events_url":"https://api.github.com/repos/ripple/rippled/events","assignees_url":"https://api.github.com/repos/ripple/rippled/assignees{/user}","branches_url":"https://api.github.com/repos/ripple/rippled/branches{/branch}","tags_url":"https://api.github.com/repos/ripple/rippled/tags","blobs_url":"https://api.github.com/repos/ripple/rippled/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ripple/rippled/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ripple/rippled/git/refs{/sha}","trees_url":"https://api.github.com/repos/ripple/rippled/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ripple/rippled/statuses/{sha}","languages_url":"https://api.github.com/repos/ripple/rippled/languages","stargazers_url":"https://api.github.com/repos/ripple/rippled/stargazers","contributors_url":"https://api.github.com/repos/ripple/rippled/contributors","subscribers_url":"https://api.github.com/repos/ripple/rippled/subscribers","subscription_url":"https://api.github.com/repos/ripple/rippled/subscription","commits_url":"https://api.github.com/repos/ripple/rippled/commits{/sha}","git_commits_url":"https://api.github.com/repos/ripple/rippled/git/commits{/sha}","comments_url":"https://api.github.com/repos/ripple/rippled/comments{/number}","issue_comment_url":"https://api.github.com/repos/ripple/rippled/issues/comments{/number}","contents_url":"https://api.github.com/repos/ripple/rippled/contents/{+path}","compare_url":"https://api.github.com/repos/ripple/rippled/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ripple/rippled/merges","archive_url":"https://api.github.com/repos/ripple/rippled/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ripple/rippled/downloads","issues_url":"https://api.github.com/repos/ripple/rippled/issues{/number}","pulls_url":"https://api.github.com/repos/ripple/rippled/pulls{/number}","milestones_url":"https://api.github.com/repos/ripple/rippled/milestones{/number}","notifications_url":"https://api.github.com/repos/ripple/rippled/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ripple/rippled/labels{/name}","releases_url":"https://api.github.com/repos/ripple/rippled/releases{/id}","deployments_url":"https://api.github.com/repos/ripple/rippled/deployments","created_at":"2011-11-07T04:40:15Z","updated_at":"2017-04-15T06:28:59Z","pushed_at":"2017-04-14T23:05:10Z","git_url":"git://github.com/ripple/rippled.git","ssh_url":"git@github.com:ripple/rippled.git","clone_url":"https://github.com/ripple/rippled.git","svn_url":"https://github.com/ripple/rippled","homepage":"https://ripple.com","size":84362,"stargazers_count":1277,"watchers_count":1277,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":400,"mirror_url":null,"open_issues_count":69,"forks":400,"open_issues":69,"watchers":1277,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ripple/rippled/pulls/2060"},"html":{"href":"https://github.com/ripple/rippled/pull/2060"},"issue":{"href":"https://api.github.com/repos/ripple/rippled/issues/2060"},"comments":{"href":"https://api.github.com/repos/ripple/rippled/issues/2060/comments"},"review_comments":{"href":"https://api.github.com/repos/ripple/rippled/pulls/2060/comments"},"review_comment":{"href":"https://api.github.com/repos/ripple/rippled/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ripple/rippled/pulls/2060/commits"},"statuses":{"href":"https://api.github.com/repos/ripple/rippled/statuses/749244f5d1467f8e7e38d12853ec867733b31cb6"}}}}
{"actor":{"display_login":"nbougalis"}}