Skip to content

Commit

Permalink
Merge pull request #32 from derekpierre/core-11
Browse files Browse the repository at this point in the history
Update Porter to use `nucypher-core` 0.11.0.
  • Loading branch information
derekpierre authored Aug 23, 2023
2 parents 0ec1dda + 46ba8b3 commit 721183c
Show file tree
Hide file tree
Showing 9 changed files with 136 additions and 65 deletions.
6 changes: 3 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ name = "pypi"
python_version = "3"

[packages]
nucypher = {git = "https://github.com/nucypher/nucypher.git", ref = "dkg-dev-7"}
nucypher-core = ">=0.10.0" # must be the same as nucypher
nucypher = {git = "https://github.com/nucypher/nucypher.git", ref = "dkg-dev-8"}
nucypher-core = ">=0.11.0" # must be the same as nucypher
flask-cors = "*"

[dev-packages]
nucypher = {git = "https://github.com/nucypher/nucypher.git", editable = true, ref = "dkg-dev-7", extras = ["dev"]} # needed for testerchain, and must be editable
nucypher = {git = "https://github.com/nucypher/nucypher.git", editable = true, ref = "dkg-dev-8", extras = ["dev"]} # needed for testerchain, and must be editable
pytest = "<7" # match with nucypher/nucypher
pytest-cov = "*"
pytest-mock = "*"
Expand Down
162 changes: 117 additions & 45 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deploy/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ WORKDIR /code
COPY . /code

# Porter requirements
RUN pip3 install .
RUN pip3 install .[dev]

CMD ["/bin/bash"]
8 changes: 4 additions & 4 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ msgspec==0.15.1 ; python_version >= '3.8'
multidict==5.2.0 ; python_version >= '3.6'
mypy-extensions==0.4.4 ; python_version >= '2.7'
nodeenv==1.8.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6'
nucypher @ git+https://github.com/nucypher/nucypher.git@1032a2b5560ef8e5afa02097510f13812943e219
nucypher-core==0.10.0
git+https://github.com/nucypher/nucypher.git@788073d93cdc5a94568e004a6f7b7bf342b1805d#egg=nucypher
nucypher-core==0.11.0
numpy==1.24.3 ; python_version >= '3.8'
packaging==23.1 ; python_version >= '3.7'
pandas==1.5.3 ; python_version >= '3.8'
Expand All @@ -100,7 +100,7 @@ pkgutil-resolve-name==1.3.10 ; python_version >= '3.6'
platformdirs==3.5.1 ; python_version >= '3.7'
pluggy==1.0.0 ; python_version >= '3.6'
pre-commit==3.3.2
prometheus-client==0.17.0 ; python_version >= '3.6'
prometheus-client==0.17.1 ; python_version >= '3.6'
prompt-toolkit==3.0.38 ; python_full_version >= '3.7.0'
protobuf==4.23.2 ; python_version >= '3.7'
ptyprocess==0.7.0
Expand Down Expand Up @@ -143,7 +143,7 @@ rich==12.6.0 ; python_full_version >= '3.6.3' and python_full_version < '4.0.0'
rlp==3.0.0
rpds-py==0.7.1 ; python_version >= '3.8'
semantic-version==2.10.0 ; python_version >= '2.7'
sentry-sdk==1.26.0
sentry-sdk==1.29.2
service-identity==21.1.0
setuptools==67.8.0 ; python_version >= '3.7'
six==1.16.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ msgpack==1.0.5
msgpack-python==0.5.6
multidict==5.2.0 ; python_version >= '3.6'
mypy-extensions==0.4.4 ; python_version >= '2.7'
nucypher @ git+https://github.com/nucypher/nucypher.git@1032a2b5560ef8e5afa02097510f13812943e219
nucypher-core==0.10.0
git+https://github.com/nucypher/nucypher.git@788073d93cdc5a94568e004a6f7b7bf342b1805d#egg=nucypher
nucypher-core==0.11.0
packaging==23.1 ; python_version >= '3.7'
parsimonious==0.9.0
pendulum==3.0.0a1 ; python_version >= '3.7' and python_version < '4.0'
Expand Down
4 changes: 2 additions & 2 deletions tests/cbd/test_cbd_specifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import pytest
from eth_utils import to_checksum_address
from nucypher.crypto.ferveo.dkg import FerveoVariant
from nucypher_core import Conditions, SessionStaticSecret, ThresholdDecryptionRequest
from nucypher_core.ferveo import FerveoVariant

from porter.fields.cbd import (
EncryptedThresholdDecryptionRequestField,
Expand All @@ -24,7 +24,7 @@ def test_cbd_decrypt(

decryption_request = ThresholdDecryptionRequest(
ritual_id=ritual_id,
variant=int(FerveoVariant.SIMPLE.value),
variant=FerveoVariant.Simple,
ciphertext=ciphertext,
conditions=Conditions(json.dumps(conditions)),
)
Expand Down
5 changes: 2 additions & 3 deletions tests/cbd/test_porter_cbd_python_interface.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import json

from nucypher.crypto.ferveo.dkg import FerveoVariant
from nucypher_core import Conditions, SessionStaticSecret, ThresholdDecryptionRequest
from nucypher_core.ferveo import (
Ciphertext,
DecryptionShareSimple,
combine_decryption_shares_simple,
decrypt_with_shared_secret,
FerveoVariant,
)


Expand All @@ -16,7 +15,7 @@ def test_cbd_decryption(porter, dkg_setup, dkg_encrypted_data):

decryption_request = ThresholdDecryptionRequest(
ritual_id=ritual_id,
variant=int(FerveoVariant.SIMPLE.value),
variant=FerveoVariant.Simple,
ciphertext=ciphertext,
conditions=Conditions(json.dumps(conditions)),
)
Expand Down
6 changes: 3 additions & 3 deletions tests/cbd/test_porter_cbd_web_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from base64 import b64decode

from eth_utils import to_checksum_address
from nucypher.crypto.ferveo.dkg import FerveoVariant
from nucypher_core import (
Conditions,
EncryptedThresholdDecryptionResponse,
Expand All @@ -13,6 +12,7 @@
DecryptionShareSimple,
combine_decryption_shares_simple,
decrypt_with_shared_secret,
FerveoVariant,
)

from porter.fields.cbd import EncryptedThresholdDecryptionRequestField
Expand All @@ -36,7 +36,7 @@ def test_cbd_decrypt(

decryption_request = ThresholdDecryptionRequest(
ritual_id=ritual_id,
variant=int(FerveoVariant.SIMPLE.value),
variant=FerveoVariant.Simple,
ciphertext=ciphertext,
conditions=Conditions(json.dumps(conditions)),
)
Expand Down Expand Up @@ -133,7 +133,7 @@ def test_cbd_decrypt(
# invalid data
request = ThresholdDecryptionRequest(
ritual_id=999, # rando invalid ritual id
variant=int(FerveoVariant.SIMPLE.value),
variant=FerveoVariant.Simple,
ciphertext=ciphertext,
conditions=Conditions(json.dumps(conditions)),
)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import pytest
from eth_utils import to_canonical_address
from marshmallow import fields as marshmallow_fields
from nucypher.crypto.ferveo.dkg import FerveoVariant
from nucypher_core import (
Address,
Conditions,
Expand All @@ -19,6 +18,7 @@
ThresholdDecryptionRequest,
ThresholdDecryptionResponse,
)
from nucypher_core.ferveo import FerveoVariant
from nucypher_core.umbral import SecretKey

from porter.fields.base import (
Expand Down Expand Up @@ -300,7 +300,7 @@ def test_encrypted_threshold_decryption_request(dkg_setup, dkg_encrypted_data):

decryption_request = ThresholdDecryptionRequest(
ritual_id=ritual_id,
variant=int(FerveoVariant.SIMPLE.value),
variant=FerveoVariant.Simple,
ciphertext=ciphertext,
conditions=Conditions(json.dumps(conditions)),
)
Expand Down

0 comments on commit 721183c

Please sign in to comment.