{"action":"created","comment":{"url":"https://api.github.com/repos/ripple/rippled/pulls/comments/124156096","pull_request_review_id":46415617,"id":124156096,"diff_hunk":"@@ -203,24 +206,164 @@ class AccountSet_test : public beast::unit_test::suite\n \n     void testTransferRate()\n     {\n+        {\n+            using namespace test::jtx;\n+            Env env (*this);\n+\n+            Account const alice (\"alice\");\n+            env.fund(XRP(10000), alice);\n+            auto jt = noop(alice);\n+\n+            uint32 xfer_rate = QUALITY_ONE;\n+            jt[sfTransferRate.fieldName] = xfer_rate;\n+            env(jt);\n+            BEAST_EXPECT(! env.le(alice)->isFieldPresent(sfTransferRate));\n+\n+            xfer_rate = 2 * QUALITY_ONE;\n+            jt[sfTransferRate.fieldName] = xfer_rate;\n+            env(jt);\n+            BEAST_EXPECT((*env.le(alice))[ sfTransferRate ] == xfer_rate);\n+\n+            jt[sfTransferRate.fieldName] = 0u;\n+            env(jt);\n+            BEAST_EXPECT(! env.le(alice)->isFieldPresent(sfTransferRate));\n+\n+            // set a bad value over limit (> 2 * QUALITY_ONE)\n+            xfer_rate = (2 * QUALITY_ONE) + 1;\n+            jt[sfTransferRate.fieldName] = xfer_rate;\n+            env(jt);\n+            BEAST_EXPECT((*env.le(alice))[ sfTransferRate ] == xfer_rate);\n+\n+            // set a bad value over limit (> 2 * QUALITY_ONE)\n+            xfer_rate = std::numeric_limits<std::uint32_t>::max();\n+            jt[sfTransferRate.fieldName] = xfer_rate;\n+            env(jt);\n+            BEAST_EXPECT((*env.le(alice))[ sfTransferRate ] == xfer_rate);\n+\n+            // set a bad value under limit (< QUALITY_ONE)\n+            jt[sfTransferRate.fieldName] = 1u;\n+            env(jt, ter(temBAD_TRANSFER_RATE));\n+        }\n+        {\n+            // Test max transferRate with fix1201 enabled\n+            using namespace test::jtx;\n+            Env env(*this, features(fix1201));\n+\n+            Account const bob (\"bob\");\n+            env.fund(XRP(10000), bob);\n+            auto jt = noop(bob);\n+\n+            uint32 xfer_rate = 2 * QUALITY_ONE;\n+            jt[sfTransferRate.fieldName] = xfer_rate;\n+            env(jt);\n+            BEAST_EXPECT((*env.le(bob))[ sfTransferRate ] == xfer_rate);\n+\n+            // set a bad value over limit (> 2 * QUALITY_ONE)\n+            xfer_rate = std::numeric_limits<std::uint32_t>::max();\n+            jt[sfTransferRate.fieldName] = xfer_rate;\n+            env(jt, ter(temBAD_TRANSFER_RATE));\n+\n+            // set a bad value over limit (> 2 * QUALITY_ONE)\n+            xfer_rate = (2 * QUALITY_ONE) + 1;\n+            jt[sfTransferRate.fieldName] = xfer_rate;\n+            env(jt, ter(temBAD_TRANSFER_RATE));\n+        }\n+    }\n+\n+    void testGateway()\n+    {\n         using namespace test::jtx;\n-        Env env(*this);\n-        Account const alice (\"alice\");\n-        env.fund(XRP(10000), alice);\n-        auto jt = noop(alice);\n+        auto runTest = [&](Env& env, double tr)","path":"src/test/rpc/AccountSet_test.cpp","position":88,"original_position":88,"commit_id":"41ba85c59dc7e558c6557ec17d4988ae81678c73","original_commit_id":"41ba85c59dc7e558c6557ec17d4988ae81678c73","user":{"login":"scottschurr","id":7840379,"avatar_url":"https://avatars3.githubusercontent.com/u/7840379?v=3","gravatar_id":"","url":"https://api.github.com/users/scottschurr","html_url":"https://github.com/scottschurr","followers_url":"https://api.github.com/users/scottschurr/followers","following_url":"https://api.github.com/users/scottschurr/following{/other_user}","gists_url":"https://api.github.com/users/scottschurr/gists{/gist_id}","starred_url":"https://api.github.com/users/scottschurr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottschurr/subscriptions","organizations_url":"https://api.github.com/users/scottschurr/orgs","repos_url":"https://api.github.com/users/scottschurr/repos","events_url":"https://api.github.com/users/scottschurr/events{/privacy}","received_events_url":"https://api.github.com/users/scottschurr/received_events","type":"User","site_admin":false},"body":"FWIW, it looks to me like your lambda could have an empty capture.","created_at":"2017-06-27T00:50:35Z","updated_at":"2017-06-27T00:53:24Z","html_url":"https://github.com/ripple/rippled/pull/2148#discussion_r124156096","pull_request_url":"https://api.github.com/repos/ripple/rippled/pulls/2148","_links":{"self":{"href":"https://api.github.com/repos/ripple/rippled/pulls/comments/124156096"},"html":{"href":"https://github.com/ripple/rippled/pull/2148#discussion_r124156096"},"pull_request":{"href":"https://api.github.com/repos/ripple/rippled/pulls/2148"}}},"pull_request":{"url":"https://api.github.com/repos/ripple/rippled/pulls/2148","id":126130844,"html_url":"https://github.com/ripple/rippled/pull/2148","diff_url":"https://github.com/ripple/rippled/pull/2148.diff","patch_url":"https://github.com/ripple/rippled/pull/2148.patch","issue_url":"https://api.github.com/repos/ripple/rippled/issues/2148","number":2148,"state":"open","locked":false,"title":"Enforce TransferRate Maximum","user":{"login":"xasos","id":6235280,"avatar_url":"https://avatars3.githubusercontent.com/u/6235280?v=3","gravatar_id":"","url":"https://api.github.com/users/xasos","html_url":"https://github.com/xasos","followers_url":"https://api.github.com/users/xasos/followers","following_url":"https://api.github.com/users/xasos/following{/other_user}","gists_url":"https://api.github.com/users/xasos/gists{/gist_id}","starred_url":"https://api.github.com/users/xasos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xasos/subscriptions","organizations_url":"https://api.github.com/users/xasos/orgs","repos_url":"https://api.github.com/users/xasos/repos","events_url":"https://api.github.com/users/xasos/events{/privacy}","received_events_url":"https://api.github.com/users/xasos/received_events","type":"User","site_admin":false},"body":"Requires amendment change. Sets a maximum value for TransferRate at 2 billion, rather than the current assumed value (~4.29 billion). Treats any requested TransferRate over the limit as the max value. Continuation of #2132.","created_at":"2017-06-16T23:17:37Z","updated_at":"2017-06-27T00:53:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"64175764c513cf306fb453dedde6cb43797b7cfa","assignee":{"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},"assignees":[{"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},{"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},{"login":"scottschurr","id":7840379,"avatar_url":"https://avatars3.githubusercontent.com/u/7840379?v=3","gravatar_id":"","url":"https://api.github.com/users/scottschurr","html_url":"https://github.com/scottschurr","followers_url":"https://api.github.com/users/scottschurr/followers","following_url":"https://api.github.com/users/scottschurr/following{/other_user}","gists_url":"https://api.github.com/users/scottschurr/gists{/gist_id}","starred_url":"https://api.github.com/users/scottschurr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottschurr/subscriptions","organizations_url":"https://api.github.com/users/scottschurr/orgs","repos_url":"https://api.github.com/users/scottschurr/repos","events_url":"https://api.github.com/users/scottschurr/events{/privacy}","received_events_url":"https://api.github.com/users/scottschurr/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ripple/rippled/pulls/2148/commits","review_comments_url":"https://api.github.com/repos/ripple/rippled/pulls/2148/comments","review_comment_url":"https://api.github.com/repos/ripple/rippled/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ripple/rippled/issues/2148/comments","statuses_url":"https://api.github.com/repos/ripple/rippled/statuses/41ba85c59dc7e558c6557ec17d4988ae81678c73","head":{"label":"xasos:RIPD-1201","ref":"RIPD-1201","sha":"41ba85c59dc7e558c6557ec17d4988ae81678c73","user":{"login":"xasos","id":6235280,"avatar_url":"https://avatars3.githubusercontent.com/u/6235280?v=3","gravatar_id":"","url":"https://api.github.com/users/xasos","html_url":"https://github.com/xasos","followers_url":"https://api.github.com/users/xasos/followers","following_url":"https://api.github.com/users/xasos/following{/other_user}","gists_url":"https://api.github.com/users/xasos/gists{/gist_id}","starred_url":"https://api.github.com/users/xasos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xasos/subscriptions","organizations_url":"https://api.github.com/users/xasos/orgs","repos_url":"https://api.github.com/users/xasos/repos","events_url":"https://api.github.com/users/xasos/events{/privacy}","received_events_url":"https://api.github.com/users/xasos/received_events","type":"User","site_admin":false},"repo":{"id":93108330,"name":"rippled","full_name":"xasos/rippled","owner":{"login":"xasos","id":6235280,"avatar_url":"https://avatars3.githubusercontent.com/u/6235280?v=3","gravatar_id":"","url":"https://api.github.com/users/xasos","html_url":"https://github.com/xasos","followers_url":"https://api.github.com/users/xasos/followers","following_url":"https://api.github.com/users/xasos/following{/other_user}","gists_url":"https://api.github.com/users/xasos/gists{/gist_id}","starred_url":"https://api.github.com/users/xasos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xasos/subscriptions","organizations_url":"https://api.github.com/users/xasos/orgs","repos_url":"https://api.github.com/users/xasos/repos","events_url":"https://api.github.com/users/xasos/events{/privacy}","received_events_url":"https://api.github.com/users/xasos/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xasos/rippled","description":"Decentralized cryptocurrency blockchain daemon implementing the Ripple Consensus Ledger in C++","fork":true,"url":"https://api.github.com/repos/xasos/rippled","forks_url":"https://api.github.com/repos/xasos/rippled/forks","keys_url":"https://api.github.com/repos/xasos/rippled/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xasos/rippled/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xasos/rippled/teams","hooks_url":"https://api.github.com/repos/xasos/rippled/hooks","issue_events_url":"https://api.github.com/repos/xasos/rippled/issues/events{/number}","events_url":"https://api.github.com/repos/xasos/rippled/events","assignees_url":"https://api.github.com/repos/xasos/rippled/assignees{/user}","branches_url":"https://api.github.com/repos/xasos/rippled/branches{/branch}","tags_url":"https://api.github.com/repos/xasos/rippled/tags","blobs_url":"https://api.github.com/repos/xasos/rippled/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xasos/rippled/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xasos/rippled/git/refs{/sha}","trees_url":"https://api.github.com/repos/xasos/rippled/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xasos/rippled/statuses/{sha}","languages_url":"https://api.github.com/repos/xasos/rippled/languages","stargazers_url":"https://api.github.com/repos/xasos/rippled/stargazers","contributors_url":"https://api.github.com/repos/xasos/rippled/contributors","subscribers_url":"https://api.github.com/repos/xasos/rippled/subscribers","subscription_url":"https://api.github.com/repos/xasos/rippled/subscription","commits_url":"https://api.github.com/repos/xasos/rippled/commits{/sha}","git_commits_url":"https://api.github.com/repos/xasos/rippled/git/commits{/sha}","comments_url":"https://api.github.com/repos/xasos/rippled/comments{/number}","issue_comment_url":"https://api.github.com/repos/xasos/rippled/issues/comments{/number}","contents_url":"https://api.github.com/repos/xasos/rippled/contents/{+path}","compare_url":"https://api.github.com/repos/xasos/rippled/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xasos/rippled/merges","archive_url":"https://api.github.com/repos/xasos/rippled/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xasos/rippled/downloads","issues_url":"https://api.github.com/repos/xasos/rippled/issues{/number}","pulls_url":"https://api.github.com/repos/xasos/rippled/pulls{/number}","milestones_url":"https://api.github.com/repos/xasos/rippled/milestones{/number}","notifications_url":"https://api.github.com/repos/xasos/rippled/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xasos/rippled/labels{/name}","releases_url":"https://api.github.com/repos/xasos/rippled/releases{/id}","deployments_url":"https://api.github.com/repos/xasos/rippled/deployments","created_at":"2017-06-01T23:38:28Z","updated_at":"2017-06-01T23:38:41Z","pushed_at":"2017-06-22T19:10:10Z","git_url":"git://github.com/xasos/rippled.git","ssh_url":"git@github.com:xasos/rippled.git","clone_url":"https://github.com/xasos/rippled.git","svn_url":"https://github.com/xasos/rippled","homepage":"https://ripple.com","size":85349,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":"7b0d48281049c3fec7fafcb7ce5cea045367ae1f","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-06-25T19:38:12Z","pushed_at":"2017-06-27T00:03:19Z","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":85144,"stargazers_count":1409,"watchers_count":1409,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":431,"mirror_url":null,"open_issues_count":83,"forks":431,"open_issues":83,"watchers":1409,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ripple/rippled/pulls/2148"},"html":{"href":"https://github.com/ripple/rippled/pull/2148"},"issue":{"href":"https://api.github.com/repos/ripple/rippled/issues/2148"},"comments":{"href":"https://api.github.com/repos/ripple/rippled/issues/2148/comments"},"review_comments":{"href":"https://api.github.com/repos/ripple/rippled/pulls/2148/comments"},"review_comment":{"href":"https://api.github.com/repos/ripple/rippled/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ripple/rippled/pulls/2148/commits"},"statuses":{"href":"https://api.github.com/repos/ripple/rippled/statuses/41ba85c59dc7e558c6557ec17d4988ae81678c73"}}}}
{"actor":{"display_login":"scottschurr"}}