From bd1cdf44e47808d40ddeeda888aeab30e0ad9ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Eckel?= Date: Tue, 29 Nov 2022 10:56:07 +0100 Subject: [PATCH] Integration of new cryptoconditions package name and newest zenroom version (#288) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * adjusted to neweest transaction package * adjusted to new planetmint-cryptoconditions imports * added Changelog and increased version Signed-off-by: Jürgen Eckel --- CHANGELOG.md | 5 ++++- Dockerfile | 1 - Dockerfile-all-in-one | 3 --- Dockerfile-dev | 3 +-- acceptance/python/Dockerfile | 2 -- acceptance/python/src/test_zenroom.py | 4 ++-- integration/python/Dockerfile | 2 -- integration/python/src/test_threshold.py | 2 +- integration/python/src/test_zenroom.py | 2 +- planetmint/version.py | 2 +- setup.py | 9 +-------- tests/assets/test_zenroom_signing.py | 4 ++-- tests/db/test_planetmint_api.py | 2 +- tests/validation/test_transaction_structure.py | 2 +- tests/web/test_transactions.py | 2 +- 15 files changed, 16 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6b2618..469cc5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,10 @@ For reference, the possible headings are: * **Known Issues** * **Notes** -## [Unreleased] + +## [1.3.2] - 2022-28-11 +* **Changed** new zenroom 2.3.1 support +* **Changed** integrated new planetmint-cryptoconditions package (via the transactions package) ## [1.3.0] - 2022-27-10 * **Changed** migrated asset to assets diff --git a/Dockerfile b/Dockerfile index 3c2de9b..e7daeea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,6 @@ RUN apt-get -qq update \ && apt-get -y upgrade \ && apt-get install -y jq vim zsh build-essential cmake\ && pip install . \ - && pip install pynacl==1.4.0 base58==2.1.1 pyasn1==0.4.8 zenroom==2.1.0.dev1655293214 cryptography==3.4.7\ && apt-get autoremove \ && apt-get clean diff --git a/Dockerfile-all-in-one b/Dockerfile-all-in-one index 44d6fb8..5c807a7 100644 --- a/Dockerfile-all-in-one +++ b/Dockerfile-all-in-one @@ -46,7 +46,4 @@ VOLUME /data/db /data/configdb /tendermint EXPOSE 27017 28017 9984 9985 26656 26657 26658 -RUN pip install pynacl==1.4.0 base58==2.1.1 pyasn1==0.4.8 zenroom==2.1.0.dev1655293214 cryptography==3.4.7 - - WORKDIR $HOME \ No newline at end of file diff --git a/Dockerfile-dev b/Dockerfile-dev index e4bd022..b9ccdd3 100644 --- a/Dockerfile-dev +++ b/Dockerfile-dev @@ -33,5 +33,4 @@ RUN mkdir -p /usr/src/app COPY . /usr/src/app/ WORKDIR /usr/src/app RUN pip install -e .[dev] -RUN pip install flask-cors -RUN pip install pynacl==1.4.0 base58==2.1.1 pyasn1==0.4.8 zenroom==2.1.0.dev1655293214 cryptography==3.4.7 \ No newline at end of file +RUN pip install flask-cors \ No newline at end of file diff --git a/acceptance/python/Dockerfile b/acceptance/python/Dockerfile index 8ddb3f4..67f053e 100644 --- a/acceptance/python/Dockerfile +++ b/acceptance/python/Dockerfile @@ -13,8 +13,6 @@ RUN pip install --upgrade \ pycco \ websocket-client~=0.47.0 \ pytest~=3.0 \ - planetmint-cryptoconditions>=0.10.0\ planetmint-driver>=0.9.2 \ blns -RUN pip install base58>=2.1.1 pynacl==1.4.0 zenroom==2.1.0.dev1655293214 pyasn1==0.4.8 cryptography==3.4.7 RUN pip install planetmint-ipld>=0.0.3 diff --git a/acceptance/python/src/test_zenroom.py b/acceptance/python/src/test_zenroom.py index 24f9a0e..1b9ea14 100644 --- a/acceptance/python/src/test_zenroom.py +++ b/acceptance/python/src/test_zenroom.py @@ -2,8 +2,8 @@ import os import json import base58 from hashlib import sha3_256 -from cryptoconditions.types.ed25519 import Ed25519Sha256 -from cryptoconditions.types.zenroom import ZenroomSha256 +from planetmint_cryptoconditions.types.ed25519 import Ed25519Sha256 +from planetmint_cryptoconditions.types.zenroom import ZenroomSha256 from zenroom import zencode_exec from planetmint_driver import Planetmint from planetmint_driver.crypto import generate_keypair diff --git a/integration/python/Dockerfile b/integration/python/Dockerfile index c710550..77ac208 100644 --- a/integration/python/Dockerfile +++ b/integration/python/Dockerfile @@ -15,7 +15,5 @@ RUN pip install --upgrade \ pytest~=6.2.5 \ pycco \ websocket-client~=0.47.0 \ - planetmint-cryptoconditions>=0.10.0 \ planetmint-driver>=9.2.0 \ blns -RUN pip install base58 pynacl==1.4.0 zenroom==2.1.0.dev1655293214 pyasn1==0.4.8 cryptography==3.4.7 diff --git a/integration/python/src/test_threshold.py b/integration/python/src/test_threshold.py index 07c76e1..9e9a843 100644 --- a/integration/python/src/test_threshold.py +++ b/integration/python/src/test_threshold.py @@ -10,7 +10,7 @@ import json # For this test case we need the planetmint_driver.crypto package import base58 import sha3 -from cryptoconditions import Ed25519Sha256, ThresholdSha256 +from planetmint_cryptoconditions import Ed25519Sha256, ThresholdSha256 from planetmint_driver.crypto import generate_keypair # Import helper to deal with multiple nodes diff --git a/integration/python/src/test_zenroom.py b/integration/python/src/test_zenroom.py index 6591314..1f33ca0 100644 --- a/integration/python/src/test_zenroom.py +++ b/integration/python/src/test_zenroom.py @@ -1,7 +1,7 @@ import json import base58 from hashlib import sha3_256 -from cryptoconditions.types.zenroom import ZenroomSha256 +from planetmint_cryptoconditions.types.zenroom import ZenroomSha256 from planetmint_driver.crypto import generate_keypair from .helper.hosts import Hosts from zenroom import zencode_exec diff --git a/planetmint/version.py b/planetmint/version.py index b59ddda..643df2c 100644 --- a/planetmint/version.py +++ b/planetmint/version.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) # Code is Apache-2.0 and docs are CC-BY-4.0 -__version__ = "1.3.1" +__version__ = "1.3.2" __short_version__ = "1.3" # Supported Tendermint versions diff --git a/setup.py b/setup.py index aecfb9f..f41e21a 100644 --- a/setup.py +++ b/setup.py @@ -111,7 +111,6 @@ install_requires = [ "base58==2.1.1", "aiohttp==3.8.1", "abci==0.8.3", - "planetmint-cryptoconditions>=0.10.0", "flask-cors==3.0.10", "flask-restful==0.3.9", "flask==2.1.2", @@ -119,7 +118,6 @@ install_requires = [ "jsonschema==4.16.0", "logstats==0.3.0", "packaging>=20.9", - # TODO Consider not installing the db drivers, or putting them in extras. "pymongo==3.11.4", "tarantool==0.7.1", "python-rapidjson>=1.0", @@ -130,14 +128,9 @@ install_requires = [ "nest-asyncio==1.5.5", "protobuf==3.20.1", "planetmint-ipld>=0.0.3", - "pyasn1", - "zenroom==2.1.0.dev1655293214", - "base58>=2.1.0", - "PyNaCl==1.4.0", "pyasn1>=0.4.8", - "cryptography==3.4.7", "python-decouple", - "planetmint-transactions==0.2.0", + "planetmint-transactions>=0.2.2", ] setup( diff --git a/tests/assets/test_zenroom_signing.py b/tests/assets/test_zenroom_signing.py index 3711bc7..8b75677 100644 --- a/tests/assets/test_zenroom_signing.py +++ b/tests/assets/test_zenroom_signing.py @@ -3,7 +3,7 @@ import base58 from hashlib import sha3_256 from zenroom import zencode_exec -from cryptoconditions.types.zenroom import ZenroomSha256 +from planetmint_cryptoconditions.types.zenroom import ZenroomSha256 from transactions.common.crypto import generate_key_pair from ipld import multihash, marshal @@ -32,7 +32,7 @@ GENERATE_KEYPAIR = """Scenario 'ecdh': Create the keypair Given that I am known as 'Pippo' When I create the ecdh key When I create the bitcoin key - Then print data""" + Then print keyring""" INITIAL_STATE = {"also": "more data"} SCRIPT_INPUT = { diff --git a/tests/db/test_planetmint_api.py b/tests/db/test_planetmint_api.py index 98dcb55..f0bcbc0 100644 --- a/tests/db/test_planetmint_api.py +++ b/tests/db/test_planetmint_api.py @@ -86,7 +86,7 @@ class TestBigchainApi(object): @pytest.mark.usefixtures("inputs") def test_non_create_input_not_found(self, b, user_pk): - from cryptoconditions import Ed25519Sha256 + from planetmint_cryptoconditions import Ed25519Sha256 from transactions.common.exceptions import InputDoesNotExist from transactions.common.transaction import Input, TransactionLink diff --git a/tests/validation/test_transaction_structure.py b/tests/validation/test_transaction_structure.py index e13a376..ed6eae3 100644 --- a/tests/validation/test_transaction_structure.py +++ b/tests/validation/test_transaction_structure.py @@ -232,7 +232,7 @@ def test_handle_threshold_overflow(): def test_unsupported_condition_type(): - from cryptoconditions.exceptions import UnsupportedTypeError + from planetmint_cryptoconditions.exceptions import UnsupportedTypeError with pytest.raises(UnsupportedTypeError): _fulfillment_from_details({"type": "a"}) diff --git a/tests/web/test_transactions.py b/tests/web/test_transactions.py index 89e93e6..e4e8007 100644 --- a/tests/web/test_transactions.py +++ b/tests/web/test_transactions.py @@ -8,7 +8,7 @@ import base58 import pytest from unittest.mock import Mock, patch -from cryptoconditions import Ed25519Sha256 +from planetmint_cryptoconditions import Ed25519Sha256 from ipld import multihash, marshal from hashlib import sha3_256