Test network did
* added some tests for genesis pool files, showing some brittlness
* Changed test_network_setup to use DIDs
test_network_setup used cryptonym but we are switching over to DID style Ids. Cli no longer easily support cryptonym so we need the test genisus txn to also use DID.
@@ -15,6 +15,7 @@ from plenum.common.member.steward import Steward
from plenum.common.keygen_utils import initLocalKeys
from plenum.common.constants import STEWARD, CLIENT_STACK_SUFFIX, TRUSTEE
from plenum.common.util import hexToFriendly
+from plenum.common.signer_did import DidSigner
from stp_core.common.util import adict
@@ -71,11 +72,11 @@ class TestNetworkSetup:
domainLedger = cls.init_domain_ledger(appendToLedgers, baseDir, config,
envName, domainTxnFieldOrder)
- trustee_txn = Member.nym_txn(trustee_def.nym, trustee_def.name, role=TRUSTEE)
+ trustee_txn = Member.nym_txn(trustee_def.nym, trustee_def.name, verkey=trustee_def.verkey, role=TRUSTEE)
domainLedger.add(trustee_txn)
for sd in steward_defs:
- nym_txn = Member.nym_txn(sd.nym, sd.name, role=STEWARD,
+ nym_txn = Member.nym_txn(sd.nym, sd.name, verkey=sd.verkey, role=STEWARD,
creator=trustee_def.nym)
domainLedger.add(nym_txn)
@@ -108,7 +109,7 @@ class TestNetworkSetup:
poolLedger.add(node_txn)
for cd in client_defs:
- txn = Member.nym_txn(cd.nym, cd.name, creator=trustee_def.nym)
+ txn = Member.nym_txn(cd.nym, cd.name, verkey=cd.verkey, creator=trustee_def.nym)
domainLedger.add(txn)
poolLedger.stop()
@@ -258,9 +259,10 @@ class TestNetworkSetup:
for i in range(1, nodeCount + 1):
d = adict()
d.name = "Steward" + str(i)
- s_sigseed = cls.getSigningSeed(d.name)
- s_verkey = Signer(s_sigseed).verhex
- d.nym = cls.getNymFromVerkey(s_verkey)
+ d.sigseed = cls.getSigningSeed(d.name)
+ s_signer = DidSigner(seed=d.sigseed)
+ d.nym = s_signer.identifier
+ d.verkey = s_signer.verkey
steward_defs.append(d)
name = "Node" + str(i)
@@ -281,8 +283,9 @@ class TestNetworkSetup:
d = adict()
d.name = "Client" + str(idx)
d.sigseed = cls.getSigningSeed(d.name)
- d.verkey = Signer(d.sigseed).verhex
- d.nym = cls.getNymFromVerkey(d.verkey)
+ c_signer = DidSigner(seed=d.sigseed)
+ d.nym = c_signer.identifier
+ d.verkey = c_signer.verkey
return d
@classmethod
@@ -294,8 +297,9 @@ class TestNetworkSetup:
d = adict()
d.name = 'Trustee' + str(idx)
d.sigseed = cls.getSigningSeed(d.name)
- d.verkey = Signer(d.sigseed).verhex
- d.nym = cls.getNymFromVerkey(d.verkey)
+ t_signer = DidSigner(seed=d.sigseed)
+ d.nym = t_signer.identifier
+ d.verkey = t_signer.verkey
return d
