forked from hyperledger/indy-plenum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INDY-1148] It's possible to create several nodes with the same alias (…
…hyperledger#554) add dynamic validation of alias and test Signed-off-by: toktar <[email protected]> put alias validation into PoolRequestHandler.isNodeDataConflicting Signed-off-by: toktar <[email protected]> change validation in pool_req_handler. Signed-off-by: toktar <[email protected]>
- Loading branch information
Showing
2 changed files
with
34 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from plenum.common.constants import STEWARD, DATA | ||
from plenum.common.request import Request | ||
from plenum.test.pool_transactions.helper import sendAddNewNode, addNewClient | ||
from plenum.test.helper import waitRejectWithReason | ||
|
||
|
||
def test_add_node_with_not_unique_alias(looper, | ||
tdir, | ||
tconf, | ||
txnPoolNodeSet, | ||
steward1, | ||
stewardWallet): | ||
newNodeName = "Alpha" | ||
newSteward = addNewClient(STEWARD, looper, steward1, stewardWallet, | ||
"testStewardMy") | ||
newNode = sendAddNewNode(tdir, tconf, newNodeName, steward1, newSteward) | ||
data = {} | ||
for item in newNode: | ||
if isinstance(item, Request): | ||
data = item.operation.get(DATA) | ||
|
||
for node in txnPoolNodeSet: | ||
waitRejectWithReason(looper, steward1, | ||
"existing data has conflicts with " + | ||
"request data {}".format(data), | ||
node.clientstack.name) |