Skip to content

Commit

Permalink
Non empty verkey (hyperledger#174)
Browse files Browse the repository at this point in the history
* update tests for non-empty verkey

* bump dependency version
  • Loading branch information
lovesh authored and ashcherbakov committed Jun 7, 2017
1 parent a8f30fd commit 05dd9cc
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def run(self):
data_files=[(
(BASE_DIR, ['data/nssm_original.exe'])
)],
install_requires=['sovrin-common-dev==0.2.82', 'python-dateutil'],
install_requires=['sovrin-common-dev==0.2.83', 'python-dateutil'],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'sovrin-client-dev==0.3.127'],
scripts=['scripts/start_sovrin_node',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,16 @@ def some_transactions_done(looper, nodeSet, tdirWithPoolTxns, trustee,
# in the same manner, this fails during catchup since the nodes that
# processed the transaction saw verkey as `''` but while deserialising the
# ledger they cannot differentiate between None and empty string.
updateSovrinIdrWithVerkey(looper, new_w, new_c,
new_idr, '')
# updateSovrinIdrWithVerkey(looper, new_w, new_c,
# new_idr, '')


def test_new_node_catchup_update_projection(looper, tdirWithPoolTxns,
tdirWithDomainTxnsUpdated,
nodeSet, tconf,
trustee, trusteeWallet,
allPluginsPath,
# The next fixture fails the test, explained in the fixture
# some_transactions_done
some_transactions_done
):
"""
A node which receives txns from catchup updates both ledger and projection
Expand Down
6 changes: 3 additions & 3 deletions sovrin_node/test/did/test_did_with_full_verkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def didUpdatedWithFullVerkey(didAddedWithFullVerkey, looper, trustAnchor,


@pf
def newVerkeyFetched(didAddedWithFullVerkey, looper, trustAnchor, trustAnchorWallet,
fullKeyIdr, wallet):
def newVerkeyFetched(didAddedWithFullVerkey, looper, trustAnchor,
trustAnchorWallet, fullKeyIdr, wallet):
"""{ type: GET_NYM, dest: <id1> }"""
fetchFullVerkeyFromSovrin(looper, trustAnchorWallet, trustAnchor, wallet,
fullKeyIdr)
Expand All @@ -68,7 +68,7 @@ def testRetrieveFullVerkey(didAddedWithFullVerkey, looper, trustAnchor,
"""{ type: GET_NYM, dest: <id1> }"""
identity = Identity(identifier=fullKeyIdr)
req = trustAnchorWallet.requestIdentity(identity,
sender=trustAnchorWallet.defaultId)
sender=trustAnchorWallet.defaultId)
trustAnchor.submitReqs(req)

def chk():
Expand Down
3 changes: 2 additions & 1 deletion sovrin_node/test/did/test_did_with_no_verkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def testRetrieveEmptyVerkey(didAddedWithoutVerkey, looper, trustAnchor,
trustAnchorWallet, noKeyIdr):
"""{ type: GET_NYM, dest: <id1> }"""
identity = Identity(identifier=noKeyIdr)
req = trustAnchorWallet.requestIdentity(identity, sender=trustAnchorWallet.defaultId)
req = trustAnchorWallet.requestIdentity(identity,
sender=trustAnchorWallet.defaultId)
trustAnchor.submitReqs(req)

def chk():
Expand Down
7 changes: 5 additions & 2 deletions sovrin_node/test/suspension/test_suspension.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest

from plenum.common.signer_did import DidSigner
from sovrin_node.test.suspension.helper import sendChangeVerkey, checkIdentityRequestFailed, \
checkIdentityRequestSucceed, sendSuspendRole, changeVerkey, suspendRole
from stp_core.loop.eventually import eventually
Expand Down Expand Up @@ -114,10 +115,12 @@ def testTrusteeCannotChangeVerkey(trustee, trusteeWallet, looper, nodeSet,
for identity in (anotherTrustee, anotherTGB, anotherSteward, anotherTrustAnchor):
# Trustee cannot change verkey
_, wallet = identity
changeVerkey(looper, trustee, trusteeWallet, wallet.defaultId, '',
signer = DidSigner()
changeVerkey(looper, trustee, trusteeWallet, wallet.defaultId,
signer.verkey,
nAckReasonContains='TRUSTEE cannot update verkey')
# Identity owner can change verkey
changeVerkey(looper, *identity, wallet.defaultId, '')
changeVerkey(looper, *identity, wallet.defaultId, signer.verkey)


# Keep the test below at the end of the suite since it will make one of the
Expand Down

0 comments on commit 05dd9cc

Please sign in to comment.