Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sdk to tests #469

Merged
merged 42 commits into from
Dec 5, 2017
Merged

Sdk to tests #469

merged 42 commits into from
Dec 5, 2017

Conversation

dsurnin
Copy link
Contributor

@dsurnin dsurnin commented Dec 5, 2017

No description provided.

Dmitry Surnin and others added 30 commits November 16, 2017 14:46
Signed-off-by: Dmitry Surnin <[email protected]>
Signed-off-by: Dmitry Surnin <[email protected]>
Signed-off-by: Dmitry Surnin <[email protected]>
Signed-off-by: Dmitry Surnin <[email protected]>
Signed-off-by: Dmitry Surnin <[email protected]>
Signed-off-by: Dmitry Surnin <[email protected]>
…naure field in request serialization

Signed-off-by: Dmitry Surnin <[email protected]>
Signed-off-by: Dmitry Surnin <[email protected]>
Signed-off-by: Dmitry Surnin <[email protected]>
helper and test_catchup_during_3pc
Signed-off-by: Dmitry Surnin <[email protected]>
Signed-off-by: Dmitry Surnin <[email protected]>
Signed-off-by: Dmitry Surnin <[email protected]>
from plenum.test.test_client import TestClient, genTestClient
from plenum.test.test_node import TestNode, TestReplica, TestNodeSet, \
checkNodesConnected, ensureElectionsDone, NodeRef, getPrimaryReplica
from stp_core.common.log import getlogger
from stp_core.loop.eventually import eventuallyAll, eventually
from stp_core.loop.looper import Looper
from stp_core.network.util import checkPortAvailable
from typing import Sequence
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you move that into the upper import statement for 'typing'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

from plenum.test.test_client import TestClient, genTestClient
from plenum.test.test_node import TestNode, TestReplica, TestNodeSet, \
checkNodesConnected, ensureElectionsDone, NodeRef, getPrimaryReplica
from stp_core.common.log import getlogger
from stp_core.loop.eventually import eventuallyAll, eventually
from stp_core.loop.looper import Looper
from stp_core.network.util import checkPortAvailable
from typing import Sequence
from plenum.common.constants import CURRENT_PROTOCOL_VERSION
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

from typing import Sequence
from plenum.common.constants import CURRENT_PROTOCOL_VERSION
from plenum.common.request import Request
import json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you move that to the beginning of the file where all global imports are defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

import json
from indy.ledger import sign_and_submit_request, sign_request, submit_request, build_nym_request
from indy.error import ErrorCode, IndyError
import asyncio
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same

rem = num_reqs % num_batches
if rem == 0:
rem = num_reqs // num_batches
sdk_resps.extend(sdk_send_random_and_check(looper, txnPoolNodeSet, sdk_pool, sdk_wallet, rem, **kwargs))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems in current logic we will send num_batches + 1. also rem==0 is also is not checked

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is ok
range - 1 generates num_batches -1 sends
the last chunk contains less or equal reqs, so last send will contain full batch or less txns

@@ -70,6 +64,8 @@ def testRequestDynamicValidation(tconf, looper, txnPoolNodeSet,
REJECT is sent to the client
:return:
"""
# Change this test for using SDK.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, add TODO mark

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -58,6 +58,12 @@
from plenum.test.test_node import TestNode, TestNodeSet, Pool, \
checkNodesConnected, ensureElectionsDone, genNodeReg
from plenum.common.config_helper import PConfigHelper, PNodeConfigHelper
import json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, move that to the beginning of the file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Signed-off-by: Dmitry Surnin <[email protected]>
@andkononykhin andkononykhin merged commit b1bd9bf into hyperledger:master Dec 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants