-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #252 from ArtObr/rc-0.9.13
[RC-0.9.13] Release candidate 0.9.13
- Loading branch information
Showing
12 changed files
with
81 additions
and
15 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
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,3 @@ | ||
[pytest] | ||
junit_logging=system-err | ||
junit_log_passing_tests=False |
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
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
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,3 @@ | ||
[pytest] | ||
junit_logging=system-err | ||
junit_log_passing_tests=False |
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
56 changes: 56 additions & 0 deletions
56
sovtokenfees/sovtokenfees/test/test_request_digest_with_fees.py
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,56 @@ | ||
import copy | ||
import json | ||
|
||
import pytest | ||
from plenum.test.pool_transactions.helper import prepare_nym_request | ||
from sovtokenfees.test.helper import nyms_with_fees, get_amount_from_token_txn | ||
|
||
from plenum.common.exceptions import RequestNackedException | ||
from plenum.common.util import randomString | ||
|
||
from plenum.test.helper import sdk_get_and_check_replies, sdk_sign_request_objects, \ | ||
sdk_json_to_request_object | ||
|
||
|
||
@pytest.fixture(scope='function') | ||
def two_requests(looper, helpers, | ||
nodeSetWithIntegratedTokenPlugin, | ||
sdk_pool_handle, | ||
fees_set, address_main, mint_tokens, sdk_wallet_steward): | ||
amount = get_amount_from_token_txn(mint_tokens) | ||
init_seq_no = 1 | ||
|
||
seed = randomString(32) | ||
alias = randomString(5) | ||
wh, _ = sdk_wallet_steward | ||
nym_request, new_did = looper.loop.run_until_complete( | ||
prepare_nym_request(sdk_wallet_steward, seed, | ||
alias, None)) | ||
nym_request = \ | ||
sdk_sign_request_objects(looper, sdk_wallet_steward, [sdk_json_to_request_object(json.loads(nym_request))])[0] | ||
req_obj = sdk_json_to_request_object(json.loads(nym_request)) | ||
helpers.request.nym = lambda: copy.deepcopy(req_obj) | ||
|
||
req1, req2 = nyms_with_fees(2, | ||
helpers, | ||
fees_set, | ||
address_main, | ||
amount, | ||
init_seq_no=init_seq_no) | ||
|
||
assert req1.payload_digest == req2.payload_digest | ||
assert req1.digest != req2.digest | ||
return req1, req2 | ||
|
||
|
||
def test_send_same_txn_with_different_fees(helpers, looper, nodeSetWithIntegratedTokenPlugin, | ||
sdk_pool_handle, two_requests): | ||
req1, req2 = two_requests | ||
|
||
resp = helpers.sdk.send_request_objects([req1], ) | ||
sdk_get_and_check_replies(looper, resp) | ||
|
||
resp = helpers.sdk.send_request_objects([req2]) | ||
with pytest.raises(RequestNackedException) as e: | ||
sdk_get_and_check_replies(looper, resp) | ||
e.match('Same txn was already ordered with different signatures or pluggable fields') |