{"action":"created","comment":{"url":"https://api.github.com/repos/hyperledger/indy-plenum/pulls/comments/154039301","pull_request_review_id":80139422,"id":154039301,"diff_hunk":"@@ -0,0 +1,55 @@\n+from plenum.test.sdk.conftest import sdk_send_signed_requests, sdk_get_replies, sdk_send_random_requests\n+from plenum.test.batching_3pc.helper import checkNodesHaveSameRoots\n+from plenum.test import waits\n+\n+\n+def send_and_check(signed_reqs, looper, txnPoolNodeSet, pool_h, timeout=None):\n+    if not timeout:\n+        timeout_per_request = waits.expectedTransactionExecutionTime(len(txnPoolNodeSet))\n+        # here we try to take into account what timeout for execution\n+        # N request - total_timeout should be in\n+        # timeout_per_request < total_timeout < timeout_per_request * N\n+        # we cannot just take (timeout_per_request * N) because it is so huge.\n+        # (for timeout_per_request=5 and N=10, total_timeout=50sec)\n+        # lets start with some simple formula:\n+        timeout = (1 + len(signed_reqs) / 10) * timeout_per_request\n+\n+    results = sdk_send_signed_requests(pool_h, signed_reqs)\n+    sdk_get_replies(looper, results, timeout=timeout)\n+    checkNodesHaveSameRoots(txnPoolNodeSet)\n+\n+\n+def send_random_and_check(looper, txnPoolNodeSet, sdk_pool, sdk_wallet, count,\n+                          customTimeoutPerReq: float = None, add_delay_to_timeout: float = 0,\n+                          override_timeout_limit=False, total_timeout=None):\n+    if not total_timeout:\n+        node_count = len(txnPoolNodeSet)\n+        timeout_per_request = customTimeoutPerReq or waits.expectedTransactionExecutionTime(node_count)\n+        timeout_per_request += add_delay_to_timeout\n+        # here we try to take into account what timeout for execution\n+        # N request - total_timeout should be in\n+        # timeout_per_request < total_timeout < timeout_per_request * N\n+        # we cannot just take (timeout_per_request * N) because it is so huge.\n+        # (for timeout_per_request=5 and N=10, total_timeout=50sec)\n+        # lets start with some simple formula:\n+        total_timeout = (1 + count / 10) * timeout_per_request\n+\n+    sdk_reqs = sdk_send_random_requests(looper, sdk_pool, sdk_wallet, count)\n+    sdk_repl = sdk_get_replies(looper, sdk_reqs, timeout=total_timeout)\n+    return sdk_repl\n+\n+\n+def send_batches_of_random_and_check(looper, txnPoolNodeSet, sdk_pool, sdk_wallet, num_reqs, num_batches=1, **kwargs):\n+    # This method assumes that `num_reqs` <= num_batches*MaxbatchSize\n+    if num_batches == 1:\n+        return send_random_and_check(looper, txnPoolNodeSet, sdk_pool, sdk_wallet, num_reqs, **kwargs)\n+    else:","path":"plenum/test/sdk/helper.py","position":46,"original_position":46,"commit_id":"e7da4512d69c90886e13bfee6d5c6175d0de735b","original_commit_id":"e7da4512d69c90886e13bfee6d5c6175d0de735b","user":{"login":"ashcherbakov","id":21102430,"avatar_url":"https://avatars1.githubusercontent.com/u/21102430?v=4","gravatar_id":"","url":"https://api.github.com/users/ashcherbakov","html_url":"https://github.com/ashcherbakov","followers_url":"https://api.github.com/users/ashcherbakov/followers","following_url":"https://api.github.com/users/ashcherbakov/following{/other_user}","gists_url":"https://api.github.com/users/ashcherbakov/gists{/gist_id}","starred_url":"https://api.github.com/users/ashcherbakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashcherbakov/subscriptions","organizations_url":"https://api.github.com/users/ashcherbakov/orgs","repos_url":"https://api.github.com/users/ashcherbakov/repos","events_url":"https://api.github.com/users/ashcherbakov/events{/privacy}","received_events_url":"https://api.github.com/users/ashcherbakov/received_events","type":"User","site_admin":false},"body":"else is not needed here","created_at":"2017-11-30T10:39:04Z","updated_at":"2017-11-30T10:39:04Z","html_url":"https://github.com/hyperledger/indy-plenum/pull/464#discussion_r154039301","pull_request_url":"https://api.github.com/repos/hyperledger/indy-plenum/pulls/464","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/hyperledger/indy-plenum/pulls/comments/154039301"},"html":{"href":"https://github.com/hyperledger/indy-plenum/pull/464#discussion_r154039301"},"pull_request":{"href":"https://api.github.com/repos/hyperledger/indy-plenum/pulls/464"}}},"pull_request":{"url":"https://api.github.com/repos/hyperledger/indy-plenum/pulls/464","id":155563860,"html_url":"https://github.com/hyperledger/indy-plenum/pull/464","diff_url":"https://github.com/hyperledger/indy-plenum/pull/464.diff","patch_url":"https://github.com/hyperledger/indy-plenum/pull/464.patch","issue_url":"https://api.github.com/repos/hyperledger/indy-plenum/issues/464","number":464,"state":"open","locked":false,"title":"Sdk to tests","user":{"login":"dsurnin","id":28005170,"avatar_url":"https://avatars2.githubusercontent.com/u/28005170?v=4","gravatar_id":"","url":"https://api.github.com/users/dsurnin","html_url":"https://github.com/dsurnin","followers_url":"https://api.github.com/users/dsurnin/followers","following_url":"https://api.github.com/users/dsurnin/following{/other_user}","gists_url":"https://api.github.com/users/dsurnin/gists{/gist_id}","starred_url":"https://api.github.com/users/dsurnin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsurnin/subscriptions","organizations_url":"https://api.github.com/users/dsurnin/orgs","repos_url":"https://api.github.com/users/dsurnin/repos","events_url":"https://api.github.com/users/dsurnin/events{/privacy}","received_events_url":"https://api.github.com/users/dsurnin/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-11-30T10:01:44Z","updated_at":"2017-11-30T10:39:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b146a0cd52e4f63209767496f5f7830e7e8c97b","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/hyperledger/indy-plenum/pulls/464/commits","review_comments_url":"https://api.github.com/repos/hyperledger/indy-plenum/pulls/464/comments","review_comment_url":"https://api.github.com/repos/hyperledger/indy-plenum/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hyperledger/indy-plenum/issues/464/comments","statuses_url":"https://api.github.com/repos/hyperledger/indy-plenum/statuses/e7da4512d69c90886e13bfee6d5c6175d0de735b","head":{"label":"dsurnin:sdk-to-tests","ref":"sdk-to-tests","sha":"e7da4512d69c90886e13bfee6d5c6175d0de735b","user":{"login":"dsurnin","id":28005170,"avatar_url":"https://avatars2.githubusercontent.com/u/28005170?v=4","gravatar_id":"","url":"https://api.github.com/users/dsurnin","html_url":"https://github.com/dsurnin","followers_url":"https://api.github.com/users/dsurnin/followers","following_url":"https://api.github.com/users/dsurnin/following{/other_user}","gists_url":"https://api.github.com/users/dsurnin/gists{/gist_id}","starred_url":"https://api.github.com/users/dsurnin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsurnin/subscriptions","organizations_url":"https://api.github.com/users/dsurnin/orgs","repos_url":"https://api.github.com/users/dsurnin/repos","events_url":"https://api.github.com/users/dsurnin/events{/privacy}","received_events_url":"https://api.github.com/users/dsurnin/received_events","type":"User","site_admin":false},"repo":{"id":95883426,"name":"indy-plenum","full_name":"dsurnin/indy-plenum","owner":{"login":"dsurnin","id":28005170,"avatar_url":"https://avatars2.githubusercontent.com/u/28005170?v=4","gravatar_id":"","url":"https://api.github.com/users/dsurnin","html_url":"https://github.com/dsurnin","followers_url":"https://api.github.com/users/dsurnin/followers","following_url":"https://api.github.com/users/dsurnin/following{/other_user}","gists_url":"https://api.github.com/users/dsurnin/gists{/gist_id}","starred_url":"https://api.github.com/users/dsurnin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsurnin/subscriptions","organizations_url":"https://api.github.com/users/dsurnin/orgs","repos_url":"https://api.github.com/users/dsurnin/repos","events_url":"https://api.github.com/users/dsurnin/events{/privacy}","received_events_url":"https://api.github.com/users/dsurnin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dsurnin/indy-plenum","description":"Plenum Byzantine Fault Tolerant Protocol","fork":true,"url":"https://api.github.com/repos/dsurnin/indy-plenum","forks_url":"https://api.github.com/repos/dsurnin/indy-plenum/forks","keys_url":"https://api.github.com/repos/dsurnin/indy-plenum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dsurnin/indy-plenum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dsurnin/indy-plenum/teams","hooks_url":"https://api.github.com/repos/dsurnin/indy-plenum/hooks","issue_events_url":"https://api.github.com/repos/dsurnin/indy-plenum/issues/events{/number}","events_url":"https://api.github.com/repos/dsurnin/indy-plenum/events","assignees_url":"https://api.github.com/repos/dsurnin/indy-plenum/assignees{/user}","branches_url":"https://api.github.com/repos/dsurnin/indy-plenum/branches{/branch}","tags_url":"https://api.github.com/repos/dsurnin/indy-plenum/tags","blobs_url":"https://api.github.com/repos/dsurnin/indy-plenum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dsurnin/indy-plenum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dsurnin/indy-plenum/git/refs{/sha}","trees_url":"https://api.github.com/repos/dsurnin/indy-plenum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dsurnin/indy-plenum/statuses/{sha}","languages_url":"https://api.github.com/repos/dsurnin/indy-plenum/languages","stargazers_url":"https://api.github.com/repos/dsurnin/indy-plenum/stargazers","contributors_url":"https://api.github.com/repos/dsurnin/indy-plenum/contributors","subscribers_url":"https://api.github.com/repos/dsurnin/indy-plenum/subscribers","subscription_url":"https://api.github.com/repos/dsurnin/indy-plenum/subscription","commits_url":"https://api.github.com/repos/dsurnin/indy-plenum/commits{/sha}","git_commits_url":"https://api.github.com/repos/dsurnin/indy-plenum/git/commits{/sha}","comments_url":"https://api.github.com/repos/dsurnin/indy-plenum/comments{/number}","issue_comment_url":"https://api.github.com/repos/dsurnin/indy-plenum/issues/comments{/number}","contents_url":"https://api.github.com/repos/dsurnin/indy-plenum/contents/{+path}","compare_url":"https://api.github.com/repos/dsurnin/indy-plenum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dsurnin/indy-plenum/merges","archive_url":"https://api.github.com/repos/dsurnin/indy-plenum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dsurnin/indy-plenum/downloads","issues_url":"https://api.github.com/repos/dsurnin/indy-plenum/issues{/number}","pulls_url":"https://api.github.com/repos/dsurnin/indy-plenum/pulls{/number}","milestones_url":"https://api.github.com/repos/dsurnin/indy-plenum/milestones{/number}","notifications_url":"https://api.github.com/repos/dsurnin/indy-plenum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dsurnin/indy-plenum/labels{/name}","releases_url":"https://api.github.com/repos/dsurnin/indy-plenum/releases{/id}","deployments_url":"https://api.github.com/repos/dsurnin/indy-plenum/deployments","created_at":"2017-06-30T11:44:10Z","updated_at":"2017-06-30T11:44:12Z","pushed_at":"2017-11-30T10:01:12Z","git_url":"git://github.com/dsurnin/indy-plenum.git","ssh_url":"git@github.com:dsurnin/indy-plenum.git","clone_url":"https://github.com/dsurnin/indy-plenum.git","svn_url":"https://github.com/dsurnin/indy-plenum","homepage":"","size":7376,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hyperledger:master","ref":"master","sha":"c23ed6cccf4f7bc130b6a950e1f915e7d8c0616b","user":{"login":"hyperledger","id":7657900,"avatar_url":"https://avatars2.githubusercontent.com/u/7657900?v=4","gravatar_id":"","url":"https://api.github.com/users/hyperledger","html_url":"https://github.com/hyperledger","followers_url":"https://api.github.com/users/hyperledger/followers","following_url":"https://api.github.com/users/hyperledger/following{/other_user}","gists_url":"https://api.github.com/users/hyperledger/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperledger/subscriptions","organizations_url":"https://api.github.com/users/hyperledger/orgs","repos_url":"https://api.github.com/users/hyperledger/repos","events_url":"https://api.github.com/users/hyperledger/events{/privacy}","received_events_url":"https://api.github.com/users/hyperledger/received_events","type":"Organization","site_admin":false},"repo":{"id":51585028,"name":"indy-plenum","full_name":"hyperledger/indy-plenum","owner":{"login":"hyperledger","id":7657900,"avatar_url":"https://avatars2.githubusercontent.com/u/7657900?v=4","gravatar_id":"","url":"https://api.github.com/users/hyperledger","html_url":"https://github.com/hyperledger","followers_url":"https://api.github.com/users/hyperledger/followers","following_url":"https://api.github.com/users/hyperledger/following{/other_user}","gists_url":"https://api.github.com/users/hyperledger/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperledger/subscriptions","organizations_url":"https://api.github.com/users/hyperledger/orgs","repos_url":"https://api.github.com/users/hyperledger/repos","events_url":"https://api.github.com/users/hyperledger/events{/privacy}","received_events_url":"https://api.github.com/users/hyperledger/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hyperledger/indy-plenum","description":"Plenum Byzantine Fault Tolerant Protocol","fork":false,"url":"https://api.github.com/repos/hyperledger/indy-plenum","forks_url":"https://api.github.com/repos/hyperledger/indy-plenum/forks","keys_url":"https://api.github.com/repos/hyperledger/indy-plenum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hyperledger/indy-plenum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hyperledger/indy-plenum/teams","hooks_url":"https://api.github.com/repos/hyperledger/indy-plenum/hooks","issue_events_url":"https://api.github.com/repos/hyperledger/indy-plenum/issues/events{/number}","events_url":"https://api.github.com/repos/hyperledger/indy-plenum/events","assignees_url":"https://api.github.com/repos/hyperledger/indy-plenum/assignees{/user}","branches_url":"https://api.github.com/repos/hyperledger/indy-plenum/branches{/branch}","tags_url":"https://api.github.com/repos/hyperledger/indy-plenum/tags","blobs_url":"https://api.github.com/repos/hyperledger/indy-plenum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hyperledger/indy-plenum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hyperledger/indy-plenum/git/refs{/sha}","trees_url":"https://api.github.com/repos/hyperledger/indy-plenum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hyperledger/indy-plenum/statuses/{sha}","languages_url":"https://api.github.com/repos/hyperledger/indy-plenum/languages","stargazers_url":"https://api.github.com/repos/hyperledger/indy-plenum/stargazers","contributors_url":"https://api.github.com/repos/hyperledger/indy-plenum/contributors","subscribers_url":"https://api.github.com/repos/hyperledger/indy-plenum/subscribers","subscription_url":"https://api.github.com/repos/hyperledger/indy-plenum/subscription","commits_url":"https://api.github.com/repos/hyperledger/indy-plenum/commits{/sha}","git_commits_url":"https://api.github.com/repos/hyperledger/indy-plenum/git/commits{/sha}","comments_url":"https://api.github.com/repos/hyperledger/indy-plenum/comments{/number}","issue_comment_url":"https://api.github.com/repos/hyperledger/indy-plenum/issues/comments{/number}","contents_url":"https://api.github.com/repos/hyperledger/indy-plenum/contents/{+path}","compare_url":"https://api.github.com/repos/hyperledger/indy-plenum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hyperledger/indy-plenum/merges","archive_url":"https://api.github.com/repos/hyperledger/indy-plenum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hyperledger/indy-plenum/downloads","issues_url":"https://api.github.com/repos/hyperledger/indy-plenum/issues{/number}","pulls_url":"https://api.github.com/repos/hyperledger/indy-plenum/pulls{/number}","milestones_url":"https://api.github.com/repos/hyperledger/indy-plenum/milestones{/number}","notifications_url":"https://api.github.com/repos/hyperledger/indy-plenum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hyperledger/indy-plenum/labels{/name}","releases_url":"https://api.github.com/repos/hyperledger/indy-plenum/releases{/id}","deployments_url":"https://api.github.com/repos/hyperledger/indy-plenum/deployments","created_at":"2016-02-12T12:03:16Z","updated_at":"2017-11-23T18:22:20Z","pushed_at":"2017-11-30T10:19:36Z","git_url":"git://github.com/hyperledger/indy-plenum.git","ssh_url":"git@github.com:hyperledger/indy-plenum.git","clone_url":"https://github.com/hyperledger/indy-plenum.git","svn_url":"https://github.com/hyperledger/indy-plenum","homepage":"","size":7056,"stargazers_count":87,"watchers_count":87,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":60,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":60,"open_issues":5,"watchers":87,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hyperledger/indy-plenum/pulls/464"},"html":{"href":"https://github.com/hyperledger/indy-plenum/pull/464"},"issue":{"href":"https://api.github.com/repos/hyperledger/indy-plenum/issues/464"},"comments":{"href":"https://api.github.com/repos/hyperledger/indy-plenum/issues/464/comments"},"review_comments":{"href":"https://api.github.com/repos/hyperledger/indy-plenum/pulls/464/comments"},"review_comment":{"href":"https://api.github.com/repos/hyperledger/indy-plenum/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hyperledger/indy-plenum/pulls/464/commits"},"statuses":{"href":"https://api.github.com/repos/hyperledger/indy-plenum/statuses/e7da4512d69c90886e13bfee6d5c6175d0de735b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ashcherbakov"}}