Skip to content

Commit

Permalink
Merge pull request #252 from ArtObr/rc-0.9.13
Browse files Browse the repository at this point in the history
[RC-0.9.13] Release candidate 0.9.13
  • Loading branch information
anikitinDSR authored Jun 6, 2019
2 parents a78a557 + a8fe04b commit 8a00a8e
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 15 deletions.
2 changes: 1 addition & 1 deletion devops/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ifeq ($(SRC_DIR_NAME),sovtoken)
# pypi: indy-plenum
# apt: indy-plenum (stable component)

FPM_P_DEPENDS := indy-node(=1.8.0)
FPM_P_DEPENDS := indy-node(=1.8.1)
FPM_ARGS := --no-python-dependencies $(FPM_ARGS)
endif

Expand Down
12 changes: 8 additions & 4 deletions devops/aws-codebuild/Jenkinsfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,23 @@ pipelineWrapper({
[name: 'OSNAME', value: osname],
[name: 'MAKE_GOALS', value: goals.join(' ')],
[name: 'SRC_DIR_NAME', value: proj],
// ST-548
//[name: 'PYTEST_ARGS', value: "-l --junit-xml=/tmp/artifacts/logs/test.${proj}.xml"],
[name: 'PYTEST_ARGS', value: "-l"],
[name: 'PYTEST_ARGS', value: "-l -v --junit-xml=/tmp/artifacts/logs/test.${proj}.xml"],
]

onArtifacts = {
this.stage("$osname:$proj: Archive artifacts") {
this.sh "ls -la logs/* || true"

utils.archiveArtifacts("logs/*.log*") {
truncate = true
allowEmptyArchive = true
}

// this.junit "logs/test.${proj}.xml"
try {
this.junit "logs/test.${proj}.xml"
} catch (ex) {
logger.warn("Failed to create jUnit report: $ciImageTag")
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions devops/docker/ci/xenial/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88 \
RUN add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial master" \
&& apt-get update && apt-get install -y \
libindy-crypto=0.4.5 \
libindy=1.8.3~1099 \
libindy=1.9.0~1122 \
libsovtoken=0.9.7~66 \
&& rm -rf /var/lib/apt/lists/*

Expand All @@ -44,4 +44,4 @@ RUN if [ "$u_id" != "0" ]; then \
USER $u_id

# TODO CMD ENTRYPOINT ...
ENV CI_ENV_VERSION=0.17.0
ENV CI_ENV_VERSION=0.18.0
3 changes: 3 additions & 0 deletions sovtoken/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
junit_logging=system-err
junit_log_passing_tests=False
4 changes: 2 additions & 2 deletions sovtoken/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
with open(os.path.join(here, 'sovtoken', '__metadata__.py'), 'r') as f:
exec(f.read(), metadata)

tests_require = ['pytest', 'pytest-xdist', 'mock', 'python3-indy==1.8.3-dev-1099']
tests_require = ['pytest>=4.6.1', 'pytest-xdist', 'mock', 'python3-indy==1.9.0-dev-1122']

setup(
name=metadata['__title__'],
Expand All @@ -38,7 +38,7 @@
'*.css', '*.ico', '*.png', 'LICENSE', 'LEGAL', 'sovtoken']},
include_package_data=True,

install_requires=['indy-node==1.8.0'],
install_requires=['indy-node==1.8.1'],

setup_requires=['pytest-runner'],
extras_require={
Expand Down
2 changes: 1 addition & 1 deletion sovtoken/sovtoken/__metadata__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# TODO: Update the field values below where needed
__title__ = 'sovtoken'
__version_info__ = (0, 9, 12)
__version_info__ = (0, 9, 13)
__version__ = '.'.join(map(str, __version_info__))
__description__ = 'Token Plugin For Indy Plenum'
__long_description__ = ''
Expand Down
4 changes: 2 additions & 2 deletions sovtoken/sovtoken/test/helpers/helper_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import time

from indy.ledger import build_nym_request, build_schema_request, \
build_acceptance_mechanism_request, build_txn_author_agreement_request, \
build_acceptance_mechanisms_request, build_txn_author_agreement_request, \
build_get_txn_author_agreement_request, append_txn_author_agreement_acceptance_to_request
from indy.payment import build_get_payment_sources_request, build_payment_req, build_mint_req, \
prepare_payment_extra_with_acceptance_data
Expand Down Expand Up @@ -162,7 +162,7 @@ def schema(
return request

def acceptance_mechanism(self, sdk_trustee_wallet, aml, aml_context=None):
acceptance_mechanism_future = build_acceptance_mechanism_request(sdk_trustee_wallet[1], aml, "0.0.1", aml_context)
acceptance_mechanism_future = build_acceptance_mechanisms_request(sdk_trustee_wallet[1], aml, "0.0.1", aml_context)
acceptance_mechanism_request = self._looper.loop.run_until_complete(acceptance_mechanism_future)
acceptance_mechanism_request = self._sdk.sdk_json_to_request_object(json.loads(acceptance_mechanism_request))
acceptance_mechanism_request = self._sign_sdk(acceptance_mechanism_request, sdk_trustee_wallet)
Expand Down
2 changes: 1 addition & 1 deletion sovtoken/sovtoken/test/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,4 @@ def test_token_wallet_get_val_null(test_wallet, address0):
def test_token_wallet_get_val_invalid_address(test_wallet):
address0_not_in_wallet = Address()
with pytest.raises(KeyError):
val = test_wallet.get_val(address0_not_in_wallet, 1)
val = test_wallet.get_val(address0_not_in_wallet, 1)
3 changes: 3 additions & 0 deletions sovtokenfees/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
junit_logging=system-err
junit_log_passing_tests=False
2 changes: 1 addition & 1 deletion sovtokenfees/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
with open(os.path.join(here, 'sovtokenfees', '__metadata__.py'), 'r') as f:
exec(f.read(), metadata)

tests_require = ['pytest', 'pytest-xdist', 'python3-indy==1.8.3-dev-1099']
tests_require = ['pytest>=4.6.1', 'pytest-xdist', 'python3-indy==1.9.0-dev-1122']

setup(

Expand Down
2 changes: 1 addition & 1 deletion sovtokenfees/sovtokenfees/__metadata__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
__maintainer__ = 'Sovrin'
__title__ = 'sovtokenfees'
__url__ = 'https://github.com/sovrin-foundation/token-plugin/tree/master/sovtokenfees'
__version_info__ = (0, 9, 12)
__version_info__ = (0, 9, 13)
__version__ = '.'.join(map(str, __version_info__))

__all__ = ['__title__',
Expand Down
56 changes: 56 additions & 0 deletions sovtokenfees/sovtokenfees/test/test_request_digest_with_fees.py
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')

0 comments on commit 8a00a8e

Please sign in to comment.