File tree Expand file tree Collapse file tree 14 files changed +79
-26
lines changed Expand file tree Collapse file tree 14 files changed +79
-26
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ RUN pip install --upgrade pip wheel twine
2020
2121# Preinstall dependencies for faster steps
2222RUN pip install --upgrade secp256k1 coincurve aiohttp eciespy python-magic typer
23- RUN pip install --upgrade 'aleph-message~=0.3.1 ' eth_account pynacl base58
23+ RUN pip install --upgrade 'aleph-message~=0.4.0 ' eth_account pynacl base58
2424RUN pip install --upgrade pytest pytest-cov pytest-asyncio mypy types-setuptools pytest-asyncio fastapi httpx requests
2525
2626WORKDIR /opt/aleph-sdk-python/
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ RUN pip install --upgrade pip wheel twine
2020
2121# Preinstall dependencies for faster steps
2222RUN pip install --upgrade secp256k1 coincurve aiohttp eciespy python-magic typer
23- RUN pip install --upgrade 'aleph-message~=0.3.1 ' pynacl base58
23+ RUN pip install --upgrade 'aleph-message~=0.4.0 ' pynacl base58
2424RUN pip install --upgrade pytest pytest-cov pytest-asyncio mypy types-setuptools pytest-asyncio fastapi httpx requests
2525
2626WORKDIR /opt/aleph-sdk-python/
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ RUN pip install --upgrade pip wheel twine
2020
2121# Preinstall dependencies for faster steps
2222RUN pip install --upgrade secp256k1 coincurve aiohttp eciespy python-magic typer
23- RUN pip install --upgrade 'aleph-message~=0.3.1 ' eth_account pynacl base58
23+ RUN pip install --upgrade 'aleph-message~=0.4.0 ' eth_account pynacl base58
2424RUN pip install --upgrade pytest pytest-cov pytest-asyncio mypy types-setuptools pytest-asyncio fastapi httpx requests
2525
2626WORKDIR /opt/aleph-sdk-python/
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ RUN pip install --upgrade pip wheel twine
2525
2626# Preinstall dependencies for faster steps
2727RUN pip install --upgrade secp256k1 coincurve aiohttp eciespy python-magic typer
28- RUN pip install --upgrade 'aleph-message~=0.3.1 ' eth_account pynacl base58
28+ RUN pip install --upgrade 'aleph-message~=0.4.0 ' eth_account pynacl base58
2929RUN pip install --upgrade pytest pytest-cov pytest-asyncio mypy types-setuptools pytest-asyncio fastapi httpx requests
3030
3131WORKDIR /opt/aleph-sdk-python/
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ RUN pip install --upgrade pip wheel twine
2525
2626# Preinstall dependencies for faster steps
2727RUN pip install --upgrade secp256k1 coincurve aiohttp eciespy python-magic typer
28- RUN pip install --upgrade 'aleph-message~=0.3.1 ' eth_account pynacl base58
28+ RUN pip install --upgrade 'aleph-message~=0.4.0 ' eth_account pynacl base58
2929RUN pip install --upgrade pytest pytest-cov pytest-asyncio mypy types-setuptools pytest-asyncio fastapi httpx requests
3030
3131WORKDIR /opt/aleph-sdk-python/
Original file line number Diff line number Diff line change 1010 DOCKER_COMMAND=docker
1111fi
1212
13- $DOCKER_COMMAND build -t aleph-sdk-python -f docker/Dockerfile .
13+ $DOCKER_COMMAND build -t aleph-sdk-python -f docker/python-3.9.dockerfile .
1414$DOCKER_COMMAND run -ti --rm --entrypoint /bin/bash -v " $( pwd) " :/opt/aleph-sdk-python aleph-sdk-python
Original file line number Diff line number Diff line change 1010 DOCKER_COMMAND=docker
1111fi
1212
13- $DOCKER_COMMAND build -t aleph-sdk-python -f docker/Dockerfile .
13+ $DOCKER_COMMAND build -t aleph-sdk-python -f docker/python-3.9.dockerfile .
1414$DOCKER_COMMAND run -ti --rm --entrypoint /opt/venv/bin/pytest aleph-sdk-python /opt/aleph-sdk-python/ " $@ "
1515$DOCKER_COMMAND run -ti --rm --entrypoint /opt/venv/bin/mypy aleph-sdk-python /opt/aleph-sdk-python/src/ --ignore-missing-imports
Original file line number Diff line number Diff line change 1313mkdir -p ./dist
1414chmod 0777 ./dist
1515
16- $DOCKER_COMMAND build -t aleph-sdk-python -f docker/Dockerfile .
16+ $DOCKER_COMMAND build -t aleph-sdk-python -f docker/python-3.9.dockerfile .
1717$DOCKER_COMMAND run -ti --rm \
1818 -w /opt/aleph-sdk-python \
1919 -v " $( pwd) /dist" :/opt/aleph-sdk-python/dist \
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ install_requires =
3838 eciespy>=0.3.13; python_version>="3.11"
3939 typing_extensions
4040 typer
41- aleph-message~=0.3.2
41+ aleph-message ==0.4.0
4242 eth_account>=0.4.0
4343 # Required to fix a dependency issue with parsimonious and Python3.11
4444 eth_abi ==4.0.0b2; python_version>="3.11"
@@ -59,7 +59,7 @@ exclude =
5959# PDF = ReportLab; RXP
6060# Add here test requirements (semicolon/line-separated)
6161testing =
62- aiomqtt
62+ aiomqtt<=0.1.3
6363 psutil
6464 pytest
6565 pytest-cov
@@ -80,12 +80,11 @@ testing =
8080 isort
8181 flake8
8282mqtt =
83- aiomqtt
83+ aiomqtt<=0.1.3
8484 certifi
8585 Click
8686nuls2 =
87- # use the branch with support for Python 3.11
88- nuls2-python@git+https://github.com/odesenfans/nuls2-python.git@fda2ba4a5f9397f4f84cfee738942c4a15f88840
87+ aleph-nuls2
8988ethereum =
9089 eth_account>=0.4.0
9190 # Required to fix a dependency issue with parsimonious and Python3.11
Original file line number Diff line number Diff line change 1+ import logging
12from abc import ABC , abstractmethod
23from pathlib import Path
34from typing import Dict , Optional
67from ecies import decrypt , encrypt
78
89from aleph .sdk .conf import settings
9-
10- import logging
10+ from aleph .sdk .utils import enum_as_str
1111
1212logger = logging .getLogger (__name__ )
1313
14+
1415def get_verification_buffer (message : Dict ) -> bytes :
1516 """
1617 Returns the verification buffer that Aleph nodes use to verify the signature of a message.
@@ -22,7 +23,16 @@ def get_verification_buffer(message: Dict) -> bytes:
2223 Returns:
2324 bytes: Verification buffer
2425 """
25- return "{chain}\n {sender}\n {type}\n {item_hash}" .format (** message ).encode ("utf-8" )
26+
27+ # Convert Enum values to strings
28+ return "\n " .join (
29+ (
30+ enum_as_str (message ["chain" ]),
31+ message ["sender" ],
32+ enum_as_str (message ["type" ]),
33+ message ["item_hash" ],
34+ )
35+ ).encode ()
2636
2737
2838def get_public_key (private_key ):
You can’t perform that action at this time.
0 commit comments